diff --git a/librarian.yaml b/librarian.yaml index 7c3cb742eb0e..e838a41fd439 100644 --- a/librarian.yaml +++ b/librarian.yaml @@ -1590,7 +1590,6 @@ libraries: - path: google/cloud/visionai/v1 - path: google/cloud/visionai/v1alpha1 copyright_year: "2026" - skip_generate: true nodejs: default_version: v1 - name: google-cloud-vmmigration diff --git a/packages/google-cloud-visionai/.OwlBot.yaml b/packages/google-cloud-visionai/.OwlBot.yaml deleted file mode 100644 index 27d901bf0654..000000000000 --- a/packages/google-cloud-visionai/.OwlBot.yaml +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -deep-copy-regex: - - source: /google/cloud/visionai/google-cloud-visionai-nodejs - dest: /owl-bot-staging/google-cloud-visionai - -api-name: visionai diff --git a/packages/google-cloud-visionai/.repo-metadata.json b/packages/google-cloud-visionai/.repo-metadata.json index eb934ee8d4f7..de399d3a03d5 100644 --- a/packages/google-cloud-visionai/.repo-metadata.json +++ b/packages/google-cloud-visionai/.repo-metadata.json @@ -1,17 +1,16 @@ { - "name": "visionai", - "name_pretty": "Vision AI API", - "product_documentation": "https://cloud.google.com/vision-ai/docs", - "client_documentation": "https://cloud.google.com/nodejs/docs/reference/visionai/latest", - "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", - "release_level": "preview", - "language": "nodejs", - "repo": "googleapis/google-cloud-node", - "distribution_name": "@google-cloud/visionai", - "api_id": "visionai.googleapis.com", - "default_version": "v1", - "requires_billing": true, - "library_type": "GAPIC_AUTO", - "api_shortname": "visionai" -} - + "api_description": "Vertex AI Vision is an AI-powered platform to ingest, analyze and store video data.", + "api_id": "visionai.googleapis.com", + "api_shortname": "visionai", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/visionai/latest", + "default_version": "v1", + "distribution_name": "@google-cloud/visionai", + "issue_tracker": "https://issuetracker.google.com/issues/new?component=187174&template=1161261", + "language": "nodejs", + "library_type": "GAPIC_AUTO", + "name": "visionai", + "name_pretty": "Vision AI", + "product_documentation": "https://cloud.google.com/vision-ai/docs", + "release_level": "preview", + "repo": "googleapis/google-cloud-node" +} \ No newline at end of file diff --git a/packages/google-cloud-visionai/protos/google/cloud/visionai/v1alpha1/annotations.proto b/packages/google-cloud-visionai/protos/google/cloud/visionai/v1alpha1/annotations.proto new file mode 100644 index 000000000000..d09ce9a645d9 --- /dev/null +++ b/packages/google-cloud-visionai/protos/google/cloud/visionai/v1alpha1/annotations.proto @@ -0,0 +1,659 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.visionai.v1alpha1; + +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.VisionAI.V1Alpha1"; +option go_package = "cloud.google.com/go/visionai/apiv1alpha1/visionaipb;visionaipb"; +option java_multiple_files = true; +option java_outer_classname = "AnnotationsProto"; +option java_package = "com.google.cloud.visionai.v1alpha1"; +option php_namespace = "Google\\Cloud\\VisionAI\\V1alpha1"; +option ruby_package = "Google::Cloud::VisionAI::V1alpha1"; + +// Enum describing all possible types of a stream annotation. +enum StreamAnnotationType { + // Type UNSPECIFIED. + STREAM_ANNOTATION_TYPE_UNSPECIFIED = 0; + + // active_zone annotation defines a polygon on top of the content from an + // image/video based stream, following processing will only focus on the + // content inside the active zone. + STREAM_ANNOTATION_TYPE_ACTIVE_ZONE = 1; + + // crossing_line annotation defines a polyline on top of the content from an + // image/video based Vision AI stream, events happening across the line will + // be captured. For example, the counts of people who goes acroos the line + // in Occupancy Analytic Processor. + STREAM_ANNOTATION_TYPE_CROSSING_LINE = 2; +} + +// Output format for Personal Protective Equipment Detection Operator. +message PersonalProtectiveEquipmentDetectionOutput { + // The entity info for annotations from person detection prediction result. + message PersonEntity { + // Entity id. + int64 person_entity_id = 1; + } + + // The entity info for annotations from PPE detection prediction result. + message PPEEntity { + // Label id. + int64 ppe_label_id = 1; + + // Human readable string of the label (Examples: helmet, glove, mask). + string ppe_label_string = 2; + + // Human readable string of the super category label (Examples: head_cover, + // hands_cover, face_cover). + string ppe_supercategory_label_string = 3; + + // Entity id. + int64 ppe_entity_id = 4; + } + + // Bounding Box in the normalized coordinates. + message NormalizedBoundingBox { + // Min in x coordinate. + float xmin = 1; + + // Min in y coordinate. + float ymin = 2; + + // Width of the bounding box. + float width = 3; + + // Height of the bounding box. + float height = 4; + } + + // PersonIdentified box contains the location and the entity info of the + // person. + message PersonIdentifiedBox { + // An unique id for this box. + int64 box_id = 1; + + // Bounding Box in the normalized coordinates. + NormalizedBoundingBox normalized_bounding_box = 2; + + // Confidence score associated with this box. + float confidence_score = 3; + + // Person entity info. + PersonEntity person_entity = 4; + } + + // PPEIdentified box contains the location and the entity info of the PPE. + message PPEIdentifiedBox { + // An unique id for this box. + int64 box_id = 1; + + // Bounding Box in the normalized coordinates. + NormalizedBoundingBox normalized_bounding_box = 2; + + // Confidence score associated with this box. + float confidence_score = 3; + + // PPE entity info. + PPEEntity ppe_entity = 4; + } + + // Detected Person contains the detected person and their associated + // ppes and their protecting information. + message DetectedPerson { + // The id of detected person. + int64 person_id = 1; + + // The info of detected person identified box. + PersonIdentifiedBox detected_person_identified_box = 2; + + // The info of detected person associated ppe identified boxes. + repeated PPEIdentifiedBox detected_ppe_identified_boxes = 3; + + // Coverage score for each body part. + // Coverage score for face. + optional float face_coverage_score = 4; + + // Coverage score for eyes. + optional float eyes_coverage_score = 5; + + // Coverage score for head. + optional float head_coverage_score = 6; + + // Coverage score for hands. + optional float hands_coverage_score = 7; + + // Coverage score for body. + optional float body_coverage_score = 8; + + // Coverage score for feet. + optional float feet_coverage_score = 9; + } + + // Current timestamp. + google.protobuf.Timestamp current_time = 1; + + // A list of DetectedPersons. + repeated DetectedPerson detected_persons = 2; +} + +// Prediction output format for Generic Object Detection. +message ObjectDetectionPredictionResult { + // The entity info for annotations from object detection prediction result. + message Entity { + // Label id. + int64 label_id = 1; + + // Human readable string of the label. + string label_string = 2; + } + + // Identified box contains location and the entity of the object. + message IdentifiedBox { + // Bounding Box in the normalized coordinates. + message NormalizedBoundingBox { + // Min in x coordinate. + float xmin = 1; + + // Min in y coordinate. + float ymin = 2; + + // Width of the bounding box. + float width = 3; + + // Height of the bounding box. + float height = 4; + } + + // An unique id for this box. + int64 box_id = 1; + + // Bounding Box in the normalized coordinates. + NormalizedBoundingBox normalized_bounding_box = 2; + + // Confidence score associated with this box. + float confidence_score = 3; + + // Entity of this box. + Entity entity = 4; + } + + // Current timestamp. + google.protobuf.Timestamp current_time = 1; + + // A list of identified boxes. + repeated IdentifiedBox identified_boxes = 2; +} + +// Prediction output format for Image Object Detection. +message ImageObjectDetectionPredictionResult { + // The resource IDs of the AnnotationSpecs that had been identified, ordered + // by the confidence score descendingly. It is the id segment instead of full + // resource name. + repeated int64 ids = 1; + + // The display names of the AnnotationSpecs that had been identified, order + // matches the IDs. + repeated string display_names = 2; + + // The Model's confidences in correctness of the predicted IDs, higher value + // means higher confidence. Order matches the Ids. + repeated float confidences = 3; + + // Bounding boxes, i.e. the rectangles over the image, that pinpoint + // the found AnnotationSpecs. Given in order that matches the IDs. Each + // bounding box is an array of 4 numbers `xMin`, `xMax`, `yMin`, and + // `yMax`, which represent the extremal coordinates of the box. They are + // relative to the image size, and the point 0,0 is in the top left + // of the image. + repeated google.protobuf.ListValue bboxes = 4; +} + +// Prediction output format for Image and Text Classification. +message ClassificationPredictionResult { + // The resource IDs of the AnnotationSpecs that had been identified. + repeated int64 ids = 1; + + // The display names of the AnnotationSpecs that had been identified, order + // matches the IDs. + repeated string display_names = 2; + + // The Model's confidences in correctness of the predicted IDs, higher value + // means higher confidence. Order matches the Ids. + repeated float confidences = 3; +} + +// Prediction output format for Image Segmentation. +message ImageSegmentationPredictionResult { + // A PNG image where each pixel in the mask represents the category in which + // the pixel in the original image was predicted to belong to. The size of + // this image will be the same as the original image. The mapping between the + // AnntoationSpec and the color can be found in model's metadata. The model + // will choose the most likely category and if none of the categories reach + // the confidence threshold, the pixel will be marked as background. + string category_mask = 1; + + // A one channel image which is encoded as an 8bit lossless PNG. The size of + // the image will be the same as the original image. For a specific pixel, + // darker color means less confidence in correctness of the cateogry in the + // categoryMask for the corresponding pixel. Black means no confidence and + // white means complete confidence. + string confidence_mask = 2; +} + +// Prediction output format for Video Action Recognition. +message VideoActionRecognitionPredictionResult { + // Each IdentifiedAction is one particular identification of an action + // specified with the AnnotationSpec id, display_name and the associated + // confidence score. + message IdentifiedAction { + // The resource ID of the AnnotationSpec that had been identified. + string id = 1; + + // The display name of the AnnotationSpec that had been identified. + string display_name = 2; + + // The Model's confidence in correction of this identification, higher + // value means higher confidence. + float confidence = 3; + } + + // The beginning, inclusive, of the video's time segment in which the + // actions have been identified. + google.protobuf.Timestamp segment_start_time = 1; + + // The end, inclusive, of the video's time segment in which the actions have + // been identified. Particularly, if the end is the same as the start, it + // means the identification happens on a specific video frame. + google.protobuf.Timestamp segment_end_time = 2; + + // All of the actions identified in the time range. + repeated IdentifiedAction actions = 3; +} + +// Prediction output format for Video Object Tracking. +message VideoObjectTrackingPredictionResult { + // Boundingbox for detected object. I.e. the rectangle over the video frame + // pinpointing the found AnnotationSpec. The coordinates are relative to the + // frame size, and the point 0,0 is in the top left of the frame. + message BoundingBox { + // The leftmost coordinate of the bounding box. + float x_min = 1; + + // The rightmost coordinate of the bounding box. + float x_max = 2; + + // The topmost coordinate of the bounding box. + float y_min = 3; + + // The bottommost coordinate of the bounding box. + float y_max = 4; + } + + // Each DetectedObject is one particular identification of an object + // specified with the AnnotationSpec id and display_name, the bounding box, + // the associated confidence score and the corresponding track_id. + message DetectedObject { + // The resource ID of the AnnotationSpec that had been identified. + string id = 1; + + // The display name of the AnnotationSpec that had been identified. + string display_name = 2; + + // Boundingbox. + BoundingBox bounding_box = 3; + + // The Model's confidence in correction of this identification, higher + // value means higher confidence. + float confidence = 4; + + // The same object may be identified on muitiple frames which are typical + // adjacent. The set of frames where a particular object has been detected + // form a track. This track_id can be used to trace down all frames for an + // detected object. + int64 track_id = 5; + } + + // The beginning, inclusive, of the video's time segment in which the + // current identifications happens. + google.protobuf.Timestamp segment_start_time = 1; + + // The end, inclusive, of the video's time segment in which the current + // identifications happen. Particularly, if the end is the same as the start, + // it means the identifications happen on a specific video frame. + google.protobuf.Timestamp segment_end_time = 2; + + // All of the objects detected in the specified time range. + repeated DetectedObject objects = 3; +} + +// Prediction output format for Video Classification. +message VideoClassificationPredictionResult { + // Each IdentifiedClassification is one particular identification of an + // classification specified with the AnnotationSpec id and display_name, + // and the associated confidence score. + message IdentifiedClassification { + // The resource ID of the AnnotationSpec that had been identified. + string id = 1; + + // The display name of the AnnotationSpec that had been identified. + string display_name = 2; + + // The Model's confidence in correction of this identification, higher + // value means higher confidence. + float confidence = 3; + } + + // The beginning, inclusive, of the video's time segment in which the + // classifications have been identified. + google.protobuf.Timestamp segment_start_time = 1; + + // The end, inclusive, of the video's time segment in which the + // classifications have been identified. Particularly, if the end is the same + // as the start, it means the identification happens on a specific video + // frame. + google.protobuf.Timestamp segment_end_time = 2; + + // All of the classifications identified in the time range. + repeated IdentifiedClassification classifications = 3; +} + +// The prediction result proto for occupancy counting. +message OccupancyCountingPredictionResult { + // The entity info for annotations from occupancy counting operator. + message Entity { + // Label id. + int64 label_id = 1; + + // Human readable string of the label. + string label_string = 2; + } + + // Identified box contains location and the entity of the object. + message IdentifiedBox { + // Bounding Box in the normalized coordinates. + message NormalizedBoundingBox { + // Min in x coordinate. + float xmin = 1; + + // Min in y coordinate. + float ymin = 2; + + // Width of the bounding box. + float width = 3; + + // Height of the bounding box. + float height = 4; + } + + // An unique id for this box. + int64 box_id = 1; + + // Bounding Box in the normalized coordinates. + NormalizedBoundingBox normalized_bounding_box = 2; + + // Confidence score associated with this box. + float score = 3; + + // Entity of this box. + Entity entity = 4; + + // An unique id to identify a track. It should be consistent across frames. + // It only exists if tracking is enabled. + int64 track_id = 5; + } + + // The statistics info for annotations from occupancy counting operator. + message Stats { + // The object info and instant count for annotations from occupancy counting + // operator. + message ObjectCount { + // Entity of this object. + Entity entity = 1; + + // Count of the object. + int32 count = 2; + } + + // The object info and accumulated count for annotations from occupancy + // counting operator. + message AccumulatedObjectCount { + // The start time of the accumulated count. + google.protobuf.Timestamp start_time = 1; + + // The object count for the accumulated count. + ObjectCount object_count = 2; + } + + // Message for Crossing line count. + message CrossingLineCount { + // Line annotation from the user. + StreamAnnotation annotation = 1; + + // The direction that follows the right hand rule. + repeated ObjectCount positive_direction_counts = 2; + + // The direction that is opposite to the right hand rule. + repeated ObjectCount negative_direction_counts = 3; + + // The accumulated positive count. + repeated AccumulatedObjectCount accumulated_positive_direction_counts = 4; + + // The accumulated negative count. + repeated AccumulatedObjectCount accumulated_negative_direction_counts = 5; + } + + // Message for the active zone count. + message ActiveZoneCount { + // Active zone annotation from the user. + StreamAnnotation annotation = 1; + + // Counts in the zone. + repeated ObjectCount counts = 2; + } + + // Counts of the full frame. + repeated ObjectCount full_frame_count = 1; + + // Crossing line counts. + repeated CrossingLineCount crossing_line_counts = 2; + + // Active zone counts. + repeated ActiveZoneCount active_zone_counts = 3; + } + + // The track info for annotations from occupancy counting operator. + message TrackInfo { + // An unique id to identify a track. It should be consistent across frames. + string track_id = 1; + + // Start timestamp of this track. + google.protobuf.Timestamp start_time = 2; + } + + // The dwell time info for annotations from occupancy counting operator. + message DwellTimeInfo { + // An unique id to identify a track. It should be consistent across frames. + string track_id = 1; + + // The unique id for the zone in which the object is dwelling/waiting. + string zone_id = 2; + + // The beginning time when a dwelling object has been identified in a zone. + google.protobuf.Timestamp dwell_start_time = 3; + + // The end time when a dwelling object has exited in a zone. + google.protobuf.Timestamp dwell_end_time = 4; + } + + // Current timestamp. + google.protobuf.Timestamp current_time = 1; + + // A list of identified boxes. + repeated IdentifiedBox identified_boxes = 2; + + // Detection statistics. + Stats stats = 3; + + // Track related information. All the tracks that are live at this timestamp. + // It only exists if tracking is enabled. + repeated TrackInfo track_info = 4; + + // Dwell time related information. All the tracks that are live in a given + // zone with a start and end dwell time timestamp + repeated DwellTimeInfo dwell_time_info = 5; +} + +// message about annotations about Vision AI stream resource. +message StreamAnnotation { + oneof annotation_payload { + // Annotation for type ACTIVE_ZONE + NormalizedPolygon active_zone = 5; + + // Annotation for type CROSSING_LINE + NormalizedPolyline crossing_line = 6; + } + + // ID of the annotation. It must be unique when used in the certain context. + // For example, all the annotations to one input streams of a Vision AI + // application. + string id = 1; + + // User-friendly name for the annotation. + string display_name = 2; + + // The Vision AI stream resource name. + string source_stream = 3; + + // The actual type of Annotation. + StreamAnnotationType type = 4; +} + +// A wrapper of repeated StreamAnnotation. +message StreamAnnotations { + // Multiple annotations. + repeated StreamAnnotation stream_annotations = 1; +} + +// Normalized Polygon. +message NormalizedPolygon { + // The bounding polygon normalized vertices. Top left corner of the image + // will be [0, 0]. + repeated NormalizedVertex normalized_vertices = 1; +} + +// Normalized Pplyline, which represents a curve consisting of connected +// straight-line segments. +message NormalizedPolyline { + // A sequence of vertices connected by straight lines. + repeated NormalizedVertex normalized_vertices = 1; +} + +// A vertex represents a 2D point in the image. +// NOTE: the normalized vertex coordinates are relative to the original image +// and range from 0 to 1. +message NormalizedVertex { + // X coordinate. + float x = 1; + + // Y coordinate. + float y = 2; +} + +// Message of essential metadata of App Platform. +// This message is usually attached to a certain processor output annotation for +// customer to identify the source of the data. +message AppPlatformMetadata { + // The application resource name. + string application = 1; + + // The instance resource id. Instance is the nested resource of application + // under collection 'instances'. + string instance_id = 2; + + // The node name of the application graph. + string node = 3; + + // The referred processor resource name of the application node. + string processor = 4; +} + +// For any cloud function based customer processing logic, customer's cloud +// function is expected to receive AppPlatformCloudFunctionRequest as request +// and send back AppPlatformCloudFunctionResponse as response. +// Message of request from AppPlatform to Cloud Function. +message AppPlatformCloudFunctionRequest { + // A general annotation message that uses struct format to represent different + // concrete annotation protobufs. + message StructedInputAnnotation { + // The ingestion time of the current annotation. + int64 ingestion_time_micros = 1; + + // The struct format of the actual annotation. + google.protobuf.Struct annotation = 2; + } + + // The metadata of the AppPlatform for customer to identify the source of the + // payload. + AppPlatformMetadata app_platform_metadata = 1; + + // The actual annotations to be processed by the customized Cloud Function. + repeated StructedInputAnnotation annotations = 2; +} + +// Message of the response from customer's Cloud Function to AppPlatform. +message AppPlatformCloudFunctionResponse { + // A general annotation message that uses struct format to represent different + // concrete annotation protobufs. + message StructedOutputAnnotation { + // The struct format of the actual annotation. + google.protobuf.Struct annotation = 1; + } + + // The modified annotations that is returned back to AppPlatform. + // If the annotations fields are empty, then those annotations will be dropped + // by AppPlatform. + repeated StructedOutputAnnotation annotations = 2; + + // If set to true, AppPlatform will use original annotations instead of + // dropping them, even if it is empty in the annotations filed. + bool annotation_passthrough = 3; + + // The event notifications that is returned back to AppPlatform. Typically it + // will then be configured to be consumed/forwared to a operator that handles + // events, such as Pub/Sub operator. + repeated AppPlatformEventBody events = 4; +} + +// Message of content of appPlatform event +message AppPlatformEventBody { + // Human readable string of the event like "There are more than 6 people in + // the scene". or "Shelf is empty!". + string event_message = 1; + + // For the case of Pub/Sub, it will be stored in the message attributes. + // ​​pubsub.proto + google.protobuf.Struct payload = 2; + + // User defined Event Id, used to classify event, within a delivery interval, + // events from the same application instance with the same id will be + // de-duplicated & only first one will be sent out. Empty event_id will be + // treated as "". + string event_id = 3; +} diff --git a/packages/google-cloud-visionai/protos/google/cloud/visionai/v1alpha1/common.proto b/packages/google-cloud-visionai/protos/google/cloud/visionai/v1alpha1/common.proto new file mode 100644 index 000000000000..8df274310bc5 --- /dev/null +++ b/packages/google-cloud-visionai/protos/google/cloud/visionai/v1alpha1/common.proto @@ -0,0 +1,114 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.visionai.v1alpha1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.VisionAI.V1Alpha1"; +option go_package = "cloud.google.com/go/visionai/apiv1alpha1/visionaipb;visionaipb"; +option java_multiple_files = true; +option java_outer_classname = "CommonProto"; +option java_package = "com.google.cloud.visionai.v1alpha1"; +option php_namespace = "Google\\Cloud\\VisionAI\\V1alpha1"; +option ruby_package = "Google::Cloud::VisionAI::V1alpha1"; + +// Message describing the Cluster object. +message Cluster { + option (google.api.resource) = { + type: "visionai.googleapis.com/Cluster" + pattern: "projects/{project}/locations/{location}/clusters/{cluster}" + }; + + // The current state of the cluster. + enum State { + // Not set. + STATE_UNSPECIFIED = 0; + + // The PROVISIONING state indicates the cluster is being created. + PROVISIONING = 1; + + // The RUNNING state indicates the cluster has been created and is fully + // usable. + RUNNING = 2; + + // The STOPPING state indicates the cluster is being deleted. + STOPPING = 3; + + // The ERROR state indicates the cluster is unusable. It will be + // automatically deleted. + ERROR = 4; + } + + // Output only. Name of the resource. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The create timestamp. + google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The update timestamp. + google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Labels as key value pairs + map labels = 4; + + // Annotations to allow clients to store small amounts of arbitrary data. + map annotations = 5; + + // Output only. The DNS name of the data plane service + string dataplane_service_endpoint = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current state of the cluster. + State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The private service connection service target name. + string psc_target = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Represents the metadata of the long-running operation. +message OperationMetadata { + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server-defined resource path for the target of the operation. + string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the verb executed by the operation. + string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human-readable status of the operation, if any. + string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Identifies whether the user has requested cancellation + // of the operation. Operations that have successfully been cancelled + // have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + // corresponding to `Code.CANCELLED`. + bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. API version used to start the operation. + string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The Google Cloud Storage location for the input content. +message GcsSource { + // Required. References to a Google Cloud Storage paths. + repeated string uris = 1 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/packages/google-cloud-visionai/protos/google/cloud/visionai/v1alpha1/lva.proto b/packages/google-cloud-visionai/protos/google/cloud/visionai/v1alpha1/lva.proto new file mode 100644 index 000000000000..a0adbf3e3e7e --- /dev/null +++ b/packages/google-cloud-visionai/protos/google/cloud/visionai/v1alpha1/lva.proto @@ -0,0 +1,115 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.visionai.v1alpha1; + +option csharp_namespace = "Google.Cloud.VisionAI.V1Alpha1"; +option go_package = "cloud.google.com/go/visionai/apiv1alpha1/visionaipb;visionaipb"; +option java_multiple_files = true; +option java_outer_classname = "LvaProto"; +option java_package = "com.google.cloud.visionai.v1alpha1"; +option php_namespace = "Google\\Cloud\\VisionAI\\V1alpha1"; +option ruby_package = "Google::Cloud::VisionAI::V1alpha1"; + +// Represents an actual value of an operator attribute. +message AttributeValue { + // Attribute value. + oneof value { + // int. + int64 i = 1; + + // float. + float f = 2; + + // bool. + bool b = 3; + + // string. + bytes s = 4; + } +} + +// Defines an Analyzer. +// +// An analyzer processes data from its input streams using the logic defined in +// the Operator that it represents. Of course, it produces data for the output +// streams declared in the Operator. +message AnalyzerDefinition { + // The inputs to this analyzer. + // + // We accept input name references of the following form: + // : + // + // Example: + // + // Suppose you had an operator named "SomeOp" that has 2 output + // arguments, the first of which is named "foo" and the second of which is + // named "bar", and an operator named "MyOp" that accepts 2 inputs. + // + // Also suppose that there is an analyzer named "some-analyzer" that is + // running "SomeOp" and another analyzer named "my-analyzer" running "MyOp". + // + // To indicate that "my-analyzer" is to consume "some-analyzer"'s "foo" + // output as its first input and "some-analyzer"'s "bar" output as its + // second input, you can set this field to the following: + // input = ["some-analyzer:foo", "some-analyzer:bar"] + message StreamInput { + // The name of the stream input (as discussed above). + string input = 1; + } + + // Options available for debugging purposes only. + message DebugOptions { + // Environment variables. + map environment_variables = 1; + } + + // The name of this analyzer. + // + // Tentatively [a-z][a-z0-9]*(_[a-z0-9]+)*. + string analyzer = 1; + + // The name of the operator that this analyzer runs. + // + // Must match the name of a supported operator. + string operator = 2; + + // Input streams. + repeated StreamInput inputs = 3; + + // The attribute values that this analyzer applies to the operator. + // + // Supply a mapping between the attribute names and the actual value you wish + // to apply. If an attribute name is omitted, then it will take a + // preconfigured default value. + map attrs = 4; + + // Debug options. + DebugOptions debug_options = 5; +} + +// Defines a full analysis. +// +// This is a description of the overall live analytics pipeline. +// You may think of this as an edge list representation of a multigraph. +// +// This may be directly authored by a human in protobuf textformat, or it may be +// generated by a programming API (perhaps Python or JavaScript depending on +// context). +message AnalysisDefinition { + // Analyzer definitions. + repeated AnalyzerDefinition analyzers = 1; +} diff --git a/packages/google-cloud-visionai/protos/google/cloud/visionai/v1alpha1/lva_resources.proto b/packages/google-cloud-visionai/protos/google/cloud/visionai/v1alpha1/lva_resources.proto new file mode 100644 index 000000000000..57d7a97a9223 --- /dev/null +++ b/packages/google-cloud-visionai/protos/google/cloud/visionai/v1alpha1/lva_resources.proto @@ -0,0 +1,65 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.visionai.v1alpha1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/visionai/v1alpha1/lva.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.VisionAI.V1Alpha1"; +option go_package = "cloud.google.com/go/visionai/apiv1alpha1/visionaipb;visionaipb"; +option java_multiple_files = true; +option java_outer_classname = "LvaResourcesProto"; +option java_package = "com.google.cloud.visionai.v1alpha1"; +option php_namespace = "Google\\Cloud\\VisionAI\\V1alpha1"; +option ruby_package = "Google::Cloud::VisionAI::V1alpha1"; + +// Message describing the Analysis object. +message Analysis { + option (google.api.resource) = { + type: "visionai.googleapis.com/Analysis" + pattern: "projects/{project}/locations/{location}/clusters/{cluster}/analyses/{analysis}" + }; + + // The name of resource. + string name = 1; + + // Output only. The create timestamp. + google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The update timestamp. + google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Labels as key value pairs. + map labels = 4; + + // The definition of the analysis. + AnalysisDefinition analysis_definition = 5; + + // Map from the input parameter in the definition to the real stream. + // E.g., suppose you had a stream source operator named "input-0" and you try + // to receive from the real stream "stream-0". You can add the following + // mapping: [input-0: stream-0]. + map input_streams_mapping = 6; + + // Map from the output parameter in the definition to the real stream. + // E.g., suppose you had a stream sink operator named "output-0" and you try + // to send to the real stream "stream-0". You can add the following + // mapping: [output-0: stream-0]. + map output_streams_mapping = 7; +} diff --git a/packages/google-cloud-visionai/protos/google/cloud/visionai/v1alpha1/lva_service.proto b/packages/google-cloud-visionai/protos/google/cloud/visionai/v1alpha1/lva_service.proto new file mode 100644 index 000000000000..cd8d5791db2e --- /dev/null +++ b/packages/google-cloud-visionai/protos/google/cloud/visionai/v1alpha1/lva_service.proto @@ -0,0 +1,227 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.visionai.v1alpha1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/visionai/v1alpha1/lva_resources.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.VisionAI.V1Alpha1"; +option go_package = "cloud.google.com/go/visionai/apiv1alpha1/visionaipb;visionaipb"; +option java_multiple_files = true; +option java_outer_classname = "LvaServiceProto"; +option java_package = "com.google.cloud.visionai.v1alpha1"; +option php_namespace = "Google\\Cloud\\VisionAI\\V1alpha1"; +option ruby_package = "Google::Cloud::VisionAI::V1alpha1"; + +// Service describing handlers for resources. The service enables clients to run +// Live Video Analytics (LVA) on the streaming inputs. +service LiveVideoAnalytics { + option (google.api.default_host) = "visionai.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Lists Analyses in a given project and location. + rpc ListAnalyses(ListAnalysesRequest) returns (ListAnalysesResponse) { + option (google.api.http) = { + get: "/v1alpha1/{parent=projects/*/locations/*/clusters/*}/analyses" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Analysis. + rpc GetAnalysis(GetAnalysisRequest) returns (Analysis) { + option (google.api.http) = { + get: "/v1alpha1/{name=projects/*/locations/*/clusters/*/analyses/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new Analysis in a given project and location. + rpc CreateAnalysis(CreateAnalysisRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha1/{parent=projects/*/locations/*/clusters/*}/analyses" + body: "analysis" + }; + option (google.api.method_signature) = "parent,analysis,analysis_id"; + option (google.longrunning.operation_info) = { + response_type: "Analysis" + metadata_type: "OperationMetadata" + }; + } + + // Updates the parameters of a single Analysis. + rpc UpdateAnalysis(UpdateAnalysisRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1alpha1/{analysis.name=projects/*/locations/*/clusters/*/analyses/*}" + body: "analysis" + }; + option (google.api.method_signature) = "analysis,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Analysis" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single Analysis. + rpc DeleteAnalysis(DeleteAnalysisRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1alpha1/{name=projects/*/locations/*/clusters/*/analyses/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } +} + +// Message for requesting list of Analyses +message ListAnalysesRequest { + // Required. Parent value for ListAnalysesRequest + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "visionai.googleapis.com/Cluster" + } + ]; + + // Requested page size. Server may return fewer items than requested. + // If unspecified, server will pick an appropriate default. + int32 page_size = 2; + + // A token identifying a page of results the server should return. + string page_token = 3; + + // Filtering results + string filter = 4; + + // Hint for how to order the results + string order_by = 5; +} + +// Message for response to listing Analyses +message ListAnalysesResponse { + // The list of Analysis + repeated Analysis analyses = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Message for getting an Analysis. +message GetAnalysisRequest { + // Required. Name of the resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "visionai.googleapis.com/Analysis" + } + ]; +} + +// Message for creating an Analysis. +message CreateAnalysisRequest { + // Required. Value for parent. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "visionai.googleapis.com/Cluster" + } + ]; + + // Required. Id of the requesting object. + string analysis_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created. + Analysis analysis = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request ID, + // the server can check if original operation with the same request ID was + // received, and if so, will ignore the second request. This prevents clients + // from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for updating an Analysis. +message UpdateAnalysisRequest { + // Required. Field mask is used to specify the fields to be overwritten in the + // Analysis resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being updated. + Analysis analysis = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request ID, + // the server can check if original operation with the same request ID was + // received, and if so, will ignore the second request. This prevents clients + // from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for deleting an Analysis. +message DeleteAnalysisRequest { + // Required. Name of the resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "visionai.googleapis.com/Analysis" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request ID, + // the server can check if original operation with the same request ID was + // received, and if so, will ignore the second request. This prevents clients + // from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/packages/google-cloud-visionai/protos/google/cloud/visionai/v1alpha1/platform.proto b/packages/google-cloud-visionai/protos/google/cloud/visionai/v1alpha1/platform.proto new file mode 100644 index 000000000000..390893693afa --- /dev/null +++ b/packages/google-cloud-visionai/protos/google/cloud/visionai/v1alpha1/platform.proto @@ -0,0 +1,2222 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.visionai.v1alpha1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/visionai/v1alpha1/annotations.proto"; +import "google/cloud/visionai/v1alpha1/common.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.VisionAI.V1Alpha1"; +option go_package = "cloud.google.com/go/visionai/apiv1alpha1/visionaipb;visionaipb"; +option java_multiple_files = true; +option java_outer_classname = "PlatformProto"; +option java_package = "com.google.cloud.visionai.v1alpha1"; +option php_namespace = "Google\\Cloud\\VisionAI\\V1alpha1"; +option ruby_package = "Google::Cloud::VisionAI::V1alpha1"; + +// Service describing handlers for resources +service AppPlatform { + option (google.api.default_host) = "visionai.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Lists Applications in a given project and location. + rpc ListApplications(ListApplicationsRequest) returns (ListApplicationsResponse) { + option (google.api.http) = { + get: "/v1alpha1/{parent=projects/*/locations/*}/applications" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Application. + rpc GetApplication(GetApplicationRequest) returns (Application) { + option (google.api.http) = { + get: "/v1alpha1/{name=projects/*/locations/*/applications/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new Application in a given project and location. + rpc CreateApplication(CreateApplicationRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha1/{parent=projects/*/locations/*}/applications" + body: "application" + }; + option (google.api.method_signature) = "parent,application"; + option (google.longrunning.operation_info) = { + response_type: "Application" + metadata_type: "OperationMetadata" + }; + } + + // Updates the parameters of a single Application. + rpc UpdateApplication(UpdateApplicationRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1alpha1/{application.name=projects/*/locations/*/applications/*}" + body: "application" + }; + option (google.api.method_signature) = "application,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Application" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single Application. + rpc DeleteApplication(DeleteApplicationRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1alpha1/{name=projects/*/locations/*/applications/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Deploys a single Application. + rpc DeployApplication(DeployApplicationRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha1/{name=projects/*/locations/*/applications/*}:deploy" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "DeployApplicationResponse" + metadata_type: "OperationMetadata" + }; + } + + // Undeploys a single Application. + rpc UndeployApplication(UndeployApplicationRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha1/{name=projects/*/locations/*/applications/*}:undeploy" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "UndeployApplicationResponse" + metadata_type: "OperationMetadata" + }; + } + + // Adds target stream input to the Application. + // If the Application is deployed, the corresponding new Application instance + // will be created. If the stream has already been in the Application, the RPC + // will fail. + rpc AddApplicationStreamInput(AddApplicationStreamInputRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha1/{name=projects/*/locations/*/applications/*}:addStreamInput" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "AddApplicationStreamInputResponse" + metadata_type: "OperationMetadata" + }; + } + + // Remove target stream input to the Application, if the Application is + // deployed, the corresponding instance based will be deleted. If the stream + // is not in the Application, the RPC will fail. + rpc RemoveApplicationStreamInput(RemoveApplicationStreamInputRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha1/{name=projects/*/locations/*/applications/*}:removeStreamInput" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "RemoveApplicationStreamInputResponse" + metadata_type: "OperationMetadata" + }; + } + + // Update target stream input to the Application, if the Application is + // deployed, the corresponding instance based will be deployed. For + // CreateOrUpdate behavior, set allow_missing to true. + rpc UpdateApplicationStreamInput(UpdateApplicationStreamInputRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha1/{name=projects/*/locations/*/applications/*}:updateStreamInput" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "UpdateApplicationStreamInputResponse" + metadata_type: "OperationMetadata" + }; + } + + // Lists Instances in a given project and location. + rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) { + option (google.api.http) = { + get: "/v1alpha1/{parent=projects/*/locations/*/applications/*}/instances" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Instance. + rpc GetInstance(GetInstanceRequest) returns (Instance) { + option (google.api.http) = { + get: "/v1alpha1/{name=projects/*/locations/*/applications/*/instances/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Adds target stream input to the Application. + // If the Application is deployed, the corresponding new Application instance + // will be created. If the stream has already been in the Application, the RPC + // will fail. + rpc CreateApplicationInstances(CreateApplicationInstancesRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha1/{name=projects/*/locations/*/applications/*}:createApplicationInstances" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "CreateApplicationInstancesResponse" + metadata_type: "OperationMetadata" + }; + } + + // Remove target stream input to the Application, if the Application is + // deployed, the corresponding instance based will be deleted. If the stream + // is not in the Application, the RPC will fail. + rpc DeleteApplicationInstances(DeleteApplicationInstancesRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha1/{name=projects/*/locations/*/applications/*}:deleteApplicationInstances" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + + // Adds target stream input to the Application. + // If the Application is deployed, the corresponding new Application instance + // will be created. If the stream has already been in the Application, the RPC + // will fail. + rpc UpdateApplicationInstances(UpdateApplicationInstancesRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha1/{name=projects/*/locations/*/applications/*}:updateApplicationInstances" + body: "*" + }; + option (google.api.method_signature) = "name, application_instances"; + option (google.longrunning.operation_info) = { + response_type: "UpdateApplicationInstancesResponse" + metadata_type: "OperationMetadata" + }; + } + + // Lists Drafts in a given project and location. + rpc ListDrafts(ListDraftsRequest) returns (ListDraftsResponse) { + option (google.api.http) = { + get: "/v1alpha1/{parent=projects/*/locations/*/applications/*}/drafts" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Draft. + rpc GetDraft(GetDraftRequest) returns (Draft) { + option (google.api.http) = { + get: "/v1alpha1/{name=projects/*/locations/*/applications/*/drafts/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new Draft in a given project and location. + rpc CreateDraft(CreateDraftRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha1/{parent=projects/*/locations/*/applications/*}/drafts" + body: "draft" + }; + option (google.api.method_signature) = "parent,draft,draft_id"; + option (google.longrunning.operation_info) = { + response_type: "Draft" + metadata_type: "OperationMetadata" + }; + } + + // Updates the parameters of a single Draft. + rpc UpdateDraft(UpdateDraftRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1alpha1/{draft.name=projects/*/locations/*/applications/*/drafts/*}" + body: "draft" + }; + option (google.api.method_signature) = "draft,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Draft" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single Draft. + rpc DeleteDraft(DeleteDraftRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1alpha1/{name=projects/*/locations/*/applications/*/drafts/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Lists Processors in a given project and location. + rpc ListProcessors(ListProcessorsRequest) returns (ListProcessorsResponse) { + option (google.api.http) = { + get: "/v1alpha1/{parent=projects/*/locations/*}/processors" + }; + option (google.api.method_signature) = "parent"; + } + + // ListPrebuiltProcessors is a custom pass-through verb that Lists Prebuilt + // Processors. + rpc ListPrebuiltProcessors(ListPrebuiltProcessorsRequest) returns (ListPrebuiltProcessorsResponse) { + option (google.api.http) = { + post: "/v1alpha1/{parent=projects/*/locations/*}/processors:prebuilt" + body: "*" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Processor. + rpc GetProcessor(GetProcessorRequest) returns (Processor) { + option (google.api.http) = { + get: "/v1alpha1/{name=projects/*/locations/*/processors/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new Processor in a given project and location. + rpc CreateProcessor(CreateProcessorRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha1/{parent=projects/*/locations/*}/processors" + body: "processor" + }; + option (google.api.method_signature) = "parent,processor,processor_id"; + option (google.longrunning.operation_info) = { + response_type: "Processor" + metadata_type: "OperationMetadata" + }; + } + + // Updates the parameters of a single Processor. + rpc UpdateProcessor(UpdateProcessorRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1alpha1/{processor.name=projects/*/locations/*/processors/*}" + body: "processor" + }; + option (google.api.method_signature) = "processor,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Processor" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single Processor. + rpc DeleteProcessor(DeleteProcessorRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1alpha1/{name=projects/*/locations/*/processors/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } +} + +// All the supported model types in Vision AI App Platform. +enum ModelType { + // Processor Type UNSPECIFIED. + MODEL_TYPE_UNSPECIFIED = 0; + + // Model Type Image Classification. + IMAGE_CLASSIFICATION = 1; + + // Model Type Object Detection. + OBJECT_DETECTION = 2; + + // Model Type Video Classification. + VIDEO_CLASSIFICATION = 3; + + // Model Type Object Tracking. + VIDEO_OBJECT_TRACKING = 4; + + // Model Type Action Recognition. + VIDEO_ACTION_RECOGNITION = 5; + + // Model Type Occupancy Counting. + OCCUPANCY_COUNTING = 6; + + // Model Type Person Blur. + PERSON_BLUR = 7; + + // Model Type Vertex Custom. + VERTEX_CUSTOM = 8; +} + +// Represents a hardware accelerator type. +enum AcceleratorType { + // Unspecified accelerator type, which means no accelerator. + ACCELERATOR_TYPE_UNSPECIFIED = 0; + + // Nvidia Tesla K80 GPU. + NVIDIA_TESLA_K80 = 1; + + // Nvidia Tesla P100 GPU. + NVIDIA_TESLA_P100 = 2; + + // Nvidia Tesla V100 GPU. + NVIDIA_TESLA_V100 = 3; + + // Nvidia Tesla P4 GPU. + NVIDIA_TESLA_P4 = 4; + + // Nvidia Tesla T4 GPU. + NVIDIA_TESLA_T4 = 5; + + // Nvidia Tesla A100 GPU. + NVIDIA_TESLA_A100 = 8; + + // TPU v2. + TPU_V2 = 6; + + // TPU v3. + TPU_V3 = 7; +} + +// Message for DeleteApplicationInstance Response. +message DeleteApplicationInstancesResponse { + +} + +// Message for CreateApplicationInstance Response. +message CreateApplicationInstancesResponse { + +} + +// Message for UpdateApplicationInstances Response. +message UpdateApplicationInstancesResponse { + +} + +// Message for adding stream input to an Application. +message CreateApplicationInstancesRequest { + // Required. the name of the application to retrieve. + // Format: + // "projects/{project}/locations/{location}/applications/{application}" + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "visionai.googleapis.com/Application" + } + ]; + + // Required. The resources being created. + repeated ApplicationInstance application_instances = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for removing stream input from an Application. +message DeleteApplicationInstancesRequest { + // Required. the name of the application to retrieve. + // Format: + // "projects/{project}/locations/{location}/applications/{application}" + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "visionai.googleapis.com/Application" + } + ]; + + // Required. Id of the requesting object. + repeated string instance_ids = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "visionai.googleapis.com/Instance" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// RPC Request Messages. +// Message for DeployApplication Response. +message DeployApplicationResponse { + +} + +// Message for UndeployApplication Response. +message UndeployApplicationResponse { + +} + +// Message for RemoveApplicationStreamInput Response. +message RemoveApplicationStreamInputResponse { + +} + +// Message for AddApplicationStreamInput Response. +message AddApplicationStreamInputResponse { + +} + +// Message for AddApplicationStreamInput Response. +message UpdateApplicationStreamInputResponse { + +} + +// Message for requesting list of Applications. +message ListApplicationsRequest { + // Required. Parent value for ListApplicationsRequest. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "visionai.googleapis.com/Application" + } + ]; + + // Requested page size. Server may return fewer items than requested. + // If unspecified, server will pick an appropriate default. + int32 page_size = 2; + + // A token identifying a page of results the server should return. + string page_token = 3; + + // Filtering results. + string filter = 4; + + // Hint for how to order the results. + string order_by = 5; +} + +// Message for response to listing Applications. +message ListApplicationsResponse { + // The list of Application. + repeated Application applications = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Message for getting a Application. +message GetApplicationRequest { + // Required. Name of the resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "visionai.googleapis.com/Application" + } + ]; +} + +// Message for creating a Application. +message CreateApplicationRequest { + // Required. Value for parent. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "visionai.googleapis.com/Application" + } + ]; + + // Required. Id of the requesting object. + string application_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created. + Application application = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for updating an Application. +message UpdateApplicationRequest { + // Optional. Field mask is used to specify the fields to be overwritten in the + // Application resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The resource being updated. + Application application = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for deleting an Application. +message DeleteApplicationRequest { + // Required. Name of the resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "visionai.googleapis.com/Application" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, any instances and drafts from this application will also be + // deleted. (Otherwise, the request will only work if the application has no + // instances and drafts.) + bool force = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for deploying an Application. +message DeployApplicationRequest { + // Required. the name of the application to retrieve. + // Format: + // "projects/{project}/locations/{location}/applications/{application}" + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "visionai.googleapis.com/Application" + } + ]; + + // If set, validate the request and preview the application graph, but do not + // actually deploy it. + bool validate_only = 2; + + // Optional. An optional request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether or not to enable monitoring for the application on deployment. + bool enable_monitoring = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for undeploying an Application. +message UndeployApplicationRequest { + // Required. the name of the application to retrieve. + // Format: + // "projects/{project}/locations/{location}/applications/{application}" + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "visionai.googleapis.com/Application" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message about a single stream input config. +message ApplicationStreamInput { + StreamWithAnnotation stream_with_annotation = 1; +} + +// Message for adding stream input to an Application. +message AddApplicationStreamInputRequest { + // Required. the name of the application to retrieve. + // Format: + // "projects/{project}/locations/{location}/applications/{application}" + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "visionai.googleapis.com/Application" + } + ]; + + // The stream inputs to add, the stream resource name is the key of each + // StreamInput, and it must be unique within each application. + repeated ApplicationStreamInput application_stream_inputs = 2; + + // Optional. An optional request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for updating stream input to an Application. +message UpdateApplicationStreamInputRequest { + // Required. the name of the application to retrieve. + // Format: + // "projects/{project}/locations/{location}/applications/{application}" + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "visionai.googleapis.com/Application" + } + ]; + + // The stream inputs to update, the stream resource name is the key of each + // StreamInput, and it must be unique within each application. + repeated ApplicationStreamInput application_stream_inputs = 2; + + // Optional. An optional request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // If true, UpdateApplicationStreamInput will insert stream input to + // application even if the target stream is not included in the application. + bool allow_missing = 4; +} + +// Message for removing stream input from an Application. +message RemoveApplicationStreamInputRequest { + // Message about target streamInput to remove. + message TargetStreamInput { + string stream = 1 [(google.api.resource_reference) = { + type: "visionai.googleapis.com/Stream" + }]; + } + + // Required. the name of the application to retrieve. + // Format: + // "projects/{project}/locations/{location}/applications/{application}" + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "visionai.googleapis.com/Application" + } + ]; + + // The target stream to remove. + repeated TargetStreamInput target_stream_inputs = 2; + + // Optional. An optional request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for requesting list of Instances. +message ListInstancesRequest { + // Required. Parent value for ListInstancesRequest. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "visionai.googleapis.com/Instance" + } + ]; + + // Requested page size. Server may return fewer items than requested. + // If unspecified, server will pick an appropriate default. + int32 page_size = 2; + + // A token identifying a page of results the server should return. + string page_token = 3; + + // Filtering results. + string filter = 4; + + // Hint for how to order the results. + string order_by = 5; +} + +// Message for response to listing Instances. +message ListInstancesResponse { + // The list of Instance. + repeated Instance instances = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Message for getting a Instance. +message GetInstanceRequest { + // Required. Name of the resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "visionai.googleapis.com/Instance" + } + ]; +} + +// Message for requesting list of Drafts. +message ListDraftsRequest { + // Required. Parent value for ListDraftsRequest. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "visionai.googleapis.com/Draft" + } + ]; + + // Requested page size. Server may return fewer items than requested. + // If unspecified, server will pick an appropriate default. + int32 page_size = 2; + + // A token identifying a page of results the server should return. + string page_token = 3; + + // Filtering results. + string filter = 4; + + // Hint for how to order the results. + string order_by = 5; +} + +// Message for response to listing Drafts. +message ListDraftsResponse { + // The list of Draft. + repeated Draft drafts = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Message for getting a Draft. +message GetDraftRequest { + // Required. Name of the resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "visionai.googleapis.com/Draft" + } + ]; +} + +// Message for creating a Draft. +message CreateDraftRequest { + // Required. Value for parent. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "visionai.googleapis.com/Draft" + } + ]; + + // Required. Id of the requesting object. + string draft_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created. + Draft draft = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for updating an Draft. +message UpdateDraftRequest { + // Optional. Field mask is used to specify the fields to be overwritten in the + // Draft resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The resource being updated. + Draft draft = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // If true, UpdateDraftRequest will create one resource if the target resource + // doesn't exist, this time, the field_mask will be ignored. + bool allow_missing = 4; +} + +// Message for updating an ApplicationInstance. +message UpdateApplicationInstancesRequest { + message UpdateApplicationInstance { + // Optional. Field mask is used to specify the fields to be overwritten in the + // Draft resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If + // the user does not provide a mask then all fields will be overwritten. + google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The resource being updated. + Instance instance = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The id of the instance. + string instance_id = 3 [(google.api.field_behavior) = REQUIRED]; + } + + // Required. the name of the application to retrieve. + // Format: + // "projects/{project}/locations/{location}/applications/{application}" + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "visionai.googleapis.com/Application" + } + ]; + + repeated UpdateApplicationInstance application_instances = 2; + + // Optional. An optional request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // If true, Update Request will create one resource if the target resource + // doesn't exist, this time, the field_mask will be ignored. + bool allow_missing = 4; +} + +// Message for deleting an Draft. +message DeleteDraftRequest { + // Required. Name of the resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "visionai.googleapis.com/Draft" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for requesting list of Processors. +message ListProcessorsRequest { + // Required. Parent value for ListProcessorsRequest. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "visionai.googleapis.com/Processor" + } + ]; + + // Requested page size. Server may return fewer items than requested. + // If unspecified, server will pick an appropriate default. + int32 page_size = 2; + + // A token identifying a page of results the server should return. + string page_token = 3; + + // Filtering results. + string filter = 4; + + // Hint for how to order the results. + string order_by = 5; +} + +// Message for response to listing Processors. +message ListProcessorsResponse { + // The list of Processor. + repeated Processor processors = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request Message for listing Prebuilt Processors. +message ListPrebuiltProcessorsRequest { + // Required. Parent path. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "visionai.googleapis.com/Processor" + } + ]; +} + +// Response Message for listing Prebuilt Processors. +message ListPrebuiltProcessorsResponse { + // The list of Processor. + repeated Processor processors = 1; +} + +// Message for getting a Processor. +message GetProcessorRequest { + // Required. Name of the resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "visionai.googleapis.com/Processor" + } + ]; +} + +// Message for creating a Processor. +message CreateProcessorRequest { + // Required. Value for parent. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "visionai.googleapis.com/Processor" + } + ]; + + // Required. Id of the requesting object. + string processor_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created. + Processor processor = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for updating a Processor. +message UpdateProcessorRequest { + // Optional. Field mask is used to specify the fields to be overwritten in the + // Processor resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The resource being updated. + Processor processor = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for deleting a Processor. +message DeleteProcessorRequest { + // Required. Name of the resource + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "visionai.googleapis.com/Processor" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message describing Application object +message Application { + option (google.api.resource) = { + type: "visionai.googleapis.com/Application" + pattern: "projects/{project}/locations/{location}/applications/{application}" + style: DECLARATIVE_FRIENDLY + }; + + // Message storing the runtime information of the application. + message ApplicationRuntimeInfo { + // Message about output resources from application. + message GlobalOutputResource { + // The full resource name of the outputted resources. + string output_resource = 1; + + // The name of graph node who produces the output resource name. + // For example: + // output_resource: + // /projects/123/locations/us-central1/corpora/my-corpus/dataSchemas/my-schema + // producer_node: occupancy-count + string producer_node = 2; + + // The key of the output resource, it has to be unique within the same + // producer node. One producer node can output several output resources, + // the key can be used to match corresponding output resources. + string key = 3; + } + + // Monitoring-related configuration for an application. + message MonitoringConfig { + // Whether this application has monitoring enabled. + bool enabled = 1; + } + + // Timestamp when the engine be deployed + google.protobuf.Timestamp deploy_time = 1; + + // Globally created resources like warehouse dataschemas. + repeated GlobalOutputResource global_output_resources = 3; + + // Monitoring-related configuration for this application. + MonitoringConfig monitoring_config = 4; + } + + // State of the Application + enum State { + // The default value. This value is used if the state is omitted. + STATE_UNSPECIFIED = 0; + + // State CREATED. + CREATED = 1; + + // State DEPLOYING. + DEPLOYING = 2; + + // State DEPLOYED. + DEPLOYED = 3; + + // State UNDEPLOYING. + UNDEPLOYING = 4; + + // State DELETED. + DELETED = 5; + + // State ERROR. + ERROR = 6; + + // State CREATING. + CREATING = 7; + + // State Updating. + UPDATING = 8; + + // State Deleting. + DELETING = 9; + + // State Fixing. + FIXING = 10; + } + + // name of resource + string name = 1; + + // Output only. [Output only] Create timestamp + google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. [Output only] Update timestamp + google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Labels as key value pairs + map labels = 4; + + // Required. A user friendly display name for the solution. + string display_name = 5 [(google.api.field_behavior) = REQUIRED]; + + // A description for this application. + string description = 6; + + // Application graph configuration. + ApplicationConfigs application_configs = 7; + + // Output only. Application graph runtime info. Only exists when application state equals + // to DEPLOYED. + ApplicationRuntimeInfo runtime_info = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. State of the application. + State state = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Message storing the graph of the application. +message ApplicationConfigs { + // message storing the config for event delivery + message EventDeliveryConfig { + // The delivery channel for the event notification, only pub/sub topic is + // supported now. + // Example channel: + // [//pubsub.googleapis.com/projects/visionai-testing-stable/topics/test-topic] + string channel = 1; + + // The expected delivery interval for the same event. The same event won't + // be notified multiple times during this internal event that it is + // happening multiple times during the period of time.The same event is + // identified by . + google.protobuf.Duration minimal_delivery_interval = 2; + } + + // A list of nodes in the application graph. + repeated Node nodes = 1; + + // Event-related configuration for this application. + EventDeliveryConfig event_delivery_config = 3; +} + +// Message describing node object. +message Node { + // Message describing one edge pointing into a node. + message InputEdge { + // The name of the parent node. + string parent_node = 1; + + // The connected output artifact of the parent node. + // It can be omitted if target processor only has 1 output artifact. + string parent_output_channel = 2; + + // The connected input channel of the current node's processor. + // It can be omitted if target processor only has 1 input channel. + string connected_input_channel = 3; + } + + oneof stream_output_config { + // By default, the output of the node will only be available to downstream + // nodes. To consume the direct output from the application node, the output + // must be sent to Vision AI Streams at first. + // + // By setting output_all_output_channels_to_stream to true, App Platform + // will automatically send all the outputs of the current node to Vision AI + // Stream resources (one stream per output channel). The output stream + // resource will be created by App Platform automatically during deployment + // and deleted after application un-deployment. + // Note that this config applies to all the Application Instances. + // + // The output stream can be override at instance level by + // configuring the `output_resources` section of Instance resource. + // `producer_node` should be current node, `output_resource_binding` should + // be the output channel name (or leave it blank if there is only 1 output + // channel of the processor) and `output_resource` should be the target + // output stream. + bool output_all_output_channels_to_stream = 6; + } + + // Required. A unique name for the node. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // A user friendly display name for the node. + string display_name = 2; + + // Node config. + ProcessorConfig node_config = 3; + + // Processor name refer to the chosen processor resource. + string processor = 4; + + // Parent node. Input node should not have parent node. For V1 Alpha1/Beta + // only media warehouse node can have multiple parents, other types of nodes + // will only have one parent. + repeated InputEdge parents = 5; +} + +// Message describing Draft object +message Draft { + option (google.api.resource) = { + type: "visionai.googleapis.com/Draft" + pattern: "projects/{project}/locations/{location}/applications/{application}/drafts/{draft}" + style: DECLARATIVE_FRIENDLY + }; + + // name of resource + string name = 1; + + // Output only. [Output only] Create timestamp + google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. [Output only] Create timestamp + google.protobuf.Timestamp update_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Labels as key value pairs + map labels = 3; + + // Required. A user friendly display name for the solution. + string display_name = 4 [(google.api.field_behavior) = REQUIRED]; + + // A description for this application. + string description = 5; + + // The draft application configs which haven't been updated to an application. + ApplicationConfigs draft_application_configs = 6; +} + +// Message describing Instance object +message Instance { + option (google.api.resource) = { + type: "visionai.googleapis.com/Instance" + pattern: "projects/{project}/locations/{location}/applications/{application}/instances/{instance}" + style: DECLARATIVE_FRIENDLY + }; + + // Message of input resource used in one application instance. + message InputResource { + // Required. Specify the input to the application instance. + oneof input_resource_information { + // The direct input resource name. + string input_resource = 1; + + // If the input resource is VisionAI Stream, the associated annotations + // can be specified using annotated_stream instead. + StreamWithAnnotation annotated_stream = 4 [deprecated = true]; + } + + // The name of graph node who receives the input resource. + // For example: + // input_resource: + // visionai.googleapis.com/v1/projects/123/locations/us-central1/clusters/456/streams/input-stream-a + // consumer_node: stream-input + string consumer_node = 2; + + // The specific input resource binding which will consume the current Input + // Resource, can be ignored is there is only 1 input binding. + string input_resource_binding = 3; + + // Contains resource annotations. + ResourceAnnotations annotations = 5; + } + + // Message of output resource used in one application instance. + message OutputResource { + // The output resource name for the current application instance. + string output_resource = 1; + + // The name of graph node who produces the output resource name. + // For example: + // output_resource: + // /projects/123/locations/us-central1/clusters/456/streams/output-application-789-stream-a-occupancy-counting + // producer_node: occupancy-counting + string producer_node = 2; + + // The specific output resource binding which produces the current + // OutputResource. + string output_resource_binding = 4; + + // Output only. Whether the output resource is temporary which means the resource is + // generated during the deployment of the application. + // Temporary resource will be deleted during the undeployment of the + // application. + bool is_temporary = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Whether the output resource is created automatically by the Vision AI App + // Platform. + bool autogen = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // State of the Instance + enum State { + // The default value. This value is used if the state is omitted. + STATE_UNSPECIFIED = 0; + + // State CREATING. + CREATING = 1; + + // State CREATED. + CREATED = 2; + + // State DEPLOYING. + DEPLOYING = 3; + + // State DEPLOYED. + DEPLOYED = 4; + + // State UNDEPLOYING. + UNDEPLOYING = 5; + + // State DELETED. + DELETED = 6; + + // State ERROR. + ERROR = 7; + + // State Updating + UPDATING = 8; + + // State Deleting. + DELETING = 9; + + // State Fixing. + FIXING = 10; + } + + // Output only. name of resource + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. [Output only] Create timestamp + google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. [Output only] Update timestamp + google.protobuf.Timestamp update_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Labels as key value pairs + map labels = 3; + + // Required. A user friendly display name for the solution. + string display_name = 4 [(google.api.field_behavior) = REQUIRED]; + + // A description for this application. + string description = 5; + + // The input resources for the current application instance. + // For example: + // input_resources: + // visionai.googleapis.com/v1/projects/123/locations/us-central1/clusters/456/streams/stream-a + repeated InputResource input_resources = 6; + + // All the output resources associated to one application instance. + repeated OutputResource output_resources = 7; + + // State of the instance. + State state = 9; +} + +// Message for creating a Instance. +message ApplicationInstance { + // Required. Id of the requesting object. + string instance_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created. + Instance instance = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Message describing Processor object. +// Next ID: 18 +message Processor { + option (google.api.resource) = { + type: "visionai.googleapis.com/Processor" + pattern: "projects/{project}/locations/{location}/processors/{processor}" + style: DECLARATIVE_FRIENDLY + }; + + // Type + enum ProcessorType { + // Processor Type UNSPECIFIED. + PROCESSOR_TYPE_UNSPECIFIED = 0; + + // Processor Type PRETRAINED. + // Pretrained processor is developed by Vision AI App Platform with + // state-of-the-art vision data processing functionality, like occupancy + // counting or person blur. Pretrained processor is usually publicly + // available. + PRETRAINED = 1; + + // Processor Type CUSTOM. + // Custom processors are specialized processors which are either uploaded by + // customers or imported from other GCP platform (for example Vertex AI). + // Custom processor is only visible to the creator. + CUSTOM = 2; + + // Processor Type CONNECTOR. + // Connector processors are special processors which perform I/O for the + // application, they do not processing the data but either deliver the data + // to other processors or receive data from other processors. + CONNECTOR = 3; + } + + enum ProcessorState { + // Unspecified Processor state. + PROCESSOR_STATE_UNSPECIFIED = 0; + + // Processor is being created (not ready for use). + CREATING = 1; + + // Processor is and ready for use. + ACTIVE = 2; + + // Processor is being deleted (not ready for use). + DELETING = 3; + + // Processor deleted or creation failed . + FAILED = 4; + } + + // name of resource. + string name = 1; + + // Output only. [Output only] Create timestamp. + google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. [Output only] Update timestamp. + google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Labels as key value pairs. + map labels = 4; + + // Required. A user friendly display name for the processor. + string display_name = 5 [(google.api.field_behavior) = REQUIRED]; + + // Illustrative sentences for describing the functionality of the processor. + string description = 10; + + // Output only. Processor Type. + ProcessorType processor_type = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Model Type. + ModelType model_type = 13; + + // Source info for customer created processor. + CustomProcessorSourceInfo custom_processor_source_info = 7; + + // Output only. State of the Processor. + ProcessorState state = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. [Output only] The input / output specifications of a processor, each type + // of processor has fixed input / output specs which cannot be altered by + // customer. + ProcessorIOSpec processor_io_spec = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The corresponding configuration can be used in the Application to customize + // the behavior of the processor. + string configuration_typeurl = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + repeated StreamAnnotationType supported_annotation_types = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Indicates if the processor supports post processing. + bool supports_post_processing = 17; +} + +// Message describing the input / output specifications of a processor. +message ProcessorIOSpec { + // Message for input channel specification. + message GraphInputChannelSpec { + // The name of the current input channel. + string name = 1; + + // The data types of the current input channel. + // When this field has more than 1 value, it means this input channel can be + // connected to either of these different data types. + DataType data_type = 2; + + // If specified, only those detailed data types can be connected to the + // processor. For example, jpeg stream for MEDIA, or PredictionResult proto + // for PROTO type. If unspecified, then any proto is accepted. + repeated string accepted_data_type_uris = 5; + + // Whether the current input channel is required by the processor. + // For example, for a processor with required video input and optional audio + // input, if video input is missing, the application will be rejected while + // the audio input can be missing as long as the video input exists. + bool required = 3; + + // How many input edges can be connected to this input channel. 0 means + // unlimited. + int64 max_connection_allowed = 4; + } + + // Message for output channel specification. + message GraphOutputChannelSpec { + // The name of the current output channel. + string name = 1; + + // The data type of the current output channel. + DataType data_type = 2; + + string data_type_uri = 3; + } + + // Message for instance resource channel specification. + // External resources are virtual nodes which are not expressed in the + // application graph. Each processor expresses its out-graph spec, so customer + // is able to override the external source or destinations to the + message InstanceResourceInputBindingSpec { + oneof resource_type { + // The configuration proto that includes the Googleapis resources. I.e. + // type.googleapis.com/google.cloud.vision.v1.StreamWithAnnotation + string config_type_uri = 2; + + // The direct type url of Googleapis resource. i.e. + // type.googleapis.com/google.cloud.vision.v1.Asset + string resource_type_uri = 3; + } + + // Name of the input binding, unique within the processor. + string name = 1; + } + + message InstanceResourceOutputBindingSpec { + // Name of the output binding, unique within the processor. + string name = 1; + + // The resource type uri of the acceptable output resource. + string resource_type_uri = 2; + + // Whether the output resource needs to be explicitly set in the instance. + // If it is false, the processor will automatically generate it if required. + bool explicit = 3; + } + + // High level data types supported by the processor. + enum DataType { + // The default value of DataType. + DATA_TYPE_UNSPECIFIED = 0; + + // Video data type like H264. + VIDEO = 1; + + // Protobuf data type, usually used for general data blob. + PROTO = 2; + } + + // For processors with input_channel_specs, the processor must be explicitly + // connected to another processor. + repeated GraphInputChannelSpec graph_input_channel_specs = 3; + + // The output artifact specifications for the current processor. + repeated GraphOutputChannelSpec graph_output_channel_specs = 4; + + // The input resource that needs to be fed from the application instance. + repeated InstanceResourceInputBindingSpec instance_resource_input_binding_specs = 5; + + // The output resource that the processor will generate per instance. + // Other than the explicitly listed output bindings here, all the processors' + // GraphOutputChannels can be binded to stream resource. The bind name then is + // the same as the GraphOutputChannel's name. + repeated InstanceResourceOutputBindingSpec instance_resource_output_binding_specs = 6; +} + +// Describes the source info for a custom processor. +message CustomProcessorSourceInfo { + // The schema is defined as an OpenAPI 3.0.2 [Schema + // Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). + message ModelSchema { + // Cloud Storage location to a YAML file that defines the format of a single + // instance used in prediction and explanation requests. + GcsSource instances_schema = 1; + + // Cloud Storage location to a YAML file that defines the prediction and + // explanation parameters. + GcsSource parameters_schema = 2; + + // Cloud Storage location to a YAML file that defines the format of a single + // prediction or explanation. + GcsSource predictions_schema = 3; + } + + // Source type of the imported custom processor. + enum SourceType { + // Source type unspecified. + SOURCE_TYPE_UNSPECIFIED = 0; + + // Custom processors coming from Vertex AutoML product. + VERTEX_AUTOML = 1; + + // Custom processors coming from general custom models from Vertex. + VERTEX_CUSTOM = 2; + } + + // The path where App Platform loads the artifacts for the custom processor. + oneof artifact_path { + // The resource name original model hosted in the vertex AI platform. + string vertex_model = 2; + } + + // The original product which holds the custom processor's functionality. + SourceType source_type = 1; + + // Output only. Additional info related to the imported custom processor. + // Data is filled in by app platform during the processor creation. + map additional_info = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Model schema files which specifies the signature of the model. + // For VERTEX_CUSTOM models, instances schema is required. + // If instances schema is not specified during the processor creation, + // VisionAI Platform will try to get it from Vertex, if it doesn't exist, the + // creation will fail. + ModelSchema model_schema = 5; +} + +// Next ID: 24 +message ProcessorConfig { + oneof processor_config { + // Configs of stream input processor. + VideoStreamInputConfig video_stream_input_config = 9; + + // Config of AI-enabled input devices. + AIEnabledDevicesInputConfig ai_enabled_devices_input_config = 20; + + // Configs of media warehouse processor. + MediaWarehouseConfig media_warehouse_config = 10; + + // Configs of person blur processor. + PersonBlurConfig person_blur_config = 11; + + // Configs of occupancy count processor. + OccupancyCountConfig occupancy_count_config = 12; + + // Configs of Person Vehicle Detection processor. + PersonVehicleDetectionConfig person_vehicle_detection_config = 15; + + // Configs of Vertex AutoML vision processor. + VertexAutoMLVisionConfig vertex_automl_vision_config = 13; + + // Configs of Vertex AutoML video processor. + VertexAutoMLVideoConfig vertex_automl_video_config = 14; + + // Configs of Vertex Custom processor. + VertexCustomConfig vertex_custom_config = 17; + + // Configs of General Object Detection processor. + GeneralObjectDetectionConfig general_object_detection_config = 18; + + // Configs of BigQuery processor. + BigQueryConfig big_query_config = 19; + + // Configs of personal_protective_equipment_detection_config + PersonalProtectiveEquipmentDetectionConfig personal_protective_equipment_detection_config = 22; + } +} + +// Message describing Vision AI stream with application specific annotations. +// All the StreamAnnotation object inside this message MUST have unique id. +message StreamWithAnnotation { + // Message describing annotations specific to application node. + message NodeAnnotation { + // The node name of the application graph. + string node = 1; + + // The node specific stream annotations. + repeated StreamAnnotation annotations = 2; + } + + // Vision AI Stream resource name. + string stream = 1 [(google.api.resource_reference) = { + type: "visionai.googleapis.com/Stream" + }]; + + // Annotations that will be applied to the whole application. + repeated StreamAnnotation application_annotations = 2; + + // Annotations that will be applied to the specific node of the application. + // If the same type of the annotations is applied to both application and + // node, the node annotation will be added in addition to the global + // application one. + // For example, if there is one active zone annotation for the whole + // application and one active zone annotation for the Occupancy Analytic + // processor, then the Occupancy Analytic processor will have two active zones + // defined. + repeated NodeAnnotation node_annotations = 3; +} + +// Message describing annotations specific to application node. +// This message is a duplication of StreamWithAnnotation.NodeAnnotation. +message ApplicationNodeAnnotation { + // The node name of the application graph. + string node = 1; + + // The node specific stream annotations. + repeated StreamAnnotation annotations = 2; +} + +// Message describing general annotation for resources. +message ResourceAnnotations { + // Annotations that will be applied to the whole application. + repeated StreamAnnotation application_annotations = 1; + + // Annotations that will be applied to the specific node of the application. + // If the same type of the annotations is applied to both application and + // node, the node annotation will be added in addition to the global + // application one. + // For example, if there is one active zone annotation for the whole + // application and one active zone annotation for the Occupancy Analytic + // processor, then the Occupancy Analytic processor will have two active zones + // defined. + repeated ApplicationNodeAnnotation node_annotations = 2; +} + +// Message describing Video Stream Input Config. +// This message should only be used as a placeholder for builtin:stream-input +// processor, actual stream binding should be specified using corresponding +// API. +message VideoStreamInputConfig { + repeated string streams = 1 [deprecated = true]; + + repeated StreamWithAnnotation streams_with_annotation = 2 [deprecated = true]; +} + +// Message describing AI-enabled Devices Input Config. +message AIEnabledDevicesInputConfig { + +} + +// Message describing MediaWarehouseConfig. +message MediaWarehouseConfig { + // Resource name of the Media Warehouse corpus. + // Format: + // projects/${project_id}/locations/${location_id}/corpora/${corpus_id} + string corpus = 1; + + // Deprecated. + string region = 2 [deprecated = true]; + + // The duration for which all media assets, associated metadata, and search + // documents can exist. + google.protobuf.Duration ttl = 3; +} + +// Message describing FaceBlurConfig. +message PersonBlurConfig { + // Type of Person Blur + enum PersonBlurType { + // PersonBlur Type UNSPECIFIED. + PERSON_BLUR_TYPE_UNSPECIFIED = 0; + + // FaceBlur Type full occlusion. + FULL_OCCULUSION = 1; + + // FaceBlur Type blur filter. + BLUR_FILTER = 2; + } + + // Person blur type. + PersonBlurType person_blur_type = 1; + + // Whether only blur faces other than the whole object in the processor. + bool faces_only = 2; +} + +// Message describing OccupancyCountConfig. +message OccupancyCountConfig { + // Whether to count the appearances of people, output counts have 'people' as + // the key. + bool enable_people_counting = 1; + + // Whether to count the appearances of vehicles, output counts will have + // 'vehicle' as the key. + bool enable_vehicle_counting = 2; + + // Whether to track each invidual object's loitering time inside the scene or + // specific zone. + bool enable_dwelling_time_tracking = 3; +} + +// Message describing PersonVehicleDetectionConfig. +message PersonVehicleDetectionConfig { + // At least one of enable_people_counting and enable_vehicle_counting fields + // must be set to true. + // Whether to count the appearances of people, output counts have 'people' as + // the key. + bool enable_people_counting = 1; + + // Whether to count the appearances of vehicles, output counts will have + // 'vehicle' as the key. + bool enable_vehicle_counting = 2; +} + +// Message describing PersonalProtectiveEquipmentDetectionConfig. +message PersonalProtectiveEquipmentDetectionConfig { + // Whether to enable face coverage detection. + bool enable_face_coverage_detection = 1; + + // Whether to enable head coverage detection. + bool enable_head_coverage_detection = 2; + + // Whether to enable hands coverage detection. + bool enable_hands_coverage_detection = 3; +} + +// Message of configurations for General Object Detection processor. +message GeneralObjectDetectionConfig { + +} + +// Message of configurations for BigQuery processor. +message BigQueryConfig { + // BigQuery table resource for Vision AI Platform to ingest annotations to. + string table = 1; + + // Data Schema + // By default, Vision AI Application will try to write annotations to the + // target BigQuery table using the following schema: + // + // ingestion_time: TIMESTAMP, the ingestion time of the original data. + // + // application: STRING, name of the application which produces the annotation. + // + // instance: STRING, Id of the instance which produces the annotation. + // + // node: STRING, name of the application graph node which produces the + // annotation. + // + // annotation: STRING or JSON, the actual annotation protobuf will be + // converted to json string with bytes field as 64 encoded string. It can be + // written to both String or Json type column. + // + // To forward annotation data to an existing BigQuery table, customer needs to + // make sure the compatibility of the schema. + // The map maps application node name to its corresponding cloud function + // endpoint to transform the annotations directly to the + // google.cloud.bigquery.storage.v1.AppendRowsRequest (only avro_rows or + // proto_rows should be set). If configured, annotations produced by + // corresponding application node will sent to the Cloud Function at first + // before be forwarded to BigQuery. + // + // If the default table schema doesn't fit, customer is able to transform the + // annotation output from Vision AI Application to arbitrary BigQuery table + // schema with CloudFunction. + // * The cloud function will receive AppPlatformCloudFunctionRequest where + // the annotations field will be the json format of Vision AI annotation. + // * The cloud function should return AppPlatformCloudFunctionResponse with + // AppendRowsRequest stored in the annotations field. + // * To drop the annotation, simply clear the annotations field in the + // returned AppPlatformCloudFunctionResponse. + map cloud_function_mapping = 2; + + // If true, App Platform will create the BigQuery DataSet and the + // BigQuery Table with default schema if the specified table doesn't exist. + // This doesn't work if any cloud function customized schema is specified + // since the system doesn't know your desired schema. + // JSON column will be used in the default table created by App Platform. + bool create_default_table_if_not_exists = 3; +} + +// Message of configurations of Vertex AutoML Vision Processors. +message VertexAutoMLVisionConfig { + // Only entities with higher score than the threshold will be returned. + // Value 0.0 means to return all the detected entities. + float confidence_threshold = 1; + + // At most this many predictions will be returned per output frame. + // Value 0 means to return all the detected entities. + int32 max_predictions = 2; +} + +// Message describing VertexAutoMLVideoConfig. +message VertexAutoMLVideoConfig { + // Only entities with higher score than the threshold will be returned. + // Value 0.0 means returns all the detected entities. + float confidence_threshold = 1; + + // Labels specified in this field won't be returned. + repeated string blocked_labels = 2; + + // At most this many predictions will be returned per output frame. + // Value 0 means to return all the detected entities. + int32 max_predictions = 3; + + // Only Bounding Box whose size is larger than this limit will be returned. + // Object Tracking only. + // Value 0.0 means to return all the detected entities. + float bounding_box_size_limit = 4; +} + +// Message describing VertexCustomConfig. +message VertexCustomConfig { + // The max prediction frame per second. This attribute sets how fast the + // operator sends prediction requests to Vertex AI endpoint. Default value is + // 0, which means there is no max prediction fps limit. The operator sends + // prediction requests at input fps. + int32 max_prediction_fps = 1; + + // A description of resources that are dedicated to the DeployedModel, and + // that need a higher degree of manual configuration. + DedicatedResources dedicated_resources = 2; + + // If not empty, the prediction result will be sent to the specified cloud + // function for post processing. + // * The cloud function will receive AppPlatformCloudFunctionRequest where + // the annotations field will be the json format of proto PredictResponse. + // * The cloud function should return AppPlatformCloudFunctionResponse with + // PredictResponse stored in the annotations field. + // * To drop the prediction output, simply clear the payload field in the + // returned AppPlatformCloudFunctionResponse. + string post_processing_cloud_function = 3; + + // If true, the prediction request received by custom model will also contain + // metadata with the following schema: + // 'appPlatformMetadata': { + // 'ingestionTime': DOUBLE; (UNIX timestamp) + // 'application': STRING; + // 'instanceId': STRING; + // 'node': STRING; + // 'processor': STRING; + // } + bool attach_application_metadata = 4; +} + +// Specification of a single machine. +message MachineSpec { + // Immutable. The type of the machine. + // + // See the [list of machine types supported for + // prediction](https://cloud.google.com/vertex-ai/docs/predictions/configure-compute#machine-types) + // + // See the [list of machine types supported for custom + // training](https://cloud.google.com/vertex-ai/docs/training/configure-compute#machine-types). + // + // For [DeployedModel][] this field is optional, and the default + // value is `n1-standard-2`. For [BatchPredictionJob][] or as part of + // [WorkerPoolSpec][] this field is required. + string machine_type = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. The type of accelerator(s) that may be attached to the machine as per + // [accelerator_count][google.cloud.visionai.v1alpha1.MachineSpec.accelerator_count]. + AcceleratorType accelerator_type = 2 [(google.api.field_behavior) = IMMUTABLE]; + + // The number of accelerators to attach to the machine. + int32 accelerator_count = 3; +} + +// The metric specification that defines the target resource utilization +// (CPU utilization, accelerator's duty cycle, and so on) for calculating the +// desired replica count. +message AutoscalingMetricSpec { + // Required. The resource metric name. + // Supported metrics: + // + // * For Online Prediction: + // * `aiplatform.googleapis.com/prediction/online/accelerator/duty_cycle` + // * `aiplatform.googleapis.com/prediction/online/cpu/utilization` + string metric_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // The target resource utilization in percentage (1% - 100%) for the given + // metric; once the real usage deviates from the target by a certain + // percentage, the machine replicas change. The default value is 60 + // (representing 60%) if not provided. + int32 target = 2; +} + +// A description of resources that are dedicated to a DeployedModel, and +// that need a higher degree of manual configuration. +message DedicatedResources { + // Required. Immutable. The specification of a single machine used by the prediction. + MachineSpec machine_spec = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. Immutable. The minimum number of machine replicas this DeployedModel will be always + // deployed on. This value must be greater than or equal to 1. + // + // If traffic against the DeployedModel increases, it may dynamically be + // deployed onto more replicas, and as traffic decreases, some of these extra + // replicas may be freed. + int32 min_replica_count = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Immutable. The maximum number of replicas this DeployedModel may be deployed on when + // the traffic against it increases. If the requested value is too large, + // the deployment will error, but if deployment succeeds then the ability + // to scale the model to that many replicas is guaranteed (barring service + // outages). If traffic against the DeployedModel increases beyond what its + // replicas at maximum may handle, a portion of the traffic will be dropped. + // If this value is not provided, will use [min_replica_count][google.cloud.visionai.v1alpha1.DedicatedResources.min_replica_count] as the + // default value. + // + // The value of this field impacts the charge against Vertex CPU and GPU + // quotas. Specifically, you will be charged for max_replica_count * + // number of cores in the selected machine type) and (max_replica_count * + // number of GPUs per replica in the selected machine type). + int32 max_replica_count = 3 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. The metric specifications that overrides a resource + // utilization metric (CPU utilization, accelerator's duty cycle, and so on) + // target value (default to 60 if not set). At most one entry is allowed per + // metric. + // + // If [machine_spec.accelerator_count][google.cloud.visionai.v1alpha1.MachineSpec.accelerator_count] is + // above 0, the autoscaling will be based on both CPU utilization and + // accelerator's duty cycle metrics and scale up when either metrics exceeds + // its target value while scale down if both metrics are under their target + // value. The default target value is 60 for both metrics. + // + // If [machine_spec.accelerator_count][google.cloud.visionai.v1alpha1.MachineSpec.accelerator_count] is + // 0, the autoscaling will be based on CPU utilization metric only with + // default target value 60 if not explicitly set. + // + // For example, in the case of Online Prediction, if you want to override + // target CPU utilization to 80, you should set + // [autoscaling_metric_specs.metric_name][google.cloud.visionai.v1alpha1.AutoscalingMetricSpec.metric_name] + // to `aiplatform.googleapis.com/prediction/online/cpu/utilization` and + // [autoscaling_metric_specs.target][google.cloud.visionai.v1alpha1.AutoscalingMetricSpec.target] to `80`. + repeated AutoscalingMetricSpec autoscaling_metric_specs = 4 [(google.api.field_behavior) = IMMUTABLE]; +} diff --git a/packages/google-cloud-visionai/protos/google/cloud/visionai/v1alpha1/streaming_resources.proto b/packages/google-cloud-visionai/protos/google/cloud/visionai/v1alpha1/streaming_resources.proto new file mode 100644 index 000000000000..c999660e8b91 --- /dev/null +++ b/packages/google-cloud-visionai/protos/google/cloud/visionai/v1alpha1/streaming_resources.proto @@ -0,0 +1,173 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.visionai.v1alpha1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.VisionAI.V1Alpha1"; +option go_package = "cloud.google.com/go/visionai/apiv1alpha1/visionaipb;visionaipb"; +option java_multiple_files = true; +option java_outer_classname = "StreamingResourcesProto"; +option java_package = "com.google.cloud.visionai.v1alpha1"; +option php_namespace = "Google\\Cloud\\VisionAI\\V1alpha1"; +option ruby_package = "Google::Cloud::VisionAI::V1alpha1"; + +// The descriptor for a gstreamer buffer payload. +message GstreamerBufferDescriptor { + // The caps string of the payload. + string caps_string = 1; + + // Whether the buffer is a key frame. + bool is_key_frame = 2; + + // PTS of the frame. + google.protobuf.Timestamp pts_time = 3; + + // DTS of the frame. + google.protobuf.Timestamp dts_time = 4; + + // Duration of the frame. + google.protobuf.Duration duration = 5; +} + +// The descriptor for a raw image. +message RawImageDescriptor { + // Raw image format. Its possible values are: "srgb". + string format = 1; + + // The height of the image. + int32 height = 2; + + // The width of the image. + int32 width = 3; +} + +// The message that represents the data type of a packet. +message PacketType { + // The message that fully specifies the type of the packet. + message TypeDescriptor { + // Detailed information about the type. + // + // It is non-empty only for specific type class codecs. Needed only when the + // type string alone is not enough to disambiguate the specific type. + oneof type_details { + // GstreamerBufferDescriptor is the descriptor for gstreamer buffer type. + GstreamerBufferDescriptor gstreamer_buffer_descriptor = 2; + + // RawImageDescriptor is the descriptor for the raw image type. + RawImageDescriptor raw_image_descriptor = 3; + } + + // The type of the packet. Its possible values is codec dependent. + // + // The fully qualified type name is always the concatenation of the + // value in `type_class` together with the value in `type`, separated by a + // '/'. + // + // Note that specific codecs can define their own type hierarchy, and so the + // type string here can in fact be separated by multiple '/'s of its own. + // + // Please see the open source SDK for specific codec documentation. + string type = 1; + } + + // The type class of the packet. Its possible values are: + // "gst", "protobuf", and "string". + string type_class = 1; + + // The type descriptor. + TypeDescriptor type_descriptor = 2; +} + +// The message that represents server metadata. +message ServerMetadata { + // The offset position for the packet in its stream. + int64 offset = 1; + + // The timestamp at which the stream server receives this packet. This is + // based on the local clock of on the server side. It is guaranteed to be + // monotonically increasing for the packets within each session; however + // this timestamp is not comparable across packets sent to the same stream + // different sessions. Session here refers to one individual gRPC streaming + // request to the stream server. + google.protobuf.Timestamp ingest_time = 2; +} + +// The message that represents series metadata. +message SeriesMetadata { + // Series name. It's in the format of + // "projects/{project}/locations/{location}/clusters/{cluster}/series/{stream}". + string series = 1 [(google.api.resource_reference) = { + type: "visionai.googleapis.com/Series" + }]; +} + +// The message that represents packet header. +message PacketHeader { + // Input only. The capture time of the packet. + google.protobuf.Timestamp capture_time = 1 [(google.api.field_behavior) = INPUT_ONLY]; + + // Input only. Immutable. The type of the payload. + PacketType type = 2 [ + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Input only. This field is for users to attach user managed metadata. + google.protobuf.Struct metadata = 3 [(google.api.field_behavior) = INPUT_ONLY]; + + // Output only. Metadata that the server appends to each packet before sending + // it to receivers. You don't need to set a value for this field when sending + // packets. + ServerMetadata server_metadata = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Input only. Immutable. Metadata that the server needs to know where to + // write the packets to. It's only required for the first packet. + SeriesMetadata series_metadata = 5 [ + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Immutable. Packet flag set. SDK will set the flag automatically. + int32 flags = 6 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. Header string for tracing across services. It should be set when the packet + // is first arrived in the stream server. + // + // The input format is a lowercase hex string: + // - version_id: 1 byte, currently must be zero - hex encoded (2 characters) + // - trace_id: 16 bytes (opaque blob) - hex encoded (32 characters) + // - span_id: 8 bytes (opaque blob) - hex encoded (16 characters) + // - trace_options: 1 byte (LSB means tracing enabled) - hex encoded (2 + // characters) + // Example: "00-404142434445464748494a4b4c4d4e4f-6162636465666768-01" + // v trace_id span_id options + string trace_context = 7 [(google.api.field_behavior) = IMMUTABLE]; +} + +// The quanta of datum that the series accepts. +message Packet { + // The packet header. + PacketHeader header = 1; + + // The payload of the packet. + bytes payload = 2; +} diff --git a/packages/google-cloud-visionai/protos/google/cloud/visionai/v1alpha1/streaming_service.proto b/packages/google-cloud-visionai/protos/google/cloud/visionai/v1alpha1/streaming_service.proto new file mode 100644 index 000000000000..63081f9dfa68 --- /dev/null +++ b/packages/google-cloud-visionai/protos/google/cloud/visionai/v1alpha1/streaming_service.proto @@ -0,0 +1,411 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.visionai.v1alpha1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/cloud/visionai/v1alpha1/streaming_resources.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.VisionAI.V1Alpha1"; +option go_package = "cloud.google.com/go/visionai/apiv1alpha1/visionaipb;visionaipb"; +option java_multiple_files = true; +option java_outer_classname = "StreamingServiceProto"; +option java_package = "com.google.cloud.visionai.v1alpha1"; +option php_namespace = "Google\\Cloud\\VisionAI\\V1alpha1"; +option ruby_package = "Google::Cloud::VisionAI::V1alpha1"; + +// Streaming service for receiving and sending packets. +service StreamingService { + option (google.api.default_host) = "visionai.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Send packets to the series. + rpc SendPackets(stream SendPacketsRequest) returns (stream SendPacketsResponse) { + } + + // Receive packets from the series. + rpc ReceivePackets(stream ReceivePacketsRequest) returns (stream ReceivePacketsResponse) { + } + + // Receive events given the stream name. + rpc ReceiveEvents(stream ReceiveEventsRequest) returns (stream ReceiveEventsResponse) { + } + + // AcquireLease acquires a lease. + rpc AcquireLease(AcquireLeaseRequest) returns (Lease) { + option (google.api.http) = { + post: "/v1alpha1/{series=projects/*/locations/*/clusters/*/series/*}:acquireLease" + body: "*" + }; + } + + // RenewLease renews a lease. + rpc RenewLease(RenewLeaseRequest) returns (Lease) { + option (google.api.http) = { + post: "/v1alpha1/{series=projects/*/locations/*/clusters/*/series/*}:renewLease" + body: "*" + }; + } + + // RleaseLease releases a lease. + rpc ReleaseLease(ReleaseLeaseRequest) returns (ReleaseLeaseResponse) { + option (google.api.http) = { + post: "/v1alpha1/{series=projects/*/locations/*/clusters/*/series/*}:releaseLease" + body: "*" + }; + } +} + +// The lease type. +enum LeaseType { + // Lease type unspecified. + LEASE_TYPE_UNSPECIFIED = 0; + + // Lease for stream reader. + LEASE_TYPE_READER = 1; + + // Lease for stream writer. + LEASE_TYPE_WRITER = 2; +} + +// Request message for ReceiveEvents. +message ReceiveEventsRequest { + // SetupRequest is the first message sent to the service to setup the RPC + // connection. + message SetupRequest { + // The cluster name. + string cluster = 1; + + // The stream name. The service will return the events for the given stream. + string stream = 2; + + // A name for the receiver to self-identify. + // + // This is used to keep track of a receiver's read progress. + string receiver = 3; + + // Controller mode configuration for receiving events from the server. + ControlledMode controlled_mode = 4; + + // The maximum duration of server silence before the client determines the + // server unreachable. + // + // The client must either receive an `Event` update or a heart beat message + // before this duration expires; otherwise, the client will automatically + // cancel the current connection and retry. + google.protobuf.Duration heartbeat_interval = 5; + + // The grace period after which a `writes_done_request` is issued, that a + // `WritesDone` is expected from the client. + // + // The server is free to cancel the RPC should this expire. + // + // A system default will be chosen if unset. + google.protobuf.Duration writes_done_grace_period = 6; + } + + oneof request { + // The setup request to setup the RPC connection. + SetupRequest setup_request = 1; + + // This request checkpoints the consumer's read progress. + CommitRequest commit_request = 2; + } +} + +// The event update message. +message EventUpdate { + // The name of the stream that the event is attached to. + string stream = 1; + + // The name of the event. + string event = 2; + + // The name of the series. + string series = 3; + + // The timestamp when the Event update happens. + google.protobuf.Timestamp update_time = 4; + + // The offset of the message that will be used to acknowledge of the message + // receiving. + int64 offset = 5; +} + +// Control message for a ReceiveEventsResponse. +message ReceiveEventsControlResponse { + // Possible control messages. + oneof control { + // A server heartbeat. + bool heartbeat = 1; + + // A request to the receiver to complete any final writes followed by a + // `WritesDone`; e.g. issue any final `CommitRequest`s. + // + // May be ignored if `WritesDone` has already been issued at any point + // prior to receiving this message. + // + // If `WritesDone` does not get issued, then the server will forcefully + // cancel the connection, and the receiver will likely receive an + // uninformative after `Read` returns `false` and `Finish` is called. + bool writes_done_request = 2; + } +} + +// Response message for the ReceiveEvents. +message ReceiveEventsResponse { + // Possible response types. + oneof response { + // The event update message. + EventUpdate event_update = 1; + + // A control message from the server. + ReceiveEventsControlResponse control = 2; + } +} + +// The lease message. +message Lease { + // The lease id. + string id = 1; + + // The series name. + string series = 2; + + // The owner name. + string owner = 3; + + // The lease expire time. + google.protobuf.Timestamp expire_time = 4; + + // The lease type. + LeaseType lease_type = 5; +} + +// Request message for acquiring a lease. +message AcquireLeaseRequest { + // The series name. + string series = 1; + + // The owner name. + string owner = 2; + + // The lease term. + google.protobuf.Duration term = 3; + + // The lease type. + LeaseType lease_type = 4; +} + +// Request message for renewing a lease. +message RenewLeaseRequest { + // Lease id. + string id = 1; + + // Series name. + string series = 2; + + // Lease owner. + string owner = 3; + + // Lease term. + google.protobuf.Duration term = 4; +} + +// Request message for releasing lease. +message ReleaseLeaseRequest { + // Lease id. + string id = 1; + + // Series name. + string series = 2; + + // Lease owner. + string owner = 3; +} + +// Response message for release lease. +message ReleaseLeaseResponse { + +} + +// RequestMetadata is the metadata message for the request. +message RequestMetadata { + // Stream name. + string stream = 1; + + // Evevt name. + string event = 2; + + // Series name. + string series = 3; + + // Lease id. + string lease_id = 4; + + // Owner name. + string owner = 5; + + // Lease term specifies how long the client wants the session to be maintained + // by the server after the client leaves. If the lease term is not set, the + // server will release the session immediately and the client cannot reconnect + // to the same session later. + google.protobuf.Duration lease_term = 6; +} + +// Request message for sending packets. +message SendPacketsRequest { + oneof request { + // Packets sent over the streaming rpc. + Packet packet = 1; + + // The first message of the streaming rpc including the request metadata. + RequestMetadata metadata = 2; + } +} + +// Response message for sending packets. +message SendPacketsResponse { + +} + +// Request message for receiving packets. +message ReceivePacketsRequest { + // The message specifying the initial settings for the ReceivePackets session. + message SetupRequest { + // The mode in which the consumer reads messages. + oneof consumer_mode { + // Options for configuring eager mode. + EagerMode eager_receive_mode = 3; + + // Options for configuring controlled mode. + ControlledMode controlled_receive_mode = 4; + } + + // The configurations that specify where packets are retrieved. + RequestMetadata metadata = 1; + + // A name for the receiver to self-identify. + // + // This is used to keep track of a receiver's read progress. + string receiver = 2; + + // The maximum duration of server silence before the client determines the + // server unreachable. + // + // The client must either receive a `Packet` or a heart beat message before + // this duration expires; otherwise, the client will automatically cancel + // the current connection and retry. + google.protobuf.Duration heartbeat_interval = 5; + + // The grace period after which a `writes_done_request` is issued, that a + // `WritesDone` is expected from the client. + // + // The server is free to cancel the RPC should this expire. + // + // A system default will be chosen if unset. + google.protobuf.Duration writes_done_grace_period = 6; + } + + // Possible request types from the client. + oneof request { + // The request to setup the initial state of session. + // + // The client must send and only send this as the first message. + SetupRequest setup_request = 6; + + // This request checkpoints the consumer's read progress. + CommitRequest commit_request = 7; + } +} + +// Control message for a ReceivePacketsResponse. +message ReceivePacketsControlResponse { + // Possible control messages. + oneof control { + // A server heartbeat. + bool heartbeat = 1; + + // A request to the receiver to complete any final writes followed by a + // `WritesDone`; e.g. issue any final `CommitRequest`s. + // + // May be ignored if `WritesDone` has already been issued at any point + // prior to receiving this message. + // + // If `WritesDone` does not get issued, then the server will forcefully + // cancel the connection, and the receiver will likely receive an + // uninformative after `Read` returns `false` and `Finish` is called. + bool writes_done_request = 2; + } +} + +// Response message from ReceivePackets. +message ReceivePacketsResponse { + // Possible response types. + oneof response { + // A genuine data payload originating from the sender. + Packet packet = 1; + + // A control message from the server. + ReceivePacketsControlResponse control = 3; + } +} + +// The options for receiver under the eager mode. +message EagerMode { + +} + +// The options for receiver under the controlled mode. +message ControlledMode { + // This is the offset from which to start receiveing. + oneof starting_offset { + // This can be set to the following logical starting points: + // + // "begin": This will read from the earliest available message. + // + // "most-recent": This will read from the latest available message. + // + // "end": This will read only future messages. + // + // "stored": This will resume reads one past the last committed offset. + // It is the only option that resumes progress; all others + // jump unilaterally. + string starting_logical_offset = 1; + } + + // This is the logical starting point to fallback upon should the + // specified starting offset be unavailable. + // + // This can be one of the following values: + // + // "begin": This will read from the earliest available message. + // + // "end": This will read only future messages. + string fallback_starting_offset = 2; +} + +// The message for explicitly committing the read progress. +// +// This may only be used when `ReceivePacketsControlledMode` is set in the +// initial setup request. +message CommitRequest { + // The offset to commit. + int64 offset = 1; +} diff --git a/packages/google-cloud-visionai/protos/google/cloud/visionai/v1alpha1/streams_resources.proto b/packages/google-cloud-visionai/protos/google/cloud/visionai/v1alpha1/streams_resources.proto new file mode 100644 index 000000000000..47c78a52f351 --- /dev/null +++ b/packages/google-cloud-visionai/protos/google/cloud/visionai/v1alpha1/streams_resources.proto @@ -0,0 +1,189 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.visionai.v1alpha1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.VisionAI.V1Alpha1"; +option go_package = "cloud.google.com/go/visionai/apiv1alpha1/visionaipb;visionaipb"; +option java_multiple_files = true; +option java_outer_classname = "StreamsResourcesProto"; +option java_package = "com.google.cloud.visionai.v1alpha1"; +option php_namespace = "Google\\Cloud\\VisionAI\\V1alpha1"; +option ruby_package = "Google::Cloud::VisionAI::V1alpha1"; + +// Message describing the Stream object. The Stream and the Event resources are +// many to many; i.e., each Stream resource can associate to many Event +// resources and each Event resource can associate to many Stream resources. +message Stream { + option (google.api.resource) = { + type: "visionai.googleapis.com/Stream" + pattern: "projects/{project}/locations/{location}/clusters/{cluster}/streams/{stream}" + }; + + // Name of the resource. + string name = 1; + + // Output only. The create timestamp. + google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The update timestamp. + google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Labels as key value pairs. + map labels = 4; + + // Annotations to allow clients to store small amounts of arbitrary data. + map annotations = 5; + + // The display name for the stream resource. + string display_name = 6; + + // Whether to enable the HLS playback service on this stream. + bool enable_hls_playback = 7; + + // The name of the media warehouse asset for long term storage of stream data. + // Format: projects/${p_id}/locations/${l_id}/corpora/${c_id}/assets/${a_id} + // Remain empty if the media warehouse storage is not needed for the stream. + string media_warehouse_asset = 8; +} + +// Message describing the Event object. +message Event { + option (google.api.resource) = { + type: "visionai.googleapis.com/Event" + pattern: "projects/{project}/locations/{location}/clusters/{cluster}/events/{event}" + }; + + // Clock that will be used for joining streams. + enum Clock { + // Clock is not specified. + CLOCK_UNSPECIFIED = 0; + + // Use the timestamp when the data is captured. Clients need to sync the + // clock. + CAPTURE = 1; + + // Use the timestamp when the data is received. + INGEST = 2; + } + + // Name of the resource. + string name = 1; + + // Output only. The create timestamp. + google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The update timestamp. + google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Labels as key value pairs. + map labels = 4; + + // Annotations to allow clients to store small amounts of arbitrary data. + map annotations = 5; + + // The clock used for joining streams. + Clock alignment_clock = 6; + + // Grace period for cleaning up the event. This is the time the controller + // waits for before deleting the event. During this period, if there is any + // active channel on the event. The deletion of the event after grace_period + // will be ignored. + google.protobuf.Duration grace_period = 7; +} + +// Message describing the Series object. +message Series { + option (google.api.resource) = { + type: "visionai.googleapis.com/Series" + pattern: "projects/{project}/locations/{location}/clusters/{cluster}/series/{series}" + }; + + // Name of the resource. + string name = 1; + + // Output only. The create timestamp. + google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The update timestamp. + google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Labels as key value pairs. + map labels = 4; + + // Annotations to allow clients to store small amounts of arbitrary data. + map annotations = 5; + + // Required. Stream that is associated with this series. + string stream = 6 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "visionai.googleapis.com/Stream" + } + ]; + + // Required. Event that is associated with this series. + string event = 7 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "visionai.googleapis.com/Event" + } + ]; +} + +// Message describing the Channel object. +message Channel { + option (google.api.resource) = { + type: "visionai.googleapis.com/Channel" + pattern: "projects/{project}/locations/{location}/clusters/{cluster}/channels/{channel}" + }; + + // Name of the resource. + string name = 1; + + // Output only. The create timestamp. + google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The update timestamp. + google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Labels as key value pairs. + map labels = 4; + + // Annotations to allow clients to store small amounts of arbitrary data. + map annotations = 5; + + // Required. Stream that is associated with this series. + string stream = 6 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "visionai.googleapis.com/Stream" + } + ]; + + // Required. Event that is associated with this series. + string event = 7 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "visionai.googleapis.com/Event" + } + ]; +} diff --git a/packages/google-cloud-visionai/protos/google/cloud/visionai/v1alpha1/streams_service.proto b/packages/google-cloud-visionai/protos/google/cloud/visionai/v1alpha1/streams_service.proto new file mode 100644 index 000000000000..195dc22c0424 --- /dev/null +++ b/packages/google-cloud-visionai/protos/google/cloud/visionai/v1alpha1/streams_service.proto @@ -0,0 +1,872 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.visionai.v1alpha1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/visionai/v1alpha1/common.proto"; +import "google/cloud/visionai/v1alpha1/streams_resources.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.VisionAI.V1Alpha1"; +option go_package = "cloud.google.com/go/visionai/apiv1alpha1/visionaipb;visionaipb"; +option java_multiple_files = true; +option java_outer_classname = "StreamsServiceProto"; +option java_package = "com.google.cloud.visionai.v1alpha1"; +option php_namespace = "Google\\Cloud\\VisionAI\\V1alpha1"; +option ruby_package = "Google::Cloud::VisionAI::V1alpha1"; + +// Service describing handlers for resources. +// Vision API and Vision AI API are two independent APIs developed by the same +// team. Vision API is for people to annotate their image while Vision AI is an +// e2e solution for customer to build their own computer vision application. +service StreamsService { + option (google.api.default_host) = "visionai.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Lists Clusters in a given project and location. + rpc ListClusters(ListClustersRequest) returns (ListClustersResponse) { + option (google.api.http) = { + get: "/v1alpha1/{parent=projects/*/locations/*}/clusters" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Cluster. + rpc GetCluster(GetClusterRequest) returns (Cluster) { + option (google.api.http) = { + get: "/v1alpha1/{name=projects/*/locations/*/clusters/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new Cluster in a given project and location. + rpc CreateCluster(CreateClusterRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha1/{parent=projects/*/locations/*}/clusters" + body: "cluster" + }; + option (google.api.method_signature) = "parent,cluster,cluster_id"; + option (google.longrunning.operation_info) = { + response_type: "Cluster" + metadata_type: "OperationMetadata" + }; + } + + // Updates the parameters of a single Cluster. + rpc UpdateCluster(UpdateClusterRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1alpha1/{cluster.name=projects/*/locations/*/clusters/*}" + body: "cluster" + }; + option (google.api.method_signature) = "cluster,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Cluster" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single Cluster. + rpc DeleteCluster(DeleteClusterRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1alpha1/{name=projects/*/locations/*/clusters/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Lists Streams in a given project and location. + rpc ListStreams(ListStreamsRequest) returns (ListStreamsResponse) { + option (google.api.http) = { + get: "/v1alpha1/{parent=projects/*/locations/*/clusters/*}/streams" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Stream. + rpc GetStream(GetStreamRequest) returns (Stream) { + option (google.api.http) = { + get: "/v1alpha1/{name=projects/*/locations/*/clusters/*/streams/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new Stream in a given project and location. + rpc CreateStream(CreateStreamRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha1/{parent=projects/*/locations/*/clusters/*}/streams" + body: "stream" + }; + option (google.api.method_signature) = "parent,stream,stream_id"; + option (google.longrunning.operation_info) = { + response_type: "Stream" + metadata_type: "OperationMetadata" + }; + } + + // Updates the parameters of a single Stream. + rpc UpdateStream(UpdateStreamRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1alpha1/{stream.name=projects/*/locations/*/clusters/*/streams/*}" + body: "stream" + }; + option (google.api.method_signature) = "stream,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Stream" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single Stream. + rpc DeleteStream(DeleteStreamRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1alpha1/{name=projects/*/locations/*/clusters/*/streams/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Generate the JWT auth token required to get the stream HLS contents. + rpc GenerateStreamHlsToken(GenerateStreamHlsTokenRequest) returns (GenerateStreamHlsTokenResponse) { + option (google.api.http) = { + post: "/v1alpha1/{stream=projects/*/locations/*/clusters/*/streams/*}:generateStreamHlsToken" + body: "*" + }; + option (google.api.method_signature) = "stream"; + } + + // Lists Events in a given project and location. + rpc ListEvents(ListEventsRequest) returns (ListEventsResponse) { + option (google.api.http) = { + get: "/v1alpha1/{parent=projects/*/locations/*/clusters/*}/events" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Event. + rpc GetEvent(GetEventRequest) returns (Event) { + option (google.api.http) = { + get: "/v1alpha1/{name=projects/*/locations/*/clusters/*/events/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new Event in a given project and location. + rpc CreateEvent(CreateEventRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha1/{parent=projects/*/locations/*/clusters/*}/events" + body: "event" + }; + option (google.api.method_signature) = "parent,event,event_id"; + option (google.longrunning.operation_info) = { + response_type: "Event" + metadata_type: "OperationMetadata" + }; + } + + // Updates the parameters of a single Event. + rpc UpdateEvent(UpdateEventRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1alpha1/{event.name=projects/*/locations/*/clusters/*/events/*}" + body: "event" + }; + option (google.api.method_signature) = "event,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Event" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single Event. + rpc DeleteEvent(DeleteEventRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1alpha1/{name=projects/*/locations/*/clusters/*/events/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Lists Series in a given project and location. + rpc ListSeries(ListSeriesRequest) returns (ListSeriesResponse) { + option (google.api.http) = { + get: "/v1alpha1/{parent=projects/*/locations/*/clusters/*}/series" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Series. + rpc GetSeries(GetSeriesRequest) returns (Series) { + option (google.api.http) = { + get: "/v1alpha1/{name=projects/*/locations/*/clusters/*/series/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new Series in a given project and location. + rpc CreateSeries(CreateSeriesRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha1/{parent=projects/*/locations/*/clusters/*}/series" + body: "series" + }; + option (google.api.method_signature) = "parent,series,series_id"; + option (google.longrunning.operation_info) = { + response_type: "Series" + metadata_type: "OperationMetadata" + }; + } + + // Updates the parameters of a single Event. + rpc UpdateSeries(UpdateSeriesRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1alpha1/{series.name=projects/*/locations/*/clusters/*/series/*}" + body: "series" + }; + option (google.api.method_signature) = "series,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Series" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single Series. + rpc DeleteSeries(DeleteSeriesRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1alpha1/{name=projects/*/locations/*/clusters/*/series/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Materialize a channel. + rpc MaterializeChannel(MaterializeChannelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha1/{parent=projects/*/locations/*/clusters/*}/channels" + body: "channel" + }; + option (google.api.method_signature) = "parent,channel,channel_id"; + option (google.longrunning.operation_info) = { + response_type: "Channel" + metadata_type: "OperationMetadata" + }; + } +} + +// Message for requesting list of Clusters. +message ListClustersRequest { + // Required. Parent value for ListClustersRequest. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Requested page size. Server may return fewer items than requested. + // If unspecified, server will pick an appropriate default. + int32 page_size = 2; + + // A token identifying a page of results the server should return. + string page_token = 3; + + // Filtering results. + string filter = 4; + + // Hint for how to order the results. + string order_by = 5; +} + +// Message for response to listing Clusters. +message ListClustersResponse { + // The list of Cluster. + repeated Cluster clusters = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Message for getting a Cluster. +message GetClusterRequest { + // Required. Name of the resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "visionai.googleapis.com/Cluster" + } + ]; +} + +// Message for creating a Cluster. +message CreateClusterRequest { + // Required. Value for parent. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "visionai.googleapis.com/Cluster" + } + ]; + + // Required. Id of the requesting object. + string cluster_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created. + Cluster cluster = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request ID, + // the server can check if original operation with the same request ID was + // received, and if so, will ignore the second request. This prevents clients + // from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for updating a Cluster. +message UpdateClusterRequest { + // Required. Field mask is used to specify the fields to be overwritten in the + // Cluster resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being updated + Cluster cluster = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request ID, + // the server can check if original operation with the same request ID was + // received, and if so, will ignore the second request. This prevents clients + // from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for deleting a Cluster. +message DeleteClusterRequest { + // Required. Name of the resource + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "visionai.googleapis.com/Cluster" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request ID, + // the server can check if original operation with the same request ID was + // received, and if so, will ignore the second request. This prevents clients + // from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for requesting list of Streams. +message ListStreamsRequest { + // Required. Parent value for ListStreamsRequest. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "visionai.googleapis.com/Cluster" + } + ]; + + // Requested page size. Server may return fewer items than requested. + // If unspecified, server will pick an appropriate default. + int32 page_size = 2; + + // A token identifying a page of results the server should return. + string page_token = 3; + + // Filtering results. + string filter = 4; + + // Hint for how to order the results. + string order_by = 5; +} + +// Message for response to listing Streams. +message ListStreamsResponse { + // The list of Stream. + repeated Stream streams = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Message for getting a Stream. +message GetStreamRequest { + // Required. Name of the resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "visionai.googleapis.com/Stream" + } + ]; +} + +// Message for creating a Stream. +message CreateStreamRequest { + // Required. Value for parent. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "visionai.googleapis.com/Cluster" + } + ]; + + // Required. Id of the requesting object. + string stream_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created. + Stream stream = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request ID, + // the server can check if original operation with the same request ID was + // received, and if so, will ignore the second request. This prevents clients + // from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for updating a Stream. +message UpdateStreamRequest { + // Required. Field mask is used to specify the fields to be overwritten in the + // Stream resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being updated. + Stream stream = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request ID, + // the server can check if original operation with the same request ID was + // received, and if so, will ignore the second request. This prevents clients + // from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for deleting a Stream. +message DeleteStreamRequest { + // Required. Name of the resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "visionai.googleapis.com/Stream" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request ID, + // the server can check if original operation with the same request ID was + // received, and if so, will ignore the second request. This prevents clients + // from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for the response of GetStreamThumbnail. The empty response message +// indicates the thumbnail image has been uploaded to GCS successfully. +message GetStreamThumbnailResponse { + +} + +// Request message for getting the auth token to access the stream HLS contents. +message GenerateStreamHlsTokenRequest { + // Required. The name of the stream. + string stream = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for GenerateStreamHlsToken. +message GenerateStreamHlsTokenResponse { + // The generated JWT token. + // + // The caller should insert this token to the authorization header of the HTTP + // requests to get the HLS playlist manifest and the video chunks. + // eg: curl -H "Authorization: Bearer $TOKEN" + // https://domain.com/test-stream.playback/master.m3u8 + string token = 1; + + // The expiration time of the token. + google.protobuf.Timestamp expiration_time = 2; +} + +// Message for requesting list of Events. +message ListEventsRequest { + // Required. Parent value for ListEventsRequest. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "visionai.googleapis.com/Cluster" + } + ]; + + // Requested page size. Server may return fewer items than requested. + // If unspecified, server will pick an appropriate default. + int32 page_size = 2; + + // A token identifying a page of results the server should return. + string page_token = 3; + + // Filtering results. + string filter = 4; + + // Hint for how to order the results. + string order_by = 5; +} + +// Message for response to listing Events. +message ListEventsResponse { + // The list of Event. + repeated Event events = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Message for getting a Event. +message GetEventRequest { + // Required. Name of the resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "visionai.googleapis.com/Event" + } + ]; +} + +// Message for creating a Event. +message CreateEventRequest { + // Required. Value for parent. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "visionai.googleapis.com/Cluster" + } + ]; + + // Required. Id of the requesting object. + string event_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created. + Event event = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request ID, + // the server can check if original operation with the same request ID was + // received, and if so, will ignore the second request. This prevents clients + // from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for updating a Event. +message UpdateEventRequest { + // Required. Field mask is used to specify the fields to be overwritten in the + // Event resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being updated. + Event event = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request ID, + // the server can check if original operation with the same request ID was + // received, and if so, will ignore the second request. This prevents clients + // from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for deleting a Event. +message DeleteEventRequest { + // Required. Name of the resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "visionai.googleapis.com/Event" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request ID, + // the server can check if original operation with the same request ID was + // received, and if so, will ignore the second request. This prevents clients + // from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for requesting list of Series. +message ListSeriesRequest { + // Required. Parent value for ListSeriesRequest. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "visionai.googleapis.com/Cluster" + } + ]; + + // Requested page size. Server may return fewer items than requested. + // If unspecified, server will pick an appropriate default. + int32 page_size = 2; + + // A token identifying a page of results the server should return. + string page_token = 3; + + // Filtering results. + string filter = 4; + + // Hint for how to order the results. + string order_by = 5; +} + +// Message for response to listing Series. +message ListSeriesResponse { + // The list of Series. + repeated Series series = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Message for getting a Series. +message GetSeriesRequest { + // Required. Name of the resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "visionai.googleapis.com/Series" + } + ]; +} + +// Message for creating a Series. +message CreateSeriesRequest { + // Required. Value for parent. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "visionai.googleapis.com/Cluster" + } + ]; + + // Required. Id of the requesting object. + string series_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created. + Series series = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request ID, + // the server can check if original operation with the same request ID was + // received, and if so, will ignore the second request. This prevents clients + // from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for updating a Series. +message UpdateSeriesRequest { + // Required. Field mask is used to specify the fields to be overwritten in the Series + // resource by the update. The fields specified in the update_mask are + // relative to the resource, not the full request. A field will be overwritten + // if it is in the mask. If the user does not provide a mask then all fields + // will be overwritten. + google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being updated + Series series = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request ID, + // the server can check if original operation with the same request ID was + // received, and if so, will ignore the second request. This prevents clients + // from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for deleting a Series. +message DeleteSeriesRequest { + // Required. Name of the resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "visionai.googleapis.com/Series" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request ID, + // the server can check if original operation with the same request ID was + // received, and if so, will ignore the second request. This prevents clients + // from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for materializing a channel. +message MaterializeChannelRequest { + // Required. Value for parent. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "visionai.googleapis.com/Cluster" + } + ]; + + // Required. Id of the channel. + string channel_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created. + Channel channel = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request ID, + // the server can check if original operation with the same request ID was + // received, and if so, will ignore the second request. This prevents clients + // from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/packages/google-cloud-visionai/protos/google/cloud/visionai/v1alpha1/warehouse.proto b/packages/google-cloud-visionai/protos/google/cloud/visionai/v1alpha1/warehouse.proto new file mode 100644 index 000000000000..3cf36b93f7cc --- /dev/null +++ b/packages/google-cloud-visionai/protos/google/cloud/visionai/v1alpha1/warehouse.proto @@ -0,0 +1,1653 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.visionai.v1alpha1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; +import "google/type/datetime.proto"; + +option csharp_namespace = "Google.Cloud.VisionAI.V1Alpha1"; +option go_package = "cloud.google.com/go/visionai/apiv1alpha1/visionaipb;visionaipb"; +option java_multiple_files = true; +option java_outer_classname = "WarehouseProto"; +option java_package = "com.google.cloud.visionai.v1alpha1"; +option php_namespace = "Google\\Cloud\\VisionAI\\V1alpha1"; +option ruby_package = "Google::Cloud::VisionAI::V1alpha1"; + +// Service that manages media content + metadata for streaming. +service Warehouse { + option (google.api.default_host) = "visionai.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Creates an asset inside corpus. + rpc CreateAsset(CreateAssetRequest) returns (Asset) { + option (google.api.http) = { + post: "/v1alpha1/{parent=projects/*/locations/*/corpora/*}/assets" + body: "asset" + }; + option (google.api.method_signature) = "parent,asset,asset_id"; + } + + // Updates an asset inside corpus. + rpc UpdateAsset(UpdateAssetRequest) returns (Asset) { + option (google.api.http) = { + patch: "/v1alpha1/{asset.name=projects/*/locations/*/corpora/*/assets/*}" + body: "asset" + }; + option (google.api.method_signature) = "asset,update_mask"; + } + + // Reads an asset inside corpus. + rpc GetAsset(GetAssetRequest) returns (Asset) { + option (google.api.http) = { + get: "/v1alpha1/{name=projects/*/locations/*/corpora/*/assets/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists an list of assets inside corpus. + rpc ListAssets(ListAssetsRequest) returns (ListAssetsResponse) { + option (google.api.http) = { + get: "/v1alpha1/{parent=projects/*/locations/*/corpora/*}/assets" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes asset inside corpus. + rpc DeleteAsset(DeleteAssetRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1alpha1/{name=projects/*/locations/*/corpora/*/assets/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteAssetMetadata" + }; + } + + // Creates a corpus inside a project. + rpc CreateCorpus(CreateCorpusRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha1/{parent=projects/*/locations/*}/corpora" + body: "corpus" + }; + option (google.api.method_signature) = "parent,corpus"; + option (google.longrunning.operation_info) = { + response_type: "Corpus" + metadata_type: "CreateCorpusMetadata" + }; + } + + // Gets corpus details inside a project. + rpc GetCorpus(GetCorpusRequest) returns (Corpus) { + option (google.api.http) = { + get: "/v1alpha1/{name=projects/*/locations/*/corpora/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a corpus in a project. + rpc UpdateCorpus(UpdateCorpusRequest) returns (Corpus) { + option (google.api.http) = { + patch: "/v1alpha1/{corpus.name=projects/*/locations/*/corpora/*}" + body: "corpus" + }; + option (google.api.method_signature) = "corpus,update_mask"; + } + + // Lists all corpora in a project. + rpc ListCorpora(ListCorporaRequest) returns (ListCorporaResponse) { + option (google.api.http) = { + get: "/v1alpha1/{parent=projects/*/locations/*}/corpora" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a corpus only if its empty. + // Returns empty response. + rpc DeleteCorpus(DeleteCorpusRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1alpha1/{name=projects/*/locations/*/corpora/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates data schema inside corpus. + rpc CreateDataSchema(CreateDataSchemaRequest) returns (DataSchema) { + option (google.api.http) = { + post: "/v1alpha1/{parent=projects/*/locations/*/corpora/*}/dataSchemas" + body: "data_schema" + }; + option (google.api.method_signature) = "parent,data_schema"; + } + + // Updates data schema inside corpus. + rpc UpdateDataSchema(UpdateDataSchemaRequest) returns (DataSchema) { + option (google.api.http) = { + patch: "/v1alpha1/{data_schema.name=projects/*/locations/*/corpora/*/dataSchemas/*}" + body: "data_schema" + }; + option (google.api.method_signature) = "data_schema,update_mask"; + } + + // Gets data schema inside corpus. + rpc GetDataSchema(GetDataSchemaRequest) returns (DataSchema) { + option (google.api.http) = { + get: "/v1alpha1/{name=projects/*/locations/*/corpora/*/dataSchemas/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Deletes data schema inside corpus. + rpc DeleteDataSchema(DeleteDataSchemaRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1alpha1/{name=projects/*/locations/*/corpora/*/dataSchemas/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists a list of data schemas inside corpus. + rpc ListDataSchemas(ListDataSchemasRequest) returns (ListDataSchemasResponse) { + option (google.api.http) = { + get: "/v1alpha1/{parent=projects/*/locations/*/corpora/*}/dataSchemas" + }; + option (google.api.method_signature) = "parent"; + } + + // Creates annotation inside asset. + rpc CreateAnnotation(CreateAnnotationRequest) returns (Annotation) { + option (google.api.http) = { + post: "/v1alpha1/{parent=projects/*/locations/*/corpora/*/assets/*}/annotations" + body: "annotation" + }; + option (google.api.method_signature) = "parent,annotation,annotation_id"; + } + + // Reads annotation inside asset. + rpc GetAnnotation(GetAnnotationRequest) returns (Annotation) { + option (google.api.http) = { + get: "/v1alpha1/{name=projects/*/locations/*/corpora/*/assets/*/annotations/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists a list of annotations inside asset. + rpc ListAnnotations(ListAnnotationsRequest) returns (ListAnnotationsResponse) { + option (google.api.http) = { + get: "/v1alpha1/{parent=projects/*/locations/*/corpora/*/assets/*}/annotations" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates annotation inside asset. + rpc UpdateAnnotation(UpdateAnnotationRequest) returns (Annotation) { + option (google.api.http) = { + patch: "/v1alpha1/{annotation.name=projects/*/locations/*/corpora/*/assets/*/annotations/*}" + body: "annotation" + }; + option (google.api.method_signature) = "annotation,update_mask"; + } + + // Deletes annotation inside asset. + rpc DeleteAnnotation(DeleteAnnotationRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1alpha1/{name=projects/*/locations/*/corpora/*/assets/*/annotations/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Ingests data for the asset. It is not allowed to ingest a data chunk which + // is already expired according to TTL. + // This method is only available via the gRPC API (not HTTP since + // bi-directional streaming is not supported via HTTP). + rpc IngestAsset(stream IngestAssetRequest) returns (stream IngestAssetResponse) { + } + + // Generates clips for downloading. The api takes in a time range, and + // generates a clip of the first content available after start_time and + // before end_time, which may overflow beyond these bounds. + // Returned clips are truncated if the total size of the clips are larger + // than 100MB. + rpc ClipAsset(ClipAssetRequest) returns (ClipAssetResponse) { + option (google.api.http) = { + post: "/v1alpha1/{name=projects/*/locations/*/corpora/*/assets/*}:clip" + body: "*" + }; + } + + // Generates a uri for an HLS manifest. The api takes in a collection of time + // ranges, and generates a URI for an HLS manifest that covers all the + // requested time ranges. + rpc GenerateHlsUri(GenerateHlsUriRequest) returns (GenerateHlsUriResponse) { + option (google.api.http) = { + post: "/v1alpha1/{name=projects/*/locations/*/corpora/*/assets/*}:generateHlsUri" + body: "*" + }; + } + + // Creates a search configuration inside a corpus. + // + // Please follow the rules below to create a valid CreateSearchConfigRequest. + // --- General Rules --- + // 1. Request.search_config_id must not be associated with an existing + // SearchConfig. + // 2. Request must contain at least one non-empty search_criteria_property or + // facet_property. + // 3. mapped_fields must not be empty, and must map to existing UGA keys. + // 4. All mapped_fields must be of the same type. + // 5. All mapped_fields must share the same granularity. + // 6. All mapped_fields must share the same semantic SearchConfig match + // options. + // For property-specific rules, please reference the comments for + // FacetProperty and SearchCriteriaProperty. + rpc CreateSearchConfig(CreateSearchConfigRequest) returns (SearchConfig) { + option (google.api.http) = { + post: "/v1alpha1/{parent=projects/*/locations/*/corpora/*}/searchConfigs" + body: "search_config" + }; + option (google.api.method_signature) = "parent,search_config,search_config_id"; + } + + // Updates a search configuration inside a corpus. + // + // Please follow the rules below to create a valid UpdateSearchConfigRequest. + // --- General Rules --- + // 1. Request.search_configuration.name must already exist. + // 2. Request must contain at least one non-empty search_criteria_property or + // facet_property. + // 3. mapped_fields must not be empty, and must map to existing UGA keys. + // 4. All mapped_fields must be of the same type. + // 5. All mapped_fields must share the same granularity. + // 6. All mapped_fields must share the same semantic SearchConfig match + // options. + // For property-specific rules, please reference the comments for + // FacetProperty and SearchCriteriaProperty. + rpc UpdateSearchConfig(UpdateSearchConfigRequest) returns (SearchConfig) { + option (google.api.http) = { + patch: "/v1alpha1/{search_config.name=projects/*/locations/*/corpora/*/searchConfigs/*}" + body: "search_config" + }; + option (google.api.method_signature) = "search_config,update_mask"; + } + + // Gets a search configuration inside a corpus. + rpc GetSearchConfig(GetSearchConfigRequest) returns (SearchConfig) { + option (google.api.http) = { + get: "/v1alpha1/{name=projects/*/locations/*/corpora/*/searchConfigs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Deletes a search configuration inside a corpus. + // + // For a DeleteSearchConfigRequest to be valid, + // Request.search_configuration.name must already exist. + rpc DeleteSearchConfig(DeleteSearchConfigRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1alpha1/{name=projects/*/locations/*/corpora/*/searchConfigs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists all search configurations inside a corpus. + rpc ListSearchConfigs(ListSearchConfigsRequest) returns (ListSearchConfigsResponse) { + option (google.api.http) = { + get: "/v1alpha1/{parent=projects/*/locations/*/corpora/*}/searchConfigs" + }; + option (google.api.method_signature) = "parent"; + } + + // Search media asset. + rpc SearchAssets(SearchAssetsRequest) returns (SearchAssetsResponse) { + option (google.api.http) = { + post: "/v1alpha1/{corpus=projects/*/locations/*/corpora/*}:searchAssets" + body: "*" + }; + } +} + +// Different types for a facet bucket. +enum FacetBucketType { + // Unspecified type. + FACET_BUCKET_TYPE_UNSPECIFIED = 0; + + // Value type. + FACET_BUCKET_TYPE_VALUE = 1; + + // Datetime type. + FACET_BUCKET_TYPE_DATETIME = 2; + + // Fixed Range type. + FACET_BUCKET_TYPE_FIXED_RANGE = 3; + + // Custom Range type. + FACET_BUCKET_TYPE_CUSTOM_RANGE = 4; +} + +// Request message for CreateAssetRequest. +message CreateAssetRequest { + // Required. The parent resource where this asset will be created. + // Format: projects/*/locations/*/corpora/* + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "visionai.googleapis.com/Corpus" + } + ]; + + // Required. The asset to create. + Asset asset = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The ID to use for the asset, which will become the final component of + // the asset's resource name if user choose to specify. Otherwise, asset id + // will be generated by system. + // + // This value should be up to 63 characters, and valid characters + // are /[a-z][0-9]-/. The first character must be a letter, the last could be + // a letter or a number. + optional string asset_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for GetAsset. +message GetAssetRequest { + // Required. The name of the asset to retrieve. + // Format: + // projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "visionai.googleapis.com/Asset" + } + ]; +} + +// Request message for ListAssets. +message ListAssetsRequest { + // Required. The parent, which owns this collection of assets. + // Format: + // projects/{project_number}/locations/{location}/corpora/{corpus} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "visionai.googleapis.com/Asset" + } + ]; + + // The maximum number of assets to return. The service may return fewer than + // this value. + // If unspecified, at most 50 assets will be returned. + // The maximum value is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 2; + + // A page token, received from a previous `ListAssets` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListAssets` must match + // the call that provided the page token. + string page_token = 3; +} + +// Response message for ListAssets. +message ListAssetsResponse { + // The assets from the specified corpus. + repeated Asset assets = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Response message for UpdateAsset. +message UpdateAssetRequest { + // Required. The asset to update. + // + // The asset's `name` field is used to identify the asset to be updated. + // Format: + // projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset} + Asset asset = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for DeleteAsset. +message DeleteAssetRequest { + // Required. The name of the asset to delete. + // Format: + // projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "visionai.googleapis.com/Asset" + } + ]; +} + +// An asset is a resource in corpus. It represents a media object inside corpus, +// contains metadata and another resource annotation. Different feature could be +// applied to the asset to generate annotations. User could specified annotation +// related to the target asset. +message Asset { + option (google.api.resource) = { + type: "visionai.googleapis.com/Asset" + pattern: "projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}" + }; + + // Resource name of the asset. + // Form: + // `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` + string name = 1; + + // The duration for which all media assets, associated metadata, and search + // documents can exist. If not set, then it will using the default ttl in the + // parent corpus resource. + google.protobuf.Duration ttl = 2; +} + +// Request message of CreateCorpus API. +message CreateCorpusRequest { + // Required. Form: `projects/{project_number}/locations/{location_id}` + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The corpus to be created. + Corpus corpus = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Metadata for CreateCorpus API. +message CreateCorpusMetadata { + +} + +// Corpus is a set of video contents for management. Within a corpus, videos +// share the same data schema. Search is also restricted within a single corpus. +message Corpus { + option (google.api.resource) = { + type: "visionai.googleapis.com/Corpus" + pattern: "projects/{project_number}/locations/{location}/corpora/{corpus}" + }; + + // Resource name of the corpus. + // Form: + // `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}` + string name = 1; + + // Required. The corpus name to shown in the UI. The name can be up to 32 characters + // long. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Description of the corpus. Can be up to 25000 characters long. + string description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The default TTL value for all assets under the corpus without a asset level + // user-defined TTL with a maximum of 10 years. This is required for all + // corpora. + google.protobuf.Duration default_ttl = 5 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for GetCorpus. +message GetCorpusRequest { + // Required. The resource name of the corpus to retrieve. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "visionai.googleapis.com/Corpus" + } + ]; +} + +// Request message for UpdateCorpus. +message UpdateCorpusRequest { + // Required. The corpus which replaces the resource on the server. + Corpus corpus = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for ListCorpora. +message ListCorporaRequest { + // Required. The resource name of the project from which to list corpora. + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Requested page size. API may return fewer results than requested. + // If negative, INVALID_ARGUMENT error will be returned. + // If unspecified or 0, API will pick a default size, which is 10. + // If the requested page size is larger than the maximum size, API will pick + // use the maximum size, which is 20. + int32 page_size = 2; + + // A token identifying a page of results for the server to return. + // Typically obtained via [ListCorpora.next_page_token][] of the previous + // [Warehouse.ListCorpora][google.cloud.visionai.v1alpha1.Warehouse.ListCorpora] call. + string page_token = 3; +} + +// Response message for ListCorpora. +message ListCorporaResponse { + // The corpora in the project. + repeated Corpus corpora = 1; + + // A token to retrieve next page of results. + // Pass to [ListCorporaRequest.page_token][google.cloud.visionai.v1alpha1.ListCorporaRequest.page_token] to obtain that page. + string next_page_token = 2; +} + +// Request message for DeleteCorpus. +message DeleteCorpusRequest { + // Required. The resource name of the corpus to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "visionai.googleapis.com/Corpus" + } + ]; +} + +// Request message for CreateDataSchema. +message CreateDataSchemaRequest { + // Required. The parent resource where this data schema will be created. + // Format: projects/*/locations/*/corpora/* + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "visionai.googleapis.com/Corpus" + } + ]; + + // Required. The data schema to create. + DataSchema data_schema = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Data schema indicates how the user specified annotation is interpreted in the +// system. +message DataSchema { + option (google.api.resource) = { + type: "visionai.googleapis.com/DataSchema" + pattern: "projects/{project_number}/locations/{location}/corpora/{corpus}/dataSchemas/{data_schema}" + }; + + // Resource name of the data schema in the form of: + // `projects/{project_number}/locations/{location}/corpora/{corpus}/dataSchemas/{data_schema}` + // where {data_schema} part should be the same as the `key` field below. + string name = 1; + + // Required. The key of this data schema. This key should be matching the key of user + // specified annotation and unique inside corpus. This value can be up to + // 63 characters, and valid characters are /[a-z][0-9]-/. The first character + // must be a letter, the last could be a letter or a number. + string key = 2 [(google.api.field_behavior) = REQUIRED]; + + // The schema details mapping to the key. + DataSchemaDetails schema_details = 3; +} + +// Data schema details indicates the data type and the data struct corresponding +// to the key of user specified annotation. +message DataSchemaDetails { + // The configuration for `PROTO_ANY` data type. + message ProtoAnyConfig { + // The type URI of the proto message. + string type_uri = 1; + } + + // The search strategy for annotations value of the `key`. + message SearchStrategy { + // The types of search strategies to be applied on the annotation key. + enum SearchStrategyType { + // Annotatation values of the `key` above will not be searchable. + NO_SEARCH = 0; + + // When searching with `key`, the value must be exactly as the annotation + // value that has been ingested. + EXACT_SEARCH = 1; + + // When searching with `key`, Warehouse will perform broad search based on + // semantic of the annotation value. + SMART_SEARCH = 2; + } + + // The type of search strategy to be applied on the `key` above. + // The allowed `search_strategy_type` is different for different data types, + // which is documented in the DataSchemaDetails.DataType. Specifying + // unsupported `search_strategy_type` for data types will result in + // INVALID_ARGUMENT error. + SearchStrategyType search_strategy_type = 1; + } + + // Data type of the annotation. + enum DataType { + // Unspecified type. + DATA_TYPE_UNSPECIFIED = 0; + + // Integer type. + // Allowed search strategies: + // - DataSchema.SearchStrategy.NO_SEARCH, + // - DataSchema.SearchStrategy.EXACT_SEARCH. + // Supports query by IntRangeArray. + INTEGER = 1; + + // Float type. + // Allowed search strategies: + // - DataSchema.SearchStrategy.NO_SEARCH, + // - DataSchema.SearchStrategy.EXACT_SEARCH. + // Supports query by FloatRangeArray. + FLOAT = 2; + + // String type. + // Allowed search strategies: + // - DataSchema.SearchStrategy.NO_SEARCH, + // - DataSchema.SearchStrategy.EXACT_SEARCH, + // - DataSchema.SearchStrategy.SMART_SEARCH. + STRING = 3; + + // Supported formats: + // %Y-%m-%dT%H:%M:%E*S%E*z (absl::RFC3339_full) + // %Y-%m-%dT%H:%M:%E*S + // %Y-%m-%dT%H:%M%E*z + // %Y-%m-%dT%H:%M + // %Y-%m-%dT%H%E*z + // %Y-%m-%dT%H + // %Y-%m-%d%E*z + // %Y-%m-%d + // %Y-%m + // %Y + // Allowed search strategies: + // - DataSchema.SearchStrategy.NO_SEARCH, + // - DataSchema.SearchStrategy.EXACT_SEARCH. + // Supports query by DateTimeRangeArray. + DATETIME = 5; + + // Geo coordinate type. + // Allowed search strategies: + // - DataSchema.SearchStrategy.NO_SEARCH, + // - DataSchema.SearchStrategy.EXACT_SEARCH. + // Supports query by GeoLocationArray. + GEO_COORDINATE = 7; + + // Type to pass any proto as available in annotations.proto. Only use + // internally. + // Available proto types and its corresponding search behavior: + // - ImageObjectDetectionPredictionResult, allows SMART_SEARCH on + // display_names and NO_SEARCH. + // - ClassificationPredictionResult, allows SMART_SEARCH on display_names + // and NO_SEARCH. + // - ImageSegmentationPredictionResult, allows NO_SEARCH. + // - VideoActionRecognitionPredictionResult, allows SMART_SEARCH on + // display_name and NO_SEARCH. + // - VideoObjectTrackingPredictionResult, allows SMART_SEARCH on + // display_name and NO_SEARCH. + // - VideoClassificationPredictionResult, allows SMART_SEARCH on + // display_name and NO_SEARCH. + // - OccupancyCountingPredictionResult, allows EXACT_SEARCH on + // stats.full_frame_count.count and NO_SEARCH. + // - ObjectDetectionPredictionResult, allows SMART_SEARCH on + // identified_boxes.entity.label_string and NO_SEARCH. + PROTO_ANY = 8; + + // Boolean type. + // Allowed search strategies: + // - DataSchema.SearchStrategy.NO_SEARCH, + // - DataSchema.SearchStrategy.EXACT_SEARCH. + BOOLEAN = 9; + } + + // The granularity of annotations under this DataSchema. + enum Granularity { + // Unspecified granularity. + GRANULARITY_UNSPECIFIED = 0; + + // Asset-level granularity (annotations must not contain partition info). + GRANULARITY_ASSET_LEVEL = 1; + + // Partition-level granularity (annotations must contain partition info). + GRANULARITY_PARTITION_LEVEL = 2; + } + + // Type of the annotation. + DataType type = 1; + + // Config for protobuf any type. + ProtoAnyConfig proto_any_config = 6; + + // The granularity associated with this DataSchema. + Granularity granularity = 5; + + // The search strategy to be applied on the `key` above. + SearchStrategy search_strategy = 7; +} + +// Request message for UpdateDataSchema. +message UpdateDataSchemaRequest { + // Required. The data schema's `name` field is used to identify the data schema to be + // updated. Format: + // projects/{project_number}/locations/{location}/corpora/{corpus}/dataSchemas/{data_schema} + DataSchema data_schema = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for GetDataSchema. +message GetDataSchemaRequest { + // Required. The name of the data schema to retrieve. + // Format: + // projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/dataSchemas/{data_schema_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "visionai.googleapis.com/DataSchema" + } + ]; +} + +// Request message for DeleteDataSchema. +message DeleteDataSchemaRequest { + // Required. The name of the data schema to delete. + // Format: + // projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/dataSchemas/{data_schema_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "visionai.googleapis.com/DataSchema" + } + ]; +} + +// Request message for ListDataSchemas. +message ListDataSchemasRequest { + // Required. The parent, which owns this collection of data schemas. + // Format: + // projects/{project_number}/locations/{location_id}/corpora/{corpus_id} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "visionai.googleapis.com/DataSchema" + } + ]; + + // The maximum number of data schemas to return. The service may return fewer + // than this value. If unspecified, at most 50 data schemas will be returned. + // The maximum value is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 2; + + // A page token, received from a previous `ListDataSchemas` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListDataSchemas` must + // match the call that provided the page token. + string page_token = 3; +} + +// Response message for ListDataSchemas. +message ListDataSchemasResponse { + // The data schemas from the specified corpus. + repeated DataSchema data_schemas = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for CreateAnnotation. +message CreateAnnotationRequest { + // Required. The parent resource where this annotation will be created. + // Format: projects/*/locations/*/corpora/*/assets/* + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "visionai.googleapis.com/Asset" + } + ]; + + // Required. The annotation to create. + Annotation annotation = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The ID to use for the annotation, which will become the final component of + // the annotation's resource name if user choose to specify. Otherwise, + // annotation id will be generated by system. + // + // This value should be up to 63 characters, and valid characters + // are /[a-z][0-9]-/. The first character must be a letter, the last could be + // a letter or a number. + optional string annotation_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// An annotation is a resource in asset. It represents a key-value mapping of +// content in asset. +message Annotation { + option (google.api.resource) = { + type: "visionai.googleapis.com/Annotation" + pattern: "projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation}" + }; + + // Resource name of the annotation. + // Form: + // `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation}` + string name = 1; + + // User provided annotation. + UserSpecifiedAnnotation user_specified_annotation = 2; +} + +// Annotation provided by users. +message UserSpecifiedAnnotation { + // Required. Key of the annotation. The key must be set with type by CreateDataSchema. + string key = 1 [(google.api.field_behavior) = REQUIRED]; + + // Value of the annotation. The value must be able to convert + // to the type according to the data schema. + AnnotationValue value = 2; + + // Partition information in time and space for the sub-asset level annotation. + Partition partition = 3; +} + +// Location Coordinate Representation +message GeoCoordinate { + // Latitude Coordinate. Degrees [-90 .. 90] + double latitude = 1; + + // Longitude Coordinate. Degrees [-180 .. 180] + double longitude = 2; +} + +// Value of annotation, including all types available in data schema. +message AnnotationValue { + oneof value { + // Value of int type annotation. + int64 int_value = 1; + + // Value of float type annotation. + float float_value = 2; + + // Value of string type annotation. + string str_value = 3; + + // Value of date time type annotation. + string datetime_value = 5; + + // Value of geo coordinate type annotation. + GeoCoordinate geo_coordinate = 7; + + // Value of any proto value. + google.protobuf.Any proto_any_value = 8; + + // Value of boolean type annotation. + bool bool_value = 9; + + // Value of customized struct annotation. + google.protobuf.Struct customized_struct_data_value = 10; + } +} + +// Request message for GetAnnotation API. +message ListAnnotationsRequest { + // The parent, which owns this collection of annotations. + // Format: + // projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset} + string parent = 1 [(google.api.resource_reference) = { + type: "visionai.googleapis.com/Asset" + }]; + + // The maximum number of annotations to return. The service may return fewer + // than this value. If unspecified, at most 50 annotations will be returned. + // The maximum value is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 2; + + // A page token, received from a previous `ListAnnotations` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListAnnotations` must + // match the call that provided the page token. + string page_token = 3; + + // The filter applied to the returned list. + // We only support filtering for the following fields: + // `partition.temporal_partition.start_time`, + // `partition.temporal_partition.end_time`, and `key`. + // Timestamps are specified in the RFC-3339 format, and only one restriction + // may be applied per field, joined by conjunctions. + // Format: + // "partition.temporal_partition.start_time > "2012-04-21T11:30:00-04:00" AND + // partition.temporal_partition.end_time < "2012-04-22T11:30:00-04:00" AND + // key = "example_key"" + string filter = 4; +} + +// Request message for ListAnnotations API. +message ListAnnotationsResponse { + // The annotations from the specified asset. + repeated Annotation annotations = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for GetAnnotation API. +message GetAnnotationRequest { + // Required. The name of the annotation to retrieve. + // Format: + // projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "visionai.googleapis.com/Annotation" + } + ]; +} + +// Request message for UpdateAnnotation API. +message UpdateAnnotationRequest { + // Required. The annotation to update. + // The annotation's `name` field is used to identify the annotation to be + // updated. Format: + // projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation} + Annotation annotation = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for DeleteAnnotation API. +message DeleteAnnotationRequest { + // Required. The name of the annotation to delete. + // Format: + // projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "visionai.googleapis.com/Annotation" + } + ]; +} + +// Request message for CreateSearchConfig. +message CreateSearchConfigRequest { + // Required. The parent resource where this search configuration will be created. + // Format: projects/*/locations/*/corpora/* + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "visionai.googleapis.com/SearchConfig" + } + ]; + + // Required. The search config to create. + SearchConfig search_config = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. ID to use for the new search config. Will become the final component of the + // SearchConfig's resource name. This value should be up to 63 characters, and + // valid characters are /[a-z][0-9]-_/. The first character must be a letter, + // the last could be a letter or a number. + string search_config_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for UpdateSearchConfig. +message UpdateSearchConfigRequest { + // Required. The search configuration to update. + // + // The search configuration's `name` field is used to identify the resource to + // be updated. Format: + // projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config} + SearchConfig search_config = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to be updated. If left unset, all field paths will be + // updated/overwritten. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for GetSearchConfig. +message GetSearchConfigRequest { + // Required. The name of the search configuration to retrieve. + // Format: + // projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "visionai.googleapis.com/SearchConfig" + } + ]; +} + +// Request message for DeleteSearchConfig. +message DeleteSearchConfigRequest { + // Required. The name of the search configuration to delete. + // Format: + // projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "visionai.googleapis.com/SearchConfig" + } + ]; +} + +// Request message for ListSearchConfigs. +message ListSearchConfigsRequest { + // Required. The parent, which owns this collection of search configurations. + // Format: + // projects/{project_number}/locations/{location}/corpora/{corpus} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "visionai.googleapis.com/SearchConfig" + } + ]; + + // The maximum number of search configurations to return. The service may + // return fewer than this value. If unspecified, a page size of 50 will be + // used. The maximum value is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 2; + + // A page token, received from a previous `ListSearchConfigs` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // `ListSearchConfigs` must match the call that provided the page + // token. + string page_token = 3; +} + +// Response message for ListSearchConfigs. +message ListSearchConfigsResponse { + // The search configurations from the specified corpus. + repeated SearchConfig search_configs = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// SearchConfig stores different properties that will affect search +// behaviors and search results. +message SearchConfig { + option (google.api.resource) = { + type: "visionai.googleapis.com/SearchConfig" + pattern: "projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config}" + }; + + // Resource name of the search configuration. + // For CustomSearchCriteria, search_config would be the search + // operator name. For Facets, search_config would be the facet + // dimension name. + // Form: + // `projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config}` + string name = 1; + + // Establishes a FacetDimension and associated specifications. + FacetProperty facet_property = 2; + + // Creates a mapping between a custom SearchCriteria and one or more UGA keys. + SearchCriteriaProperty search_criteria_property = 3; +} + +// Central configuration for a facet. +message FacetProperty { + // If bucket type is FIXED_RANGE, specify how values are bucketized. Use + // FixedRangeBucketSpec when you want to create multiple buckets with equal + // granularities. Using integer bucket value as an example, when + // bucket_start = 0, bucket_granularity = 10, bucket_count = 5, this facet + // will be aggregated via the following buckets: + // [-inf, 0), [0, 10), [10, 20), [20, 30), [30, inf). + // Notably, bucket_count <= 1 is an invalid spec. + message FixedRangeBucketSpec { + // Lower bound of the bucket. NOTE: Only integer type is currently supported + // for this field. + FacetValue bucket_start = 1; + + // Bucket granularity. NOTE: Only integer type is currently supported for + // this field. + FacetValue bucket_granularity = 2; + + // Total number of buckets. + int32 bucket_count = 3; + } + + // If bucket type is CUSTOM_RANGE, specify how values are bucketized. Use + // integer bucket value as an example, when the endpoints are 0, 10, 100, and + // 1000, we will generate the following facets: + // [-inf, 0), [0, 10), [10, 100), [100, 1000), [1000, inf). + // Notably: + // - endpoints must be listed in ascending order. Otherwise, the SearchConfig + // API will reject the facet config. + // - < 1 endpoints is an invalid spec. + message CustomRangeBucketSpec { + // Currently, only integer type is supported for this field. + repeated FacetValue endpoints = 1; + } + + // If bucket type is DATE, specify how date values are bucketized. + message DateTimeBucketSpec { + // Granularity enum for the datetime bucket. + enum Granularity { + // Unspecified granularity. + GRANULARITY_UNSPECIFIED = 0; + + // Granularity is year. + YEAR = 1; + + // Granularity is month. + MONTH = 2; + + // Granularity is day. + DAY = 3; + } + + // Granularity of date type facet. + Granularity granularity = 1; + } + + oneof range_facet_config { + // Fixed range facet bucket config. + FixedRangeBucketSpec fixed_range_bucket_spec = 5; + + // Custom range facet bucket config. + CustomRangeBucketSpec custom_range_bucket_spec = 6; + + // Datetime range facet bucket config. + DateTimeBucketSpec datetime_bucket_spec = 7; + } + + // Name of the facets, which are the dimensions users want to use to refine + // search results. `mapped_fields` will match UserSpecifiedDataSchema keys. + // + // For example, user can add a bunch of UGAs with the same key, such as + // player:adam, player:bob, player:charles. When multiple mapped_fields are + // specified, will merge their value together as final facet value. E.g. + // home_team: a, home_team:b, away_team:a, away_team:c, when facet_field = + // [home_team, away_team], facet_value will be [a, b, c]. + // + // UNLESS this is a 1:1 facet dimension (mapped_fields.size() == 1) AND the + // mapped_field equals the parent SearchConfig.name, the parent must + // also contain a SearchCriteriaProperty that maps to the same fields. + // mapped_fields must not be empty. + repeated string mapped_fields = 1; + + // Display name of the facet. To be used by UI for facet rendering. + string display_name = 2; + + // Maximum number of unique bucket to return for one facet. Bucket number can + // be large for high-cardinality facet such as "player". We only return top-n + // most related ones to user. If it's <= 0, the server will decide the + // appropriate result_size. + int64 result_size = 3; + + // Facet bucket type e.g. value, range. + FacetBucketType bucket_type = 4; +} + +// Central configuration for custom search criteria. +message SearchCriteriaProperty { + // Each mapped_field corresponds to a UGA key. To understand how this property + // works, take the following example. In the SearchConfig table, the + // user adds this entry: + // search_config { + // name: "person" + // search_criteria_property { + // mapped_fields: "player" + // mapped_fields: "coach" + // } + // } + // + // Now, when a user issues a query like: + // criteria { + // field: "person" + // text_array { + // txt_values: "Tom Brady" + // txt_values: "Bill Belichick" + // } + // } + // + // MWH search will return search documents where (player=Tom Brady || + // coach=Tom Brady || player=Bill Belichick || coach=Bill Belichick). + repeated string mapped_fields = 1; +} + +// Definition of a single value with generic type. +message FacetValue { + oneof value { + // String type value. + string string_value = 1; + + // Integer type value. + int64 integer_value = 2; + + // Datetime type value. + google.type.DateTime datetime_value = 3; + } +} + +// Holds the facet value, selections state, and metadata. +message FacetBucket { + // The range of values [start, end) for which faceting is applied. + message Range { + // Start of the range. Non-existence indicates some bound (e.g. -inf). + FacetValue start = 1; + + // End of the range. Non-existence indicates some bound (e.g. inf). + FacetValue end = 2; + } + + // Bucket associated with a facet. For example, bucket of facet “team” + // can be "49ers", "patriots", etc; bucket of facet "player" can be "tom + // brady", "drew brees", etc. + oneof bucket_value { + // Singular value. + FacetValue value = 2; + + // Range value. + Range range = 4; + } + + // Whether one facet bucket is selected. This field represents user's facet + // selection. It is set by frontend in SearchVideosRequest. + bool selected = 3; +} + +// A group of facet buckets to be passed back and forth between backend & +// frontend. +message FacetGroup { + // Unique id of the facet group. + string facet_id = 1; + + // Display name of the facet. To be used by UI for facet rendering. + string display_name = 2; + + // Buckets associated with the facet. E.g. for "Team" facet, the bucket + // can be 49ers, patriots, etc. + repeated FacetBucket buckets = 3; + + // Facet bucket type. + FacetBucketType bucket_type = 4; + + // If true, return query matched annotations for this facet group's selection. + // This option is only applicable for facets based on partition level + // annotations. It supports the following facet values: + // - INTEGER + // - STRING (DataSchema.SearchStrategy.EXACT_SEARCH only) + bool fetch_matched_annotations = 5; +} + +// Request message for IngestAsset API. +message IngestAssetRequest { + // Configuration for the data. + message Config { + // Type information for video data. + message VideoType { + // Container format of the video. + enum ContainerFormat { + // The default type, not supposed to be used. + CONTAINER_FORMAT_UNSPECIFIED = 0; + + // Mp4 container format. + CONTAINER_FORMAT_MP4 = 1; + } + + // Container format of the video data. + ContainerFormat container_format = 1; + } + + oneof data_type { + // Type information for video data. + VideoType video_type = 2; + } + + // Required. The resource name of the asset that the ingested data belongs to. + string asset = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "visionai.googleapis.com/Asset" + } + ]; + } + + // Contains the data and the corresponding time range this data is for. + message TimeIndexedData { + // Data to be ingested. + bytes data = 1; + + // Time range of the data. + Partition.TemporalPartition temporal_partition = 2; + } + + oneof streaming_request { + // Provides information for the data and the asset resource name that the + // data belongs to. The first `IngestAssetRequest` message must only contain + // a `Config` message. + Config config = 1; + + // Data to be ingested. + TimeIndexedData time_indexed_data = 2; + } +} + +// Response message for IngestAsset API. +message IngestAssetResponse { + // Time range of the data that has been successfully ingested. + Partition.TemporalPartition successfully_ingested_partition = 1; +} + +// Request message for ClipAsset API. +message ClipAssetRequest { + // Required. The resource name of the asset to request clips for. + // Form: + // 'projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}' + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "visionai.googleapis.com/Asset" + } + ]; + + // Required. The time range to request clips for. + Partition.TemporalPartition temporal_partition = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for ClipAsset API. +message ClipAssetResponse { + // Signed uri with corresponding time range. + message TimeIndexedUri { + // Time range of the video that the uri is for. + Partition.TemporalPartition temporal_partition = 1; + + // Signed uri to download the video clip. + string uri = 2; + } + + // A list of signed uris to download the video clips that cover the requested + // time range ordered by time. + repeated TimeIndexedUri time_indexed_uris = 1; +} + +// Request message for GenerateHlsUri API. +message GenerateHlsUriRequest { + // Required. The resource name of the asset to request clips for. + // Form: + // 'projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}' + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "visionai.googleapis.com/Asset" + } + ]; + + // Required. The time range to request clips for. + repeated Partition.TemporalPartition temporal_partitions = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for GenerateHlsUri API. +message GenerateHlsUriResponse { + // A signed uri to download the HLS manifest corresponding to the requested + // times. + string uri = 1; + + // A list of temporal partitions of the content returned in the order they + // appear in the stream. + repeated Partition.TemporalPartition temporal_partitions = 2; +} + +// Request message for SearchAssets. +message SearchAssetsRequest { + // Required. The parent corpus to search. + // Form: `projects/{project_id}/locations/{location_id}/corpora/{corpus_id}' + string corpus = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "visionai.googleapis.com/Corpus" + } + ]; + + // The number of results to be returned in this page. If it's 0, the server + // will decide the appropriate page_size. + int32 page_size = 2; + + // The continuation token to fetch the next page. If empty, it means it is + // fetching the first page. + string page_token = 3; + + // Time ranges that matching video content must fall within. If no ranges are + // provided, there will be no time restriction. This field is treated just + // like the criteria below, but defined separately for convenience as it is + // used frequently. Note that if the end_time is in the future, it will be + // clamped to the time the request was received. + DateTimeRangeArray content_time_ranges = 5; + + // Criteria applied to search results. + repeated Criteria criteria = 4; + + // Stores most recent facet selection state. Only facet groups with user's + // selection will be presented here. Selection state is either selected or + // unselected. Only selected facet buckets will be used as search criteria. + repeated FacetGroup facet_selections = 6; + + // A list of annotation keys to specify the annotations to be retrieved and + // returned with each search result. + // Annotation granularity must be GRANULARITY_ASSET_LEVEL and its search + // strategy must not be NO_SEARCH. + repeated string result_annotation_keys = 8; +} + +// The metadata for DeleteAsset API that embeds in +// [metadata][google.longrunning.Operation.metadata] field. +message DeleteAssetMetadata { + +} + +// Stores the criteria-annotation matching results for each search result item. +message AnnotationMatchingResult { + // The criteria used for matching. It can be an input search criteria or a + // criteria converted from a facet selection. + Criteria criteria = 1; + + // Matched annotations for the criteria. + repeated Annotation matched_annotations = 2; + + // Status of the match result. Possible values: + // FAILED_PRECONDITION - the criteria is not eligible for match. + // OK - matching is performed. + google.rpc.Status status = 3; +} + +// Search result contains asset name and corresponding time ranges. +message SearchResultItem { + // The resource name of the asset. + // Form: + // 'projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}' + string asset = 1; + + // The matched asset segments. + // Deprecated: please use singular `segment` field. + repeated Partition.TemporalPartition segments = 2 [deprecated = true]; + + // The matched asset segment. + Partition.TemporalPartition segment = 5; + + // Search result annotations specified by result_annotation_keys in search + // request. + repeated Annotation requested_annotations = 3; + + // Criteria or facet-selection based annotation matching results associated to + // this search result item. Only contains results for criteria or + // facet_selections with fetch_matched_annotations=true. + repeated AnnotationMatchingResult annotation_matching_results = 4; +} + +// Response message for SearchAssets. +message SearchAssetsResponse { + // Returned search results. + repeated SearchResultItem search_result_items = 1; + + // The next-page continuation token. + string next_page_token = 2; + + // Facet search results of a given query, which contains user's + // already-selected facet values and updated facet search results. + repeated FacetGroup facet_results = 3; +} + +// Integer range type. +message IntRange { + // Start of the int range. + optional int64 start = 1; + + // End of the int range. + optional int64 end = 2; +} + +// Float range type. +message FloatRange { + // Start of the float range. + optional float start = 1; + + // End of the float range. + optional float end = 2; +} + +// A list of string-type values. +message StringArray { + // String type values. + repeated string txt_values = 1; +} + +// A list of integer range values. +message IntRangeArray { + // Int range values. + repeated IntRange int_ranges = 1; +} + +// A list of float range values. +message FloatRangeArray { + // Float range values. + repeated FloatRange float_ranges = 1; +} + +// Datetime range type. +message DateTimeRange { + // Start date time. + google.type.DateTime start = 1; + + // End data time. + google.type.DateTime end = 2; +} + +// A list of datetime range values. +message DateTimeRangeArray { + // Date time ranges. + repeated DateTimeRange date_time_ranges = 1; +} + +// Representation of a circle area. +message CircleArea { + // Latitude of circle area's center. Degrees [-90 .. 90] + double latitude = 1; + + // Longitude of circle area's center. Degrees [-180 .. 180] + double longitude = 2; + + // Radius of the circle area in meters. + double radius_meter = 3; +} + +// A list of locations. +message GeoLocationArray { + // A list of circle areas. + repeated CircleArea circle_areas = 1; +} + +message BoolValue { + bool value = 1; +} + +// Filter criteria applied to current search results. +message Criteria { + oneof value { + // The text values associated with the field. + StringArray text_array = 2; + + // The integer ranges associated with the field. + IntRangeArray int_range_array = 3; + + // The float ranges associated with the field. + FloatRangeArray float_range_array = 4; + + // The datetime ranges associated with the field. + DateTimeRangeArray date_time_range_array = 5; + + // Geo Location array. + GeoLocationArray geo_location_array = 6; + + // A Boolean value. + BoolValue bool_value = 7; + } + + // The UGA field or ML field to apply filtering criteria. + string field = 1; + + // If true, return query matched annotations for this criteria. + // This option is only applicable for partition level annotations and supports + // the following data types: + // - INTEGER + // - FLOAT + // - STRING (DataSchema.SearchStrategy.EXACT_SEARCH only) + // - BOOLEAN + bool fetch_matched_annotations = 8; +} + +// Partition to specify the partition in time and space for sub-asset level +// annotation. +message Partition { + // Partition of asset in UTC Epoch time. + message TemporalPartition { + // Start time of the partition. + google.protobuf.Timestamp start_time = 1; + + // End time of the partition. + google.protobuf.Timestamp end_time = 2; + } + + // Partition of asset in space. + message SpatialPartition { + // The minimum x coordinate value. + optional int64 x_min = 1; + + // The minimum y coordinate value. + optional int64 y_min = 2; + + // The maximum x coordinate value. + optional int64 x_max = 3; + + // The maximum y coordinate value. + optional int64 y_max = 4; + } + + // Partition of asset in time. + TemporalPartition temporal_partition = 1; + + // Partition of asset in space. + SpatialPartition spatial_partition = 2; +} diff --git a/packages/google-cloud-visionai/protos/protos.d.ts b/packages/google-cloud-visionai/protos/protos.d.ts index 821b6b8a177c..0f675017215a 100644 --- a/packages/google-cloud-visionai/protos/protos.d.ts +++ b/packages/google-cloud-visionai/protos/protos.d.ts @@ -53214,6 +53214,32789 @@ export namespace google { } } } + + /** Namespace v1alpha1. */ + namespace v1alpha1 { + + /** StreamAnnotationType enum. */ + enum StreamAnnotationType { + STREAM_ANNOTATION_TYPE_UNSPECIFIED = 0, + STREAM_ANNOTATION_TYPE_ACTIVE_ZONE = 1, + STREAM_ANNOTATION_TYPE_CROSSING_LINE = 2 + } + + /** Properties of a PersonalProtectiveEquipmentDetectionOutput. */ + interface IPersonalProtectiveEquipmentDetectionOutput { + + /** PersonalProtectiveEquipmentDetectionOutput currentTime */ + currentTime?: (google.protobuf.ITimestamp|null); + + /** PersonalProtectiveEquipmentDetectionOutput detectedPersons */ + detectedPersons?: (google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.IDetectedPerson[]|null); + } + + /** Represents a PersonalProtectiveEquipmentDetectionOutput. */ + class PersonalProtectiveEquipmentDetectionOutput implements IPersonalProtectiveEquipmentDetectionOutput { + + /** + * Constructs a new PersonalProtectiveEquipmentDetectionOutput. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IPersonalProtectiveEquipmentDetectionOutput); + + /** PersonalProtectiveEquipmentDetectionOutput currentTime. */ + public currentTime?: (google.protobuf.ITimestamp|null); + + /** PersonalProtectiveEquipmentDetectionOutput detectedPersons. */ + public detectedPersons: google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.IDetectedPerson[]; + + /** + * Creates a new PersonalProtectiveEquipmentDetectionOutput instance using the specified properties. + * @param [properties] Properties to set + * @returns PersonalProtectiveEquipmentDetectionOutput instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IPersonalProtectiveEquipmentDetectionOutput): google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput; + + /** + * Encodes the specified PersonalProtectiveEquipmentDetectionOutput message. Does not implicitly {@link google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.verify|verify} messages. + * @param message PersonalProtectiveEquipmentDetectionOutput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IPersonalProtectiveEquipmentDetectionOutput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PersonalProtectiveEquipmentDetectionOutput message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.verify|verify} messages. + * @param message PersonalProtectiveEquipmentDetectionOutput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IPersonalProtectiveEquipmentDetectionOutput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PersonalProtectiveEquipmentDetectionOutput message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PersonalProtectiveEquipmentDetectionOutput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput; + + /** + * Decodes a PersonalProtectiveEquipmentDetectionOutput message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PersonalProtectiveEquipmentDetectionOutput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput; + + /** + * Verifies a PersonalProtectiveEquipmentDetectionOutput message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PersonalProtectiveEquipmentDetectionOutput message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PersonalProtectiveEquipmentDetectionOutput + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput; + + /** + * Creates a plain object from a PersonalProtectiveEquipmentDetectionOutput message. Also converts values to other types if specified. + * @param message PersonalProtectiveEquipmentDetectionOutput + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PersonalProtectiveEquipmentDetectionOutput to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PersonalProtectiveEquipmentDetectionOutput + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PersonalProtectiveEquipmentDetectionOutput { + + /** Properties of a PersonEntity. */ + interface IPersonEntity { + + /** PersonEntity personEntityId */ + personEntityId?: (number|Long|string|null); + } + + /** Represents a PersonEntity. */ + class PersonEntity implements IPersonEntity { + + /** + * Constructs a new PersonEntity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.IPersonEntity); + + /** PersonEntity personEntityId. */ + public personEntityId: (number|Long|string); + + /** + * Creates a new PersonEntity instance using the specified properties. + * @param [properties] Properties to set + * @returns PersonEntity instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.IPersonEntity): google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonEntity; + + /** + * Encodes the specified PersonEntity message. Does not implicitly {@link google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonEntity.verify|verify} messages. + * @param message PersonEntity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.IPersonEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PersonEntity message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonEntity.verify|verify} messages. + * @param message PersonEntity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.IPersonEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PersonEntity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PersonEntity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonEntity; + + /** + * Decodes a PersonEntity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PersonEntity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonEntity; + + /** + * Verifies a PersonEntity message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PersonEntity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PersonEntity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonEntity; + + /** + * Creates a plain object from a PersonEntity message. Also converts values to other types if specified. + * @param message PersonEntity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonEntity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PersonEntity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PersonEntity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PPEEntity. */ + interface IPPEEntity { + + /** PPEEntity ppeLabelId */ + ppeLabelId?: (number|Long|string|null); + + /** PPEEntity ppeLabelString */ + ppeLabelString?: (string|null); + + /** PPEEntity ppeSupercategoryLabelString */ + ppeSupercategoryLabelString?: (string|null); + + /** PPEEntity ppeEntityId */ + ppeEntityId?: (number|Long|string|null); + } + + /** Represents a PPEEntity. */ + class PPEEntity implements IPPEEntity { + + /** + * Constructs a new PPEEntity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.IPPEEntity); + + /** PPEEntity ppeLabelId. */ + public ppeLabelId: (number|Long|string); + + /** PPEEntity ppeLabelString. */ + public ppeLabelString: string; + + /** PPEEntity ppeSupercategoryLabelString. */ + public ppeSupercategoryLabelString: string; + + /** PPEEntity ppeEntityId. */ + public ppeEntityId: (number|Long|string); + + /** + * Creates a new PPEEntity instance using the specified properties. + * @param [properties] Properties to set + * @returns PPEEntity instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.IPPEEntity): google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEEntity; + + /** + * Encodes the specified PPEEntity message. Does not implicitly {@link google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEEntity.verify|verify} messages. + * @param message PPEEntity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.IPPEEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PPEEntity message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEEntity.verify|verify} messages. + * @param message PPEEntity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.IPPEEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PPEEntity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PPEEntity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEEntity; + + /** + * Decodes a PPEEntity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PPEEntity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEEntity; + + /** + * Verifies a PPEEntity message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PPEEntity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PPEEntity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEEntity; + + /** + * Creates a plain object from a PPEEntity message. Also converts values to other types if specified. + * @param message PPEEntity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEEntity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PPEEntity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PPEEntity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NormalizedBoundingBox. */ + interface INormalizedBoundingBox { + + /** NormalizedBoundingBox xmin */ + xmin?: (number|null); + + /** NormalizedBoundingBox ymin */ + ymin?: (number|null); + + /** NormalizedBoundingBox width */ + width?: (number|null); + + /** NormalizedBoundingBox height */ + height?: (number|null); + } + + /** Represents a NormalizedBoundingBox. */ + class NormalizedBoundingBox implements INormalizedBoundingBox { + + /** + * Constructs a new NormalizedBoundingBox. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.INormalizedBoundingBox); + + /** NormalizedBoundingBox xmin. */ + public xmin: number; + + /** NormalizedBoundingBox ymin. */ + public ymin: number; + + /** NormalizedBoundingBox width. */ + public width: number; + + /** NormalizedBoundingBox height. */ + public height: number; + + /** + * Creates a new NormalizedBoundingBox instance using the specified properties. + * @param [properties] Properties to set + * @returns NormalizedBoundingBox instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.INormalizedBoundingBox): google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.NormalizedBoundingBox; + + /** + * Encodes the specified NormalizedBoundingBox message. Does not implicitly {@link google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.NormalizedBoundingBox.verify|verify} messages. + * @param message NormalizedBoundingBox message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.INormalizedBoundingBox, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NormalizedBoundingBox message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.NormalizedBoundingBox.verify|verify} messages. + * @param message NormalizedBoundingBox message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.INormalizedBoundingBox, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NormalizedBoundingBox message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NormalizedBoundingBox + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.NormalizedBoundingBox; + + /** + * Decodes a NormalizedBoundingBox message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NormalizedBoundingBox + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.NormalizedBoundingBox; + + /** + * Verifies a NormalizedBoundingBox message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NormalizedBoundingBox message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NormalizedBoundingBox + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.NormalizedBoundingBox; + + /** + * Creates a plain object from a NormalizedBoundingBox message. Also converts values to other types if specified. + * @param message NormalizedBoundingBox + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.NormalizedBoundingBox, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NormalizedBoundingBox to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NormalizedBoundingBox + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PersonIdentifiedBox. */ + interface IPersonIdentifiedBox { + + /** PersonIdentifiedBox boxId */ + boxId?: (number|Long|string|null); + + /** PersonIdentifiedBox normalizedBoundingBox */ + normalizedBoundingBox?: (google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.INormalizedBoundingBox|null); + + /** PersonIdentifiedBox confidenceScore */ + confidenceScore?: (number|null); + + /** PersonIdentifiedBox personEntity */ + personEntity?: (google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.IPersonEntity|null); + } + + /** Represents a PersonIdentifiedBox. */ + class PersonIdentifiedBox implements IPersonIdentifiedBox { + + /** + * Constructs a new PersonIdentifiedBox. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.IPersonIdentifiedBox); + + /** PersonIdentifiedBox boxId. */ + public boxId: (number|Long|string); + + /** PersonIdentifiedBox normalizedBoundingBox. */ + public normalizedBoundingBox?: (google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.INormalizedBoundingBox|null); + + /** PersonIdentifiedBox confidenceScore. */ + public confidenceScore: number; + + /** PersonIdentifiedBox personEntity. */ + public personEntity?: (google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.IPersonEntity|null); + + /** + * Creates a new PersonIdentifiedBox instance using the specified properties. + * @param [properties] Properties to set + * @returns PersonIdentifiedBox instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.IPersonIdentifiedBox): google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonIdentifiedBox; + + /** + * Encodes the specified PersonIdentifiedBox message. Does not implicitly {@link google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonIdentifiedBox.verify|verify} messages. + * @param message PersonIdentifiedBox message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.IPersonIdentifiedBox, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PersonIdentifiedBox message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonIdentifiedBox.verify|verify} messages. + * @param message PersonIdentifiedBox message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.IPersonIdentifiedBox, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PersonIdentifiedBox message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PersonIdentifiedBox + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonIdentifiedBox; + + /** + * Decodes a PersonIdentifiedBox message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PersonIdentifiedBox + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonIdentifiedBox; + + /** + * Verifies a PersonIdentifiedBox message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PersonIdentifiedBox message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PersonIdentifiedBox + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonIdentifiedBox; + + /** + * Creates a plain object from a PersonIdentifiedBox message. Also converts values to other types if specified. + * @param message PersonIdentifiedBox + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonIdentifiedBox, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PersonIdentifiedBox to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PersonIdentifiedBox + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PPEIdentifiedBox. */ + interface IPPEIdentifiedBox { + + /** PPEIdentifiedBox boxId */ + boxId?: (number|Long|string|null); + + /** PPEIdentifiedBox normalizedBoundingBox */ + normalizedBoundingBox?: (google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.INormalizedBoundingBox|null); + + /** PPEIdentifiedBox confidenceScore */ + confidenceScore?: (number|null); + + /** PPEIdentifiedBox ppeEntity */ + ppeEntity?: (google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.IPPEEntity|null); + } + + /** Represents a PPEIdentifiedBox. */ + class PPEIdentifiedBox implements IPPEIdentifiedBox { + + /** + * Constructs a new PPEIdentifiedBox. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.IPPEIdentifiedBox); + + /** PPEIdentifiedBox boxId. */ + public boxId: (number|Long|string); + + /** PPEIdentifiedBox normalizedBoundingBox. */ + public normalizedBoundingBox?: (google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.INormalizedBoundingBox|null); + + /** PPEIdentifiedBox confidenceScore. */ + public confidenceScore: number; + + /** PPEIdentifiedBox ppeEntity. */ + public ppeEntity?: (google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.IPPEEntity|null); + + /** + * Creates a new PPEIdentifiedBox instance using the specified properties. + * @param [properties] Properties to set + * @returns PPEIdentifiedBox instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.IPPEIdentifiedBox): google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEIdentifiedBox; + + /** + * Encodes the specified PPEIdentifiedBox message. Does not implicitly {@link google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEIdentifiedBox.verify|verify} messages. + * @param message PPEIdentifiedBox message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.IPPEIdentifiedBox, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PPEIdentifiedBox message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEIdentifiedBox.verify|verify} messages. + * @param message PPEIdentifiedBox message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.IPPEIdentifiedBox, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PPEIdentifiedBox message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PPEIdentifiedBox + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEIdentifiedBox; + + /** + * Decodes a PPEIdentifiedBox message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PPEIdentifiedBox + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEIdentifiedBox; + + /** + * Verifies a PPEIdentifiedBox message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PPEIdentifiedBox message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PPEIdentifiedBox + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEIdentifiedBox; + + /** + * Creates a plain object from a PPEIdentifiedBox message. Also converts values to other types if specified. + * @param message PPEIdentifiedBox + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEIdentifiedBox, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PPEIdentifiedBox to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PPEIdentifiedBox + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DetectedPerson. */ + interface IDetectedPerson { + + /** DetectedPerson personId */ + personId?: (number|Long|string|null); + + /** DetectedPerson detectedPersonIdentifiedBox */ + detectedPersonIdentifiedBox?: (google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.IPersonIdentifiedBox|null); + + /** DetectedPerson detectedPpeIdentifiedBoxes */ + detectedPpeIdentifiedBoxes?: (google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.IPPEIdentifiedBox[]|null); + + /** DetectedPerson faceCoverageScore */ + faceCoverageScore?: (number|null); + + /** DetectedPerson eyesCoverageScore */ + eyesCoverageScore?: (number|null); + + /** DetectedPerson headCoverageScore */ + headCoverageScore?: (number|null); + + /** DetectedPerson handsCoverageScore */ + handsCoverageScore?: (number|null); + + /** DetectedPerson bodyCoverageScore */ + bodyCoverageScore?: (number|null); + + /** DetectedPerson feetCoverageScore */ + feetCoverageScore?: (number|null); + } + + /** Represents a DetectedPerson. */ + class DetectedPerson implements IDetectedPerson { + + /** + * Constructs a new DetectedPerson. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.IDetectedPerson); + + /** DetectedPerson personId. */ + public personId: (number|Long|string); + + /** DetectedPerson detectedPersonIdentifiedBox. */ + public detectedPersonIdentifiedBox?: (google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.IPersonIdentifiedBox|null); + + /** DetectedPerson detectedPpeIdentifiedBoxes. */ + public detectedPpeIdentifiedBoxes: google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.IPPEIdentifiedBox[]; + + /** DetectedPerson faceCoverageScore. */ + public faceCoverageScore?: (number|null); + + /** DetectedPerson eyesCoverageScore. */ + public eyesCoverageScore?: (number|null); + + /** DetectedPerson headCoverageScore. */ + public headCoverageScore?: (number|null); + + /** DetectedPerson handsCoverageScore. */ + public handsCoverageScore?: (number|null); + + /** DetectedPerson bodyCoverageScore. */ + public bodyCoverageScore?: (number|null); + + /** DetectedPerson feetCoverageScore. */ + public feetCoverageScore?: (number|null); + + /** + * Creates a new DetectedPerson instance using the specified properties. + * @param [properties] Properties to set + * @returns DetectedPerson instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.IDetectedPerson): google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.DetectedPerson; + + /** + * Encodes the specified DetectedPerson message. Does not implicitly {@link google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.DetectedPerson.verify|verify} messages. + * @param message DetectedPerson message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.IDetectedPerson, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DetectedPerson message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.DetectedPerson.verify|verify} messages. + * @param message DetectedPerson message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.IDetectedPerson, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DetectedPerson message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DetectedPerson + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.DetectedPerson; + + /** + * Decodes a DetectedPerson message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DetectedPerson + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.DetectedPerson; + + /** + * Verifies a DetectedPerson message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DetectedPerson message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DetectedPerson + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.DetectedPerson; + + /** + * Creates a plain object from a DetectedPerson message. Also converts values to other types if specified. + * @param message DetectedPerson + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.DetectedPerson, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DetectedPerson to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DetectedPerson + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ObjectDetectionPredictionResult. */ + interface IObjectDetectionPredictionResult { + + /** ObjectDetectionPredictionResult currentTime */ + currentTime?: (google.protobuf.ITimestamp|null); + + /** ObjectDetectionPredictionResult identifiedBoxes */ + identifiedBoxes?: (google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IIdentifiedBox[]|null); + } + + /** Represents an ObjectDetectionPredictionResult. */ + class ObjectDetectionPredictionResult implements IObjectDetectionPredictionResult { + + /** + * Constructs a new ObjectDetectionPredictionResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IObjectDetectionPredictionResult); + + /** ObjectDetectionPredictionResult currentTime. */ + public currentTime?: (google.protobuf.ITimestamp|null); + + /** ObjectDetectionPredictionResult identifiedBoxes. */ + public identifiedBoxes: google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IIdentifiedBox[]; + + /** + * Creates a new ObjectDetectionPredictionResult instance using the specified properties. + * @param [properties] Properties to set + * @returns ObjectDetectionPredictionResult instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IObjectDetectionPredictionResult): google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult; + + /** + * Encodes the specified ObjectDetectionPredictionResult message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.verify|verify} messages. + * @param message ObjectDetectionPredictionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IObjectDetectionPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ObjectDetectionPredictionResult message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.verify|verify} messages. + * @param message ObjectDetectionPredictionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IObjectDetectionPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ObjectDetectionPredictionResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ObjectDetectionPredictionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult; + + /** + * Decodes an ObjectDetectionPredictionResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ObjectDetectionPredictionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult; + + /** + * Verifies an ObjectDetectionPredictionResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ObjectDetectionPredictionResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ObjectDetectionPredictionResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult; + + /** + * Creates a plain object from an ObjectDetectionPredictionResult message. Also converts values to other types if specified. + * @param message ObjectDetectionPredictionResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ObjectDetectionPredictionResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ObjectDetectionPredictionResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ObjectDetectionPredictionResult { + + /** Properties of an Entity. */ + interface IEntity { + + /** Entity labelId */ + labelId?: (number|Long|string|null); + + /** Entity labelString */ + labelString?: (string|null); + } + + /** Represents an Entity. */ + class Entity implements IEntity { + + /** + * Constructs a new Entity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IEntity); + + /** Entity labelId. */ + public labelId: (number|Long|string); + + /** Entity labelString. */ + public labelString: string; + + /** + * Creates a new Entity instance using the specified properties. + * @param [properties] Properties to set + * @returns Entity instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IEntity): google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.Entity; + + /** + * Encodes the specified Entity message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.Entity.verify|verify} messages. + * @param message Entity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Entity message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.Entity.verify|verify} messages. + * @param message Entity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Entity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Entity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.Entity; + + /** + * Decodes an Entity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Entity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.Entity; + + /** + * Verifies an Entity message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Entity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Entity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.Entity; + + /** + * Creates a plain object from an Entity message. Also converts values to other types if specified. + * @param message Entity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.Entity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Entity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Entity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IdentifiedBox. */ + interface IIdentifiedBox { + + /** IdentifiedBox boxId */ + boxId?: (number|Long|string|null); + + /** IdentifiedBox normalizedBoundingBox */ + normalizedBoundingBox?: (google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.INormalizedBoundingBox|null); + + /** IdentifiedBox confidenceScore */ + confidenceScore?: (number|null); + + /** IdentifiedBox entity */ + entity?: (google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IEntity|null); + } + + /** Represents an IdentifiedBox. */ + class IdentifiedBox implements IIdentifiedBox { + + /** + * Constructs a new IdentifiedBox. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IIdentifiedBox); + + /** IdentifiedBox boxId. */ + public boxId: (number|Long|string); + + /** IdentifiedBox normalizedBoundingBox. */ + public normalizedBoundingBox?: (google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.INormalizedBoundingBox|null); + + /** IdentifiedBox confidenceScore. */ + public confidenceScore: number; + + /** IdentifiedBox entity. */ + public entity?: (google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IEntity|null); + + /** + * Creates a new IdentifiedBox instance using the specified properties. + * @param [properties] Properties to set + * @returns IdentifiedBox instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IIdentifiedBox): google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox; + + /** + * Encodes the specified IdentifiedBox message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.verify|verify} messages. + * @param message IdentifiedBox message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IIdentifiedBox, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IdentifiedBox message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.verify|verify} messages. + * @param message IdentifiedBox message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IIdentifiedBox, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IdentifiedBox message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IdentifiedBox + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox; + + /** + * Decodes an IdentifiedBox message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IdentifiedBox + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox; + + /** + * Verifies an IdentifiedBox message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an IdentifiedBox message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IdentifiedBox + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox; + + /** + * Creates a plain object from an IdentifiedBox message. Also converts values to other types if specified. + * @param message IdentifiedBox + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IdentifiedBox to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IdentifiedBox + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace IdentifiedBox { + + /** Properties of a NormalizedBoundingBox. */ + interface INormalizedBoundingBox { + + /** NormalizedBoundingBox xmin */ + xmin?: (number|null); + + /** NormalizedBoundingBox ymin */ + ymin?: (number|null); + + /** NormalizedBoundingBox width */ + width?: (number|null); + + /** NormalizedBoundingBox height */ + height?: (number|null); + } + + /** Represents a NormalizedBoundingBox. */ + class NormalizedBoundingBox implements INormalizedBoundingBox { + + /** + * Constructs a new NormalizedBoundingBox. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.INormalizedBoundingBox); + + /** NormalizedBoundingBox xmin. */ + public xmin: number; + + /** NormalizedBoundingBox ymin. */ + public ymin: number; + + /** NormalizedBoundingBox width. */ + public width: number; + + /** NormalizedBoundingBox height. */ + public height: number; + + /** + * Creates a new NormalizedBoundingBox instance using the specified properties. + * @param [properties] Properties to set + * @returns NormalizedBoundingBox instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.INormalizedBoundingBox): google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.NormalizedBoundingBox; + + /** + * Encodes the specified NormalizedBoundingBox message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.NormalizedBoundingBox.verify|verify} messages. + * @param message NormalizedBoundingBox message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.INormalizedBoundingBox, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NormalizedBoundingBox message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.NormalizedBoundingBox.verify|verify} messages. + * @param message NormalizedBoundingBox message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.INormalizedBoundingBox, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NormalizedBoundingBox message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NormalizedBoundingBox + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.NormalizedBoundingBox; + + /** + * Decodes a NormalizedBoundingBox message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NormalizedBoundingBox + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.NormalizedBoundingBox; + + /** + * Verifies a NormalizedBoundingBox message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NormalizedBoundingBox message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NormalizedBoundingBox + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.NormalizedBoundingBox; + + /** + * Creates a plain object from a NormalizedBoundingBox message. Also converts values to other types if specified. + * @param message NormalizedBoundingBox + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.NormalizedBoundingBox, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NormalizedBoundingBox to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NormalizedBoundingBox + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of an ImageObjectDetectionPredictionResult. */ + interface IImageObjectDetectionPredictionResult { + + /** ImageObjectDetectionPredictionResult ids */ + ids?: ((number|Long|string)[]|null); + + /** ImageObjectDetectionPredictionResult displayNames */ + displayNames?: (string[]|null); + + /** ImageObjectDetectionPredictionResult confidences */ + confidences?: (number[]|null); + + /** ImageObjectDetectionPredictionResult bboxes */ + bboxes?: (google.protobuf.IListValue[]|null); + } + + /** Represents an ImageObjectDetectionPredictionResult. */ + class ImageObjectDetectionPredictionResult implements IImageObjectDetectionPredictionResult { + + /** + * Constructs a new ImageObjectDetectionPredictionResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IImageObjectDetectionPredictionResult); + + /** ImageObjectDetectionPredictionResult ids. */ + public ids: (number|Long|string)[]; + + /** ImageObjectDetectionPredictionResult displayNames. */ + public displayNames: string[]; + + /** ImageObjectDetectionPredictionResult confidences. */ + public confidences: number[]; + + /** ImageObjectDetectionPredictionResult bboxes. */ + public bboxes: google.protobuf.IListValue[]; + + /** + * Creates a new ImageObjectDetectionPredictionResult instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageObjectDetectionPredictionResult instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IImageObjectDetectionPredictionResult): google.cloud.visionai.v1alpha1.ImageObjectDetectionPredictionResult; + + /** + * Encodes the specified ImageObjectDetectionPredictionResult message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ImageObjectDetectionPredictionResult.verify|verify} messages. + * @param message ImageObjectDetectionPredictionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IImageObjectDetectionPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageObjectDetectionPredictionResult message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ImageObjectDetectionPredictionResult.verify|verify} messages. + * @param message ImageObjectDetectionPredictionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IImageObjectDetectionPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageObjectDetectionPredictionResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageObjectDetectionPredictionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ImageObjectDetectionPredictionResult; + + /** + * Decodes an ImageObjectDetectionPredictionResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageObjectDetectionPredictionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ImageObjectDetectionPredictionResult; + + /** + * Verifies an ImageObjectDetectionPredictionResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ImageObjectDetectionPredictionResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageObjectDetectionPredictionResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ImageObjectDetectionPredictionResult; + + /** + * Creates a plain object from an ImageObjectDetectionPredictionResult message. Also converts values to other types if specified. + * @param message ImageObjectDetectionPredictionResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ImageObjectDetectionPredictionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageObjectDetectionPredictionResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImageObjectDetectionPredictionResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClassificationPredictionResult. */ + interface IClassificationPredictionResult { + + /** ClassificationPredictionResult ids */ + ids?: ((number|Long|string)[]|null); + + /** ClassificationPredictionResult displayNames */ + displayNames?: (string[]|null); + + /** ClassificationPredictionResult confidences */ + confidences?: (number[]|null); + } + + /** Represents a ClassificationPredictionResult. */ + class ClassificationPredictionResult implements IClassificationPredictionResult { + + /** + * Constructs a new ClassificationPredictionResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IClassificationPredictionResult); + + /** ClassificationPredictionResult ids. */ + public ids: (number|Long|string)[]; + + /** ClassificationPredictionResult displayNames. */ + public displayNames: string[]; + + /** ClassificationPredictionResult confidences. */ + public confidences: number[]; + + /** + * Creates a new ClassificationPredictionResult instance using the specified properties. + * @param [properties] Properties to set + * @returns ClassificationPredictionResult instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IClassificationPredictionResult): google.cloud.visionai.v1alpha1.ClassificationPredictionResult; + + /** + * Encodes the specified ClassificationPredictionResult message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ClassificationPredictionResult.verify|verify} messages. + * @param message ClassificationPredictionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IClassificationPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClassificationPredictionResult message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ClassificationPredictionResult.verify|verify} messages. + * @param message ClassificationPredictionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IClassificationPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClassificationPredictionResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClassificationPredictionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ClassificationPredictionResult; + + /** + * Decodes a ClassificationPredictionResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClassificationPredictionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ClassificationPredictionResult; + + /** + * Verifies a ClassificationPredictionResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClassificationPredictionResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClassificationPredictionResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ClassificationPredictionResult; + + /** + * Creates a plain object from a ClassificationPredictionResult message. Also converts values to other types if specified. + * @param message ClassificationPredictionResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ClassificationPredictionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClassificationPredictionResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClassificationPredictionResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImageSegmentationPredictionResult. */ + interface IImageSegmentationPredictionResult { + + /** ImageSegmentationPredictionResult categoryMask */ + categoryMask?: (string|null); + + /** ImageSegmentationPredictionResult confidenceMask */ + confidenceMask?: (string|null); + } + + /** Represents an ImageSegmentationPredictionResult. */ + class ImageSegmentationPredictionResult implements IImageSegmentationPredictionResult { + + /** + * Constructs a new ImageSegmentationPredictionResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IImageSegmentationPredictionResult); + + /** ImageSegmentationPredictionResult categoryMask. */ + public categoryMask: string; + + /** ImageSegmentationPredictionResult confidenceMask. */ + public confidenceMask: string; + + /** + * Creates a new ImageSegmentationPredictionResult instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageSegmentationPredictionResult instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IImageSegmentationPredictionResult): google.cloud.visionai.v1alpha1.ImageSegmentationPredictionResult; + + /** + * Encodes the specified ImageSegmentationPredictionResult message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ImageSegmentationPredictionResult.verify|verify} messages. + * @param message ImageSegmentationPredictionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IImageSegmentationPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageSegmentationPredictionResult message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ImageSegmentationPredictionResult.verify|verify} messages. + * @param message ImageSegmentationPredictionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IImageSegmentationPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageSegmentationPredictionResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageSegmentationPredictionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ImageSegmentationPredictionResult; + + /** + * Decodes an ImageSegmentationPredictionResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageSegmentationPredictionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ImageSegmentationPredictionResult; + + /** + * Verifies an ImageSegmentationPredictionResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ImageSegmentationPredictionResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageSegmentationPredictionResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ImageSegmentationPredictionResult; + + /** + * Creates a plain object from an ImageSegmentationPredictionResult message. Also converts values to other types if specified. + * @param message ImageSegmentationPredictionResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ImageSegmentationPredictionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageSegmentationPredictionResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImageSegmentationPredictionResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VideoActionRecognitionPredictionResult. */ + interface IVideoActionRecognitionPredictionResult { + + /** VideoActionRecognitionPredictionResult segmentStartTime */ + segmentStartTime?: (google.protobuf.ITimestamp|null); + + /** VideoActionRecognitionPredictionResult segmentEndTime */ + segmentEndTime?: (google.protobuf.ITimestamp|null); + + /** VideoActionRecognitionPredictionResult actions */ + actions?: (google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult.IIdentifiedAction[]|null); + } + + /** Represents a VideoActionRecognitionPredictionResult. */ + class VideoActionRecognitionPredictionResult implements IVideoActionRecognitionPredictionResult { + + /** + * Constructs a new VideoActionRecognitionPredictionResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IVideoActionRecognitionPredictionResult); + + /** VideoActionRecognitionPredictionResult segmentStartTime. */ + public segmentStartTime?: (google.protobuf.ITimestamp|null); + + /** VideoActionRecognitionPredictionResult segmentEndTime. */ + public segmentEndTime?: (google.protobuf.ITimestamp|null); + + /** VideoActionRecognitionPredictionResult actions. */ + public actions: google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult.IIdentifiedAction[]; + + /** + * Creates a new VideoActionRecognitionPredictionResult instance using the specified properties. + * @param [properties] Properties to set + * @returns VideoActionRecognitionPredictionResult instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IVideoActionRecognitionPredictionResult): google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult; + + /** + * Encodes the specified VideoActionRecognitionPredictionResult message. Does not implicitly {@link google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult.verify|verify} messages. + * @param message VideoActionRecognitionPredictionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IVideoActionRecognitionPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VideoActionRecognitionPredictionResult message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult.verify|verify} messages. + * @param message VideoActionRecognitionPredictionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IVideoActionRecognitionPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VideoActionRecognitionPredictionResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VideoActionRecognitionPredictionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult; + + /** + * Decodes a VideoActionRecognitionPredictionResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VideoActionRecognitionPredictionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult; + + /** + * Verifies a VideoActionRecognitionPredictionResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VideoActionRecognitionPredictionResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VideoActionRecognitionPredictionResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult; + + /** + * Creates a plain object from a VideoActionRecognitionPredictionResult message. Also converts values to other types if specified. + * @param message VideoActionRecognitionPredictionResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VideoActionRecognitionPredictionResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VideoActionRecognitionPredictionResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace VideoActionRecognitionPredictionResult { + + /** Properties of an IdentifiedAction. */ + interface IIdentifiedAction { + + /** IdentifiedAction id */ + id?: (string|null); + + /** IdentifiedAction displayName */ + displayName?: (string|null); + + /** IdentifiedAction confidence */ + confidence?: (number|null); + } + + /** Represents an IdentifiedAction. */ + class IdentifiedAction implements IIdentifiedAction { + + /** + * Constructs a new IdentifiedAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult.IIdentifiedAction); + + /** IdentifiedAction id. */ + public id: string; + + /** IdentifiedAction displayName. */ + public displayName: string; + + /** IdentifiedAction confidence. */ + public confidence: number; + + /** + * Creates a new IdentifiedAction instance using the specified properties. + * @param [properties] Properties to set + * @returns IdentifiedAction instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult.IIdentifiedAction): google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult.IdentifiedAction; + + /** + * Encodes the specified IdentifiedAction message. Does not implicitly {@link google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult.IdentifiedAction.verify|verify} messages. + * @param message IdentifiedAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult.IIdentifiedAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IdentifiedAction message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult.IdentifiedAction.verify|verify} messages. + * @param message IdentifiedAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult.IIdentifiedAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IdentifiedAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IdentifiedAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult.IdentifiedAction; + + /** + * Decodes an IdentifiedAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IdentifiedAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult.IdentifiedAction; + + /** + * Verifies an IdentifiedAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an IdentifiedAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IdentifiedAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult.IdentifiedAction; + + /** + * Creates a plain object from an IdentifiedAction message. Also converts values to other types if specified. + * @param message IdentifiedAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult.IdentifiedAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IdentifiedAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IdentifiedAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a VideoObjectTrackingPredictionResult. */ + interface IVideoObjectTrackingPredictionResult { + + /** VideoObjectTrackingPredictionResult segmentStartTime */ + segmentStartTime?: (google.protobuf.ITimestamp|null); + + /** VideoObjectTrackingPredictionResult segmentEndTime */ + segmentEndTime?: (google.protobuf.ITimestamp|null); + + /** VideoObjectTrackingPredictionResult objects */ + objects?: (google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.IDetectedObject[]|null); + } + + /** Represents a VideoObjectTrackingPredictionResult. */ + class VideoObjectTrackingPredictionResult implements IVideoObjectTrackingPredictionResult { + + /** + * Constructs a new VideoObjectTrackingPredictionResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IVideoObjectTrackingPredictionResult); + + /** VideoObjectTrackingPredictionResult segmentStartTime. */ + public segmentStartTime?: (google.protobuf.ITimestamp|null); + + /** VideoObjectTrackingPredictionResult segmentEndTime. */ + public segmentEndTime?: (google.protobuf.ITimestamp|null); + + /** VideoObjectTrackingPredictionResult objects. */ + public objects: google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.IDetectedObject[]; + + /** + * Creates a new VideoObjectTrackingPredictionResult instance using the specified properties. + * @param [properties] Properties to set + * @returns VideoObjectTrackingPredictionResult instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IVideoObjectTrackingPredictionResult): google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult; + + /** + * Encodes the specified VideoObjectTrackingPredictionResult message. Does not implicitly {@link google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.verify|verify} messages. + * @param message VideoObjectTrackingPredictionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IVideoObjectTrackingPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VideoObjectTrackingPredictionResult message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.verify|verify} messages. + * @param message VideoObjectTrackingPredictionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IVideoObjectTrackingPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VideoObjectTrackingPredictionResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VideoObjectTrackingPredictionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult; + + /** + * Decodes a VideoObjectTrackingPredictionResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VideoObjectTrackingPredictionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult; + + /** + * Verifies a VideoObjectTrackingPredictionResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VideoObjectTrackingPredictionResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VideoObjectTrackingPredictionResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult; + + /** + * Creates a plain object from a VideoObjectTrackingPredictionResult message. Also converts values to other types if specified. + * @param message VideoObjectTrackingPredictionResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VideoObjectTrackingPredictionResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VideoObjectTrackingPredictionResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace VideoObjectTrackingPredictionResult { + + /** Properties of a BoundingBox. */ + interface IBoundingBox { + + /** BoundingBox xMin */ + xMin?: (number|null); + + /** BoundingBox xMax */ + xMax?: (number|null); + + /** BoundingBox yMin */ + yMin?: (number|null); + + /** BoundingBox yMax */ + yMax?: (number|null); + } + + /** Represents a BoundingBox. */ + class BoundingBox implements IBoundingBox { + + /** + * Constructs a new BoundingBox. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.IBoundingBox); + + /** BoundingBox xMin. */ + public xMin: number; + + /** BoundingBox xMax. */ + public xMax: number; + + /** BoundingBox yMin. */ + public yMin: number; + + /** BoundingBox yMax. */ + public yMax: number; + + /** + * Creates a new BoundingBox instance using the specified properties. + * @param [properties] Properties to set + * @returns BoundingBox instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.IBoundingBox): google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.BoundingBox; + + /** + * Encodes the specified BoundingBox message. Does not implicitly {@link google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.BoundingBox.verify|verify} messages. + * @param message BoundingBox message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.IBoundingBox, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoundingBox message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.BoundingBox.verify|verify} messages. + * @param message BoundingBox message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.IBoundingBox, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoundingBox message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoundingBox + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.BoundingBox; + + /** + * Decodes a BoundingBox message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoundingBox + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.BoundingBox; + + /** + * Verifies a BoundingBox message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BoundingBox message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoundingBox + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.BoundingBox; + + /** + * Creates a plain object from a BoundingBox message. Also converts values to other types if specified. + * @param message BoundingBox + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.BoundingBox, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoundingBox to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BoundingBox + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DetectedObject. */ + interface IDetectedObject { + + /** DetectedObject id */ + id?: (string|null); + + /** DetectedObject displayName */ + displayName?: (string|null); + + /** DetectedObject boundingBox */ + boundingBox?: (google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.IBoundingBox|null); + + /** DetectedObject confidence */ + confidence?: (number|null); + + /** DetectedObject trackId */ + trackId?: (number|Long|string|null); + } + + /** Represents a DetectedObject. */ + class DetectedObject implements IDetectedObject { + + /** + * Constructs a new DetectedObject. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.IDetectedObject); + + /** DetectedObject id. */ + public id: string; + + /** DetectedObject displayName. */ + public displayName: string; + + /** DetectedObject boundingBox. */ + public boundingBox?: (google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.IBoundingBox|null); + + /** DetectedObject confidence. */ + public confidence: number; + + /** DetectedObject trackId. */ + public trackId: (number|Long|string); + + /** + * Creates a new DetectedObject instance using the specified properties. + * @param [properties] Properties to set + * @returns DetectedObject instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.IDetectedObject): google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.DetectedObject; + + /** + * Encodes the specified DetectedObject message. Does not implicitly {@link google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.DetectedObject.verify|verify} messages. + * @param message DetectedObject message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.IDetectedObject, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DetectedObject message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.DetectedObject.verify|verify} messages. + * @param message DetectedObject message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.IDetectedObject, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DetectedObject message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DetectedObject + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.DetectedObject; + + /** + * Decodes a DetectedObject message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DetectedObject + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.DetectedObject; + + /** + * Verifies a DetectedObject message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DetectedObject message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DetectedObject + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.DetectedObject; + + /** + * Creates a plain object from a DetectedObject message. Also converts values to other types if specified. + * @param message DetectedObject + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.DetectedObject, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DetectedObject to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DetectedObject + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a VideoClassificationPredictionResult. */ + interface IVideoClassificationPredictionResult { + + /** VideoClassificationPredictionResult segmentStartTime */ + segmentStartTime?: (google.protobuf.ITimestamp|null); + + /** VideoClassificationPredictionResult segmentEndTime */ + segmentEndTime?: (google.protobuf.ITimestamp|null); + + /** VideoClassificationPredictionResult classifications */ + classifications?: (google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult.IIdentifiedClassification[]|null); + } + + /** Represents a VideoClassificationPredictionResult. */ + class VideoClassificationPredictionResult implements IVideoClassificationPredictionResult { + + /** + * Constructs a new VideoClassificationPredictionResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IVideoClassificationPredictionResult); + + /** VideoClassificationPredictionResult segmentStartTime. */ + public segmentStartTime?: (google.protobuf.ITimestamp|null); + + /** VideoClassificationPredictionResult segmentEndTime. */ + public segmentEndTime?: (google.protobuf.ITimestamp|null); + + /** VideoClassificationPredictionResult classifications. */ + public classifications: google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult.IIdentifiedClassification[]; + + /** + * Creates a new VideoClassificationPredictionResult instance using the specified properties. + * @param [properties] Properties to set + * @returns VideoClassificationPredictionResult instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IVideoClassificationPredictionResult): google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult; + + /** + * Encodes the specified VideoClassificationPredictionResult message. Does not implicitly {@link google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult.verify|verify} messages. + * @param message VideoClassificationPredictionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IVideoClassificationPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VideoClassificationPredictionResult message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult.verify|verify} messages. + * @param message VideoClassificationPredictionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IVideoClassificationPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VideoClassificationPredictionResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VideoClassificationPredictionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult; + + /** + * Decodes a VideoClassificationPredictionResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VideoClassificationPredictionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult; + + /** + * Verifies a VideoClassificationPredictionResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VideoClassificationPredictionResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VideoClassificationPredictionResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult; + + /** + * Creates a plain object from a VideoClassificationPredictionResult message. Also converts values to other types if specified. + * @param message VideoClassificationPredictionResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VideoClassificationPredictionResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VideoClassificationPredictionResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace VideoClassificationPredictionResult { + + /** Properties of an IdentifiedClassification. */ + interface IIdentifiedClassification { + + /** IdentifiedClassification id */ + id?: (string|null); + + /** IdentifiedClassification displayName */ + displayName?: (string|null); + + /** IdentifiedClassification confidence */ + confidence?: (number|null); + } + + /** Represents an IdentifiedClassification. */ + class IdentifiedClassification implements IIdentifiedClassification { + + /** + * Constructs a new IdentifiedClassification. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult.IIdentifiedClassification); + + /** IdentifiedClassification id. */ + public id: string; + + /** IdentifiedClassification displayName. */ + public displayName: string; + + /** IdentifiedClassification confidence. */ + public confidence: number; + + /** + * Creates a new IdentifiedClassification instance using the specified properties. + * @param [properties] Properties to set + * @returns IdentifiedClassification instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult.IIdentifiedClassification): google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult.IdentifiedClassification; + + /** + * Encodes the specified IdentifiedClassification message. Does not implicitly {@link google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult.IdentifiedClassification.verify|verify} messages. + * @param message IdentifiedClassification message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult.IIdentifiedClassification, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IdentifiedClassification message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult.IdentifiedClassification.verify|verify} messages. + * @param message IdentifiedClassification message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult.IIdentifiedClassification, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IdentifiedClassification message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IdentifiedClassification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult.IdentifiedClassification; + + /** + * Decodes an IdentifiedClassification message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IdentifiedClassification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult.IdentifiedClassification; + + /** + * Verifies an IdentifiedClassification message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an IdentifiedClassification message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IdentifiedClassification + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult.IdentifiedClassification; + + /** + * Creates a plain object from an IdentifiedClassification message. Also converts values to other types if specified. + * @param message IdentifiedClassification + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult.IdentifiedClassification, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IdentifiedClassification to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IdentifiedClassification + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an OccupancyCountingPredictionResult. */ + interface IOccupancyCountingPredictionResult { + + /** OccupancyCountingPredictionResult currentTime */ + currentTime?: (google.protobuf.ITimestamp|null); + + /** OccupancyCountingPredictionResult identifiedBoxes */ + identifiedBoxes?: (google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IIdentifiedBox[]|null); + + /** OccupancyCountingPredictionResult stats */ + stats?: (google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IStats|null); + + /** OccupancyCountingPredictionResult trackInfo */ + trackInfo?: (google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.ITrackInfo[]|null); + + /** OccupancyCountingPredictionResult dwellTimeInfo */ + dwellTimeInfo?: (google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IDwellTimeInfo[]|null); + } + + /** Represents an OccupancyCountingPredictionResult. */ + class OccupancyCountingPredictionResult implements IOccupancyCountingPredictionResult { + + /** + * Constructs a new OccupancyCountingPredictionResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IOccupancyCountingPredictionResult); + + /** OccupancyCountingPredictionResult currentTime. */ + public currentTime?: (google.protobuf.ITimestamp|null); + + /** OccupancyCountingPredictionResult identifiedBoxes. */ + public identifiedBoxes: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IIdentifiedBox[]; + + /** OccupancyCountingPredictionResult stats. */ + public stats?: (google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IStats|null); + + /** OccupancyCountingPredictionResult trackInfo. */ + public trackInfo: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.ITrackInfo[]; + + /** OccupancyCountingPredictionResult dwellTimeInfo. */ + public dwellTimeInfo: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IDwellTimeInfo[]; + + /** + * Creates a new OccupancyCountingPredictionResult instance using the specified properties. + * @param [properties] Properties to set + * @returns OccupancyCountingPredictionResult instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IOccupancyCountingPredictionResult): google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult; + + /** + * Encodes the specified OccupancyCountingPredictionResult message. Does not implicitly {@link google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.verify|verify} messages. + * @param message OccupancyCountingPredictionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IOccupancyCountingPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OccupancyCountingPredictionResult message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.verify|verify} messages. + * @param message OccupancyCountingPredictionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IOccupancyCountingPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OccupancyCountingPredictionResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OccupancyCountingPredictionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult; + + /** + * Decodes an OccupancyCountingPredictionResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OccupancyCountingPredictionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult; + + /** + * Verifies an OccupancyCountingPredictionResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OccupancyCountingPredictionResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OccupancyCountingPredictionResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult; + + /** + * Creates a plain object from an OccupancyCountingPredictionResult message. Also converts values to other types if specified. + * @param message OccupancyCountingPredictionResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OccupancyCountingPredictionResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OccupancyCountingPredictionResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace OccupancyCountingPredictionResult { + + /** Properties of an Entity. */ + interface IEntity { + + /** Entity labelId */ + labelId?: (number|Long|string|null); + + /** Entity labelString */ + labelString?: (string|null); + } + + /** Represents an Entity. */ + class Entity implements IEntity { + + /** + * Constructs a new Entity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IEntity); + + /** Entity labelId. */ + public labelId: (number|Long|string); + + /** Entity labelString. */ + public labelString: string; + + /** + * Creates a new Entity instance using the specified properties. + * @param [properties] Properties to set + * @returns Entity instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IEntity): google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Entity; + + /** + * Encodes the specified Entity message. Does not implicitly {@link google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Entity.verify|verify} messages. + * @param message Entity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Entity message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Entity.verify|verify} messages. + * @param message Entity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Entity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Entity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Entity; + + /** + * Decodes an Entity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Entity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Entity; + + /** + * Verifies an Entity message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Entity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Entity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Entity; + + /** + * Creates a plain object from an Entity message. Also converts values to other types if specified. + * @param message Entity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Entity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Entity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Entity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IdentifiedBox. */ + interface IIdentifiedBox { + + /** IdentifiedBox boxId */ + boxId?: (number|Long|string|null); + + /** IdentifiedBox normalizedBoundingBox */ + normalizedBoundingBox?: (google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.INormalizedBoundingBox|null); + + /** IdentifiedBox score */ + score?: (number|null); + + /** IdentifiedBox entity */ + entity?: (google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IEntity|null); + + /** IdentifiedBox trackId */ + trackId?: (number|Long|string|null); + } + + /** Represents an IdentifiedBox. */ + class IdentifiedBox implements IIdentifiedBox { + + /** + * Constructs a new IdentifiedBox. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IIdentifiedBox); + + /** IdentifiedBox boxId. */ + public boxId: (number|Long|string); + + /** IdentifiedBox normalizedBoundingBox. */ + public normalizedBoundingBox?: (google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.INormalizedBoundingBox|null); + + /** IdentifiedBox score. */ + public score: number; + + /** IdentifiedBox entity. */ + public entity?: (google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IEntity|null); + + /** IdentifiedBox trackId. */ + public trackId: (number|Long|string); + + /** + * Creates a new IdentifiedBox instance using the specified properties. + * @param [properties] Properties to set + * @returns IdentifiedBox instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IIdentifiedBox): google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox; + + /** + * Encodes the specified IdentifiedBox message. Does not implicitly {@link google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.verify|verify} messages. + * @param message IdentifiedBox message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IIdentifiedBox, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IdentifiedBox message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.verify|verify} messages. + * @param message IdentifiedBox message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IIdentifiedBox, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IdentifiedBox message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IdentifiedBox + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox; + + /** + * Decodes an IdentifiedBox message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IdentifiedBox + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox; + + /** + * Verifies an IdentifiedBox message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an IdentifiedBox message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IdentifiedBox + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox; + + /** + * Creates a plain object from an IdentifiedBox message. Also converts values to other types if specified. + * @param message IdentifiedBox + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IdentifiedBox to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IdentifiedBox + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace IdentifiedBox { + + /** Properties of a NormalizedBoundingBox. */ + interface INormalizedBoundingBox { + + /** NormalizedBoundingBox xmin */ + xmin?: (number|null); + + /** NormalizedBoundingBox ymin */ + ymin?: (number|null); + + /** NormalizedBoundingBox width */ + width?: (number|null); + + /** NormalizedBoundingBox height */ + height?: (number|null); + } + + /** Represents a NormalizedBoundingBox. */ + class NormalizedBoundingBox implements INormalizedBoundingBox { + + /** + * Constructs a new NormalizedBoundingBox. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.INormalizedBoundingBox); + + /** NormalizedBoundingBox xmin. */ + public xmin: number; + + /** NormalizedBoundingBox ymin. */ + public ymin: number; + + /** NormalizedBoundingBox width. */ + public width: number; + + /** NormalizedBoundingBox height. */ + public height: number; + + /** + * Creates a new NormalizedBoundingBox instance using the specified properties. + * @param [properties] Properties to set + * @returns NormalizedBoundingBox instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.INormalizedBoundingBox): google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.NormalizedBoundingBox; + + /** + * Encodes the specified NormalizedBoundingBox message. Does not implicitly {@link google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.NormalizedBoundingBox.verify|verify} messages. + * @param message NormalizedBoundingBox message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.INormalizedBoundingBox, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NormalizedBoundingBox message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.NormalizedBoundingBox.verify|verify} messages. + * @param message NormalizedBoundingBox message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.INormalizedBoundingBox, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NormalizedBoundingBox message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NormalizedBoundingBox + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.NormalizedBoundingBox; + + /** + * Decodes a NormalizedBoundingBox message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NormalizedBoundingBox + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.NormalizedBoundingBox; + + /** + * Verifies a NormalizedBoundingBox message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NormalizedBoundingBox message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NormalizedBoundingBox + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.NormalizedBoundingBox; + + /** + * Creates a plain object from a NormalizedBoundingBox message. Also converts values to other types if specified. + * @param message NormalizedBoundingBox + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.NormalizedBoundingBox, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NormalizedBoundingBox to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NormalizedBoundingBox + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Stats. */ + interface IStats { + + /** Stats fullFrameCount */ + fullFrameCount?: (google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.IObjectCount[]|null); + + /** Stats crossingLineCounts */ + crossingLineCounts?: (google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ICrossingLineCount[]|null); + + /** Stats activeZoneCounts */ + activeZoneCounts?: (google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.IActiveZoneCount[]|null); + } + + /** Represents a Stats. */ + class Stats implements IStats { + + /** + * Constructs a new Stats. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IStats); + + /** Stats fullFrameCount. */ + public fullFrameCount: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.IObjectCount[]; + + /** Stats crossingLineCounts. */ + public crossingLineCounts: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ICrossingLineCount[]; + + /** Stats activeZoneCounts. */ + public activeZoneCounts: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.IActiveZoneCount[]; + + /** + * Creates a new Stats instance using the specified properties. + * @param [properties] Properties to set + * @returns Stats instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IStats): google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats; + + /** + * Encodes the specified Stats message. Does not implicitly {@link google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.verify|verify} messages. + * @param message Stats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Stats message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.verify|verify} messages. + * @param message Stats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Stats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Stats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats; + + /** + * Decodes a Stats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Stats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats; + + /** + * Verifies a Stats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Stats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Stats + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats; + + /** + * Creates a plain object from a Stats message. Also converts values to other types if specified. + * @param message Stats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Stats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Stats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Stats { + + /** Properties of an ObjectCount. */ + interface IObjectCount { + + /** ObjectCount entity */ + entity?: (google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IEntity|null); + + /** ObjectCount count */ + count?: (number|null); + } + + /** Represents an ObjectCount. */ + class ObjectCount implements IObjectCount { + + /** + * Constructs a new ObjectCount. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.IObjectCount); + + /** ObjectCount entity. */ + public entity?: (google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IEntity|null); + + /** ObjectCount count. */ + public count: number; + + /** + * Creates a new ObjectCount instance using the specified properties. + * @param [properties] Properties to set + * @returns ObjectCount instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.IObjectCount): google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ObjectCount; + + /** + * Encodes the specified ObjectCount message. Does not implicitly {@link google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ObjectCount.verify|verify} messages. + * @param message ObjectCount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.IObjectCount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ObjectCount message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ObjectCount.verify|verify} messages. + * @param message ObjectCount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.IObjectCount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ObjectCount message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ObjectCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ObjectCount; + + /** + * Decodes an ObjectCount message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ObjectCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ObjectCount; + + /** + * Verifies an ObjectCount message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ObjectCount message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ObjectCount + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ObjectCount; + + /** + * Creates a plain object from an ObjectCount message. Also converts values to other types if specified. + * @param message ObjectCount + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ObjectCount, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ObjectCount to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ObjectCount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccumulatedObjectCount. */ + interface IAccumulatedObjectCount { + + /** AccumulatedObjectCount startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** AccumulatedObjectCount objectCount */ + objectCount?: (google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.IObjectCount|null); + } + + /** Represents an AccumulatedObjectCount. */ + class AccumulatedObjectCount implements IAccumulatedObjectCount { + + /** + * Constructs a new AccumulatedObjectCount. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.IAccumulatedObjectCount); + + /** AccumulatedObjectCount startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** AccumulatedObjectCount objectCount. */ + public objectCount?: (google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.IObjectCount|null); + + /** + * Creates a new AccumulatedObjectCount instance using the specified properties. + * @param [properties] Properties to set + * @returns AccumulatedObjectCount instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.IAccumulatedObjectCount): google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.AccumulatedObjectCount; + + /** + * Encodes the specified AccumulatedObjectCount message. Does not implicitly {@link google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.AccumulatedObjectCount.verify|verify} messages. + * @param message AccumulatedObjectCount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.IAccumulatedObjectCount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccumulatedObjectCount message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.AccumulatedObjectCount.verify|verify} messages. + * @param message AccumulatedObjectCount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.IAccumulatedObjectCount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccumulatedObjectCount message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AccumulatedObjectCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.AccumulatedObjectCount; + + /** + * Decodes an AccumulatedObjectCount message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AccumulatedObjectCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.AccumulatedObjectCount; + + /** + * Verifies an AccumulatedObjectCount message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AccumulatedObjectCount message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AccumulatedObjectCount + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.AccumulatedObjectCount; + + /** + * Creates a plain object from an AccumulatedObjectCount message. Also converts values to other types if specified. + * @param message AccumulatedObjectCount + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.AccumulatedObjectCount, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccumulatedObjectCount to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AccumulatedObjectCount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CrossingLineCount. */ + interface ICrossingLineCount { + + /** CrossingLineCount annotation */ + annotation?: (google.cloud.visionai.v1alpha1.IStreamAnnotation|null); + + /** CrossingLineCount positiveDirectionCounts */ + positiveDirectionCounts?: (google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.IObjectCount[]|null); + + /** CrossingLineCount negativeDirectionCounts */ + negativeDirectionCounts?: (google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.IObjectCount[]|null); + + /** CrossingLineCount accumulatedPositiveDirectionCounts */ + accumulatedPositiveDirectionCounts?: (google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.IAccumulatedObjectCount[]|null); + + /** CrossingLineCount accumulatedNegativeDirectionCounts */ + accumulatedNegativeDirectionCounts?: (google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.IAccumulatedObjectCount[]|null); + } + + /** Represents a CrossingLineCount. */ + class CrossingLineCount implements ICrossingLineCount { + + /** + * Constructs a new CrossingLineCount. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ICrossingLineCount); + + /** CrossingLineCount annotation. */ + public annotation?: (google.cloud.visionai.v1alpha1.IStreamAnnotation|null); + + /** CrossingLineCount positiveDirectionCounts. */ + public positiveDirectionCounts: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.IObjectCount[]; + + /** CrossingLineCount negativeDirectionCounts. */ + public negativeDirectionCounts: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.IObjectCount[]; + + /** CrossingLineCount accumulatedPositiveDirectionCounts. */ + public accumulatedPositiveDirectionCounts: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.IAccumulatedObjectCount[]; + + /** CrossingLineCount accumulatedNegativeDirectionCounts. */ + public accumulatedNegativeDirectionCounts: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.IAccumulatedObjectCount[]; + + /** + * Creates a new CrossingLineCount instance using the specified properties. + * @param [properties] Properties to set + * @returns CrossingLineCount instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ICrossingLineCount): google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.CrossingLineCount; + + /** + * Encodes the specified CrossingLineCount message. Does not implicitly {@link google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.CrossingLineCount.verify|verify} messages. + * @param message CrossingLineCount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ICrossingLineCount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CrossingLineCount message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.CrossingLineCount.verify|verify} messages. + * @param message CrossingLineCount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ICrossingLineCount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CrossingLineCount message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CrossingLineCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.CrossingLineCount; + + /** + * Decodes a CrossingLineCount message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CrossingLineCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.CrossingLineCount; + + /** + * Verifies a CrossingLineCount message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CrossingLineCount message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CrossingLineCount + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.CrossingLineCount; + + /** + * Creates a plain object from a CrossingLineCount message. Also converts values to other types if specified. + * @param message CrossingLineCount + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.CrossingLineCount, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CrossingLineCount to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CrossingLineCount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ActiveZoneCount. */ + interface IActiveZoneCount { + + /** ActiveZoneCount annotation */ + annotation?: (google.cloud.visionai.v1alpha1.IStreamAnnotation|null); + + /** ActiveZoneCount counts */ + counts?: (google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.IObjectCount[]|null); + } + + /** Represents an ActiveZoneCount. */ + class ActiveZoneCount implements IActiveZoneCount { + + /** + * Constructs a new ActiveZoneCount. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.IActiveZoneCount); + + /** ActiveZoneCount annotation. */ + public annotation?: (google.cloud.visionai.v1alpha1.IStreamAnnotation|null); + + /** ActiveZoneCount counts. */ + public counts: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.IObjectCount[]; + + /** + * Creates a new ActiveZoneCount instance using the specified properties. + * @param [properties] Properties to set + * @returns ActiveZoneCount instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.IActiveZoneCount): google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ActiveZoneCount; + + /** + * Encodes the specified ActiveZoneCount message. Does not implicitly {@link google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ActiveZoneCount.verify|verify} messages. + * @param message ActiveZoneCount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.IActiveZoneCount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ActiveZoneCount message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ActiveZoneCount.verify|verify} messages. + * @param message ActiveZoneCount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.IActiveZoneCount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ActiveZoneCount message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ActiveZoneCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ActiveZoneCount; + + /** + * Decodes an ActiveZoneCount message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ActiveZoneCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ActiveZoneCount; + + /** + * Verifies an ActiveZoneCount message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ActiveZoneCount message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ActiveZoneCount + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ActiveZoneCount; + + /** + * Creates a plain object from an ActiveZoneCount message. Also converts values to other types if specified. + * @param message ActiveZoneCount + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ActiveZoneCount, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ActiveZoneCount to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ActiveZoneCount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a TrackInfo. */ + interface ITrackInfo { + + /** TrackInfo trackId */ + trackId?: (string|null); + + /** TrackInfo startTime */ + startTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a TrackInfo. */ + class TrackInfo implements ITrackInfo { + + /** + * Constructs a new TrackInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.ITrackInfo); + + /** TrackInfo trackId. */ + public trackId: string; + + /** TrackInfo startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new TrackInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns TrackInfo instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.ITrackInfo): google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.TrackInfo; + + /** + * Encodes the specified TrackInfo message. Does not implicitly {@link google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.TrackInfo.verify|verify} messages. + * @param message TrackInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.ITrackInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TrackInfo message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.TrackInfo.verify|verify} messages. + * @param message TrackInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.ITrackInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TrackInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TrackInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.TrackInfo; + + /** + * Decodes a TrackInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TrackInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.TrackInfo; + + /** + * Verifies a TrackInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TrackInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TrackInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.TrackInfo; + + /** + * Creates a plain object from a TrackInfo message. Also converts values to other types if specified. + * @param message TrackInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.TrackInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TrackInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TrackInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DwellTimeInfo. */ + interface IDwellTimeInfo { + + /** DwellTimeInfo trackId */ + trackId?: (string|null); + + /** DwellTimeInfo zoneId */ + zoneId?: (string|null); + + /** DwellTimeInfo dwellStartTime */ + dwellStartTime?: (google.protobuf.ITimestamp|null); + + /** DwellTimeInfo dwellEndTime */ + dwellEndTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a DwellTimeInfo. */ + class DwellTimeInfo implements IDwellTimeInfo { + + /** + * Constructs a new DwellTimeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IDwellTimeInfo); + + /** DwellTimeInfo trackId. */ + public trackId: string; + + /** DwellTimeInfo zoneId. */ + public zoneId: string; + + /** DwellTimeInfo dwellStartTime. */ + public dwellStartTime?: (google.protobuf.ITimestamp|null); + + /** DwellTimeInfo dwellEndTime. */ + public dwellEndTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new DwellTimeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns DwellTimeInfo instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IDwellTimeInfo): google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.DwellTimeInfo; + + /** + * Encodes the specified DwellTimeInfo message. Does not implicitly {@link google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.DwellTimeInfo.verify|verify} messages. + * @param message DwellTimeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IDwellTimeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DwellTimeInfo message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.DwellTimeInfo.verify|verify} messages. + * @param message DwellTimeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IDwellTimeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DwellTimeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DwellTimeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.DwellTimeInfo; + + /** + * Decodes a DwellTimeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DwellTimeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.DwellTimeInfo; + + /** + * Verifies a DwellTimeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DwellTimeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DwellTimeInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.DwellTimeInfo; + + /** + * Creates a plain object from a DwellTimeInfo message. Also converts values to other types if specified. + * @param message DwellTimeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.DwellTimeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DwellTimeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DwellTimeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a StreamAnnotation. */ + interface IStreamAnnotation { + + /** StreamAnnotation activeZone */ + activeZone?: (google.cloud.visionai.v1alpha1.INormalizedPolygon|null); + + /** StreamAnnotation crossingLine */ + crossingLine?: (google.cloud.visionai.v1alpha1.INormalizedPolyline|null); + + /** StreamAnnotation id */ + id?: (string|null); + + /** StreamAnnotation displayName */ + displayName?: (string|null); + + /** StreamAnnotation sourceStream */ + sourceStream?: (string|null); + + /** StreamAnnotation type */ + type?: (google.cloud.visionai.v1alpha1.StreamAnnotationType|keyof typeof google.cloud.visionai.v1alpha1.StreamAnnotationType|null); + } + + /** Represents a StreamAnnotation. */ + class StreamAnnotation implements IStreamAnnotation { + + /** + * Constructs a new StreamAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IStreamAnnotation); + + /** StreamAnnotation activeZone. */ + public activeZone?: (google.cloud.visionai.v1alpha1.INormalizedPolygon|null); + + /** StreamAnnotation crossingLine. */ + public crossingLine?: (google.cloud.visionai.v1alpha1.INormalizedPolyline|null); + + /** StreamAnnotation id. */ + public id: string; + + /** StreamAnnotation displayName. */ + public displayName: string; + + /** StreamAnnotation sourceStream. */ + public sourceStream: string; + + /** StreamAnnotation type. */ + public type: (google.cloud.visionai.v1alpha1.StreamAnnotationType|keyof typeof google.cloud.visionai.v1alpha1.StreamAnnotationType); + + /** StreamAnnotation annotationPayload. */ + public annotationPayload?: ("activeZone"|"crossingLine"); + + /** + * Creates a new StreamAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamAnnotation instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IStreamAnnotation): google.cloud.visionai.v1alpha1.StreamAnnotation; + + /** + * Encodes the specified StreamAnnotation message. Does not implicitly {@link google.cloud.visionai.v1alpha1.StreamAnnotation.verify|verify} messages. + * @param message StreamAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IStreamAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamAnnotation message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.StreamAnnotation.verify|verify} messages. + * @param message StreamAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IStreamAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.StreamAnnotation; + + /** + * Decodes a StreamAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.StreamAnnotation; + + /** + * Verifies a StreamAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.StreamAnnotation; + + /** + * Creates a plain object from a StreamAnnotation message. Also converts values to other types if specified. + * @param message StreamAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.StreamAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StreamAnnotations. */ + interface IStreamAnnotations { + + /** StreamAnnotations streamAnnotations */ + streamAnnotations?: (google.cloud.visionai.v1alpha1.IStreamAnnotation[]|null); + } + + /** Represents a StreamAnnotations. */ + class StreamAnnotations implements IStreamAnnotations { + + /** + * Constructs a new StreamAnnotations. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IStreamAnnotations); + + /** StreamAnnotations streamAnnotations. */ + public streamAnnotations: google.cloud.visionai.v1alpha1.IStreamAnnotation[]; + + /** + * Creates a new StreamAnnotations instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamAnnotations instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IStreamAnnotations): google.cloud.visionai.v1alpha1.StreamAnnotations; + + /** + * Encodes the specified StreamAnnotations message. Does not implicitly {@link google.cloud.visionai.v1alpha1.StreamAnnotations.verify|verify} messages. + * @param message StreamAnnotations message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IStreamAnnotations, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamAnnotations message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.StreamAnnotations.verify|verify} messages. + * @param message StreamAnnotations message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IStreamAnnotations, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamAnnotations message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamAnnotations + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.StreamAnnotations; + + /** + * Decodes a StreamAnnotations message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamAnnotations + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.StreamAnnotations; + + /** + * Verifies a StreamAnnotations message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamAnnotations message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamAnnotations + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.StreamAnnotations; + + /** + * Creates a plain object from a StreamAnnotations message. Also converts values to other types if specified. + * @param message StreamAnnotations + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.StreamAnnotations, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamAnnotations to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamAnnotations + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NormalizedPolygon. */ + interface INormalizedPolygon { + + /** NormalizedPolygon normalizedVertices */ + normalizedVertices?: (google.cloud.visionai.v1alpha1.INormalizedVertex[]|null); + } + + /** Represents a NormalizedPolygon. */ + class NormalizedPolygon implements INormalizedPolygon { + + /** + * Constructs a new NormalizedPolygon. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.INormalizedPolygon); + + /** NormalizedPolygon normalizedVertices. */ + public normalizedVertices: google.cloud.visionai.v1alpha1.INormalizedVertex[]; + + /** + * Creates a new NormalizedPolygon instance using the specified properties. + * @param [properties] Properties to set + * @returns NormalizedPolygon instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.INormalizedPolygon): google.cloud.visionai.v1alpha1.NormalizedPolygon; + + /** + * Encodes the specified NormalizedPolygon message. Does not implicitly {@link google.cloud.visionai.v1alpha1.NormalizedPolygon.verify|verify} messages. + * @param message NormalizedPolygon message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.INormalizedPolygon, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NormalizedPolygon message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.NormalizedPolygon.verify|verify} messages. + * @param message NormalizedPolygon message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.INormalizedPolygon, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NormalizedPolygon message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NormalizedPolygon + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.NormalizedPolygon; + + /** + * Decodes a NormalizedPolygon message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NormalizedPolygon + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.NormalizedPolygon; + + /** + * Verifies a NormalizedPolygon message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NormalizedPolygon message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NormalizedPolygon + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.NormalizedPolygon; + + /** + * Creates a plain object from a NormalizedPolygon message. Also converts values to other types if specified. + * @param message NormalizedPolygon + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.NormalizedPolygon, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NormalizedPolygon to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NormalizedPolygon + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NormalizedPolyline. */ + interface INormalizedPolyline { + + /** NormalizedPolyline normalizedVertices */ + normalizedVertices?: (google.cloud.visionai.v1alpha1.INormalizedVertex[]|null); + } + + /** Represents a NormalizedPolyline. */ + class NormalizedPolyline implements INormalizedPolyline { + + /** + * Constructs a new NormalizedPolyline. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.INormalizedPolyline); + + /** NormalizedPolyline normalizedVertices. */ + public normalizedVertices: google.cloud.visionai.v1alpha1.INormalizedVertex[]; + + /** + * Creates a new NormalizedPolyline instance using the specified properties. + * @param [properties] Properties to set + * @returns NormalizedPolyline instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.INormalizedPolyline): google.cloud.visionai.v1alpha1.NormalizedPolyline; + + /** + * Encodes the specified NormalizedPolyline message. Does not implicitly {@link google.cloud.visionai.v1alpha1.NormalizedPolyline.verify|verify} messages. + * @param message NormalizedPolyline message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.INormalizedPolyline, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NormalizedPolyline message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.NormalizedPolyline.verify|verify} messages. + * @param message NormalizedPolyline message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.INormalizedPolyline, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NormalizedPolyline message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NormalizedPolyline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.NormalizedPolyline; + + /** + * Decodes a NormalizedPolyline message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NormalizedPolyline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.NormalizedPolyline; + + /** + * Verifies a NormalizedPolyline message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NormalizedPolyline message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NormalizedPolyline + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.NormalizedPolyline; + + /** + * Creates a plain object from a NormalizedPolyline message. Also converts values to other types if specified. + * @param message NormalizedPolyline + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.NormalizedPolyline, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NormalizedPolyline to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NormalizedPolyline + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NormalizedVertex. */ + interface INormalizedVertex { + + /** NormalizedVertex x */ + x?: (number|null); + + /** NormalizedVertex y */ + y?: (number|null); + } + + /** Represents a NormalizedVertex. */ + class NormalizedVertex implements INormalizedVertex { + + /** + * Constructs a new NormalizedVertex. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.INormalizedVertex); + + /** NormalizedVertex x. */ + public x: number; + + /** NormalizedVertex y. */ + public y: number; + + /** + * Creates a new NormalizedVertex instance using the specified properties. + * @param [properties] Properties to set + * @returns NormalizedVertex instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.INormalizedVertex): google.cloud.visionai.v1alpha1.NormalizedVertex; + + /** + * Encodes the specified NormalizedVertex message. Does not implicitly {@link google.cloud.visionai.v1alpha1.NormalizedVertex.verify|verify} messages. + * @param message NormalizedVertex message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.INormalizedVertex, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NormalizedVertex message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.NormalizedVertex.verify|verify} messages. + * @param message NormalizedVertex message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.INormalizedVertex, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NormalizedVertex message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NormalizedVertex + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.NormalizedVertex; + + /** + * Decodes a NormalizedVertex message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NormalizedVertex + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.NormalizedVertex; + + /** + * Verifies a NormalizedVertex message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NormalizedVertex message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NormalizedVertex + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.NormalizedVertex; + + /** + * Creates a plain object from a NormalizedVertex message. Also converts values to other types if specified. + * @param message NormalizedVertex + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.NormalizedVertex, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NormalizedVertex to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NormalizedVertex + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AppPlatformMetadata. */ + interface IAppPlatformMetadata { + + /** AppPlatformMetadata application */ + application?: (string|null); + + /** AppPlatformMetadata instanceId */ + instanceId?: (string|null); + + /** AppPlatformMetadata node */ + node?: (string|null); + + /** AppPlatformMetadata processor */ + processor?: (string|null); + } + + /** Represents an AppPlatformMetadata. */ + class AppPlatformMetadata implements IAppPlatformMetadata { + + /** + * Constructs a new AppPlatformMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IAppPlatformMetadata); + + /** AppPlatformMetadata application. */ + public application: string; + + /** AppPlatformMetadata instanceId. */ + public instanceId: string; + + /** AppPlatformMetadata node. */ + public node: string; + + /** AppPlatformMetadata processor. */ + public processor: string; + + /** + * Creates a new AppPlatformMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns AppPlatformMetadata instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IAppPlatformMetadata): google.cloud.visionai.v1alpha1.AppPlatformMetadata; + + /** + * Encodes the specified AppPlatformMetadata message. Does not implicitly {@link google.cloud.visionai.v1alpha1.AppPlatformMetadata.verify|verify} messages. + * @param message AppPlatformMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IAppPlatformMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AppPlatformMetadata message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.AppPlatformMetadata.verify|verify} messages. + * @param message AppPlatformMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IAppPlatformMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AppPlatformMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AppPlatformMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.AppPlatformMetadata; + + /** + * Decodes an AppPlatformMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AppPlatformMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.AppPlatformMetadata; + + /** + * Verifies an AppPlatformMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AppPlatformMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AppPlatformMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.AppPlatformMetadata; + + /** + * Creates a plain object from an AppPlatformMetadata message. Also converts values to other types if specified. + * @param message AppPlatformMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.AppPlatformMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AppPlatformMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AppPlatformMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AppPlatformCloudFunctionRequest. */ + interface IAppPlatformCloudFunctionRequest { + + /** AppPlatformCloudFunctionRequest appPlatformMetadata */ + appPlatformMetadata?: (google.cloud.visionai.v1alpha1.IAppPlatformMetadata|null); + + /** AppPlatformCloudFunctionRequest annotations */ + annotations?: (google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest.IStructedInputAnnotation[]|null); + } + + /** Represents an AppPlatformCloudFunctionRequest. */ + class AppPlatformCloudFunctionRequest implements IAppPlatformCloudFunctionRequest { + + /** + * Constructs a new AppPlatformCloudFunctionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IAppPlatformCloudFunctionRequest); + + /** AppPlatformCloudFunctionRequest appPlatformMetadata. */ + public appPlatformMetadata?: (google.cloud.visionai.v1alpha1.IAppPlatformMetadata|null); + + /** AppPlatformCloudFunctionRequest annotations. */ + public annotations: google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest.IStructedInputAnnotation[]; + + /** + * Creates a new AppPlatformCloudFunctionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AppPlatformCloudFunctionRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IAppPlatformCloudFunctionRequest): google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest; + + /** + * Encodes the specified AppPlatformCloudFunctionRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest.verify|verify} messages. + * @param message AppPlatformCloudFunctionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IAppPlatformCloudFunctionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AppPlatformCloudFunctionRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest.verify|verify} messages. + * @param message AppPlatformCloudFunctionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IAppPlatformCloudFunctionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AppPlatformCloudFunctionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AppPlatformCloudFunctionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest; + + /** + * Decodes an AppPlatformCloudFunctionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AppPlatformCloudFunctionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest; + + /** + * Verifies an AppPlatformCloudFunctionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AppPlatformCloudFunctionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AppPlatformCloudFunctionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest; + + /** + * Creates a plain object from an AppPlatformCloudFunctionRequest message. Also converts values to other types if specified. + * @param message AppPlatformCloudFunctionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AppPlatformCloudFunctionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AppPlatformCloudFunctionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AppPlatformCloudFunctionRequest { + + /** Properties of a StructedInputAnnotation. */ + interface IStructedInputAnnotation { + + /** StructedInputAnnotation ingestionTimeMicros */ + ingestionTimeMicros?: (number|Long|string|null); + + /** StructedInputAnnotation annotation */ + annotation?: (google.protobuf.IStruct|null); + } + + /** Represents a StructedInputAnnotation. */ + class StructedInputAnnotation implements IStructedInputAnnotation { + + /** + * Constructs a new StructedInputAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest.IStructedInputAnnotation); + + /** StructedInputAnnotation ingestionTimeMicros. */ + public ingestionTimeMicros: (number|Long|string); + + /** StructedInputAnnotation annotation. */ + public annotation?: (google.protobuf.IStruct|null); + + /** + * Creates a new StructedInputAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns StructedInputAnnotation instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest.IStructedInputAnnotation): google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest.StructedInputAnnotation; + + /** + * Encodes the specified StructedInputAnnotation message. Does not implicitly {@link google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest.StructedInputAnnotation.verify|verify} messages. + * @param message StructedInputAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest.IStructedInputAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StructedInputAnnotation message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest.StructedInputAnnotation.verify|verify} messages. + * @param message StructedInputAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest.IStructedInputAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StructedInputAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StructedInputAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest.StructedInputAnnotation; + + /** + * Decodes a StructedInputAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StructedInputAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest.StructedInputAnnotation; + + /** + * Verifies a StructedInputAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StructedInputAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StructedInputAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest.StructedInputAnnotation; + + /** + * Creates a plain object from a StructedInputAnnotation message. Also converts values to other types if specified. + * @param message StructedInputAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest.StructedInputAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StructedInputAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StructedInputAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an AppPlatformCloudFunctionResponse. */ + interface IAppPlatformCloudFunctionResponse { + + /** AppPlatformCloudFunctionResponse annotations */ + annotations?: (google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse.IStructedOutputAnnotation[]|null); + + /** AppPlatformCloudFunctionResponse annotationPassthrough */ + annotationPassthrough?: (boolean|null); + + /** AppPlatformCloudFunctionResponse events */ + events?: (google.cloud.visionai.v1alpha1.IAppPlatformEventBody[]|null); + } + + /** Represents an AppPlatformCloudFunctionResponse. */ + class AppPlatformCloudFunctionResponse implements IAppPlatformCloudFunctionResponse { + + /** + * Constructs a new AppPlatformCloudFunctionResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IAppPlatformCloudFunctionResponse); + + /** AppPlatformCloudFunctionResponse annotations. */ + public annotations: google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse.IStructedOutputAnnotation[]; + + /** AppPlatformCloudFunctionResponse annotationPassthrough. */ + public annotationPassthrough: boolean; + + /** AppPlatformCloudFunctionResponse events. */ + public events: google.cloud.visionai.v1alpha1.IAppPlatformEventBody[]; + + /** + * Creates a new AppPlatformCloudFunctionResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AppPlatformCloudFunctionResponse instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IAppPlatformCloudFunctionResponse): google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse; + + /** + * Encodes the specified AppPlatformCloudFunctionResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse.verify|verify} messages. + * @param message AppPlatformCloudFunctionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IAppPlatformCloudFunctionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AppPlatformCloudFunctionResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse.verify|verify} messages. + * @param message AppPlatformCloudFunctionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IAppPlatformCloudFunctionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AppPlatformCloudFunctionResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AppPlatformCloudFunctionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse; + + /** + * Decodes an AppPlatformCloudFunctionResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AppPlatformCloudFunctionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse; + + /** + * Verifies an AppPlatformCloudFunctionResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AppPlatformCloudFunctionResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AppPlatformCloudFunctionResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse; + + /** + * Creates a plain object from an AppPlatformCloudFunctionResponse message. Also converts values to other types if specified. + * @param message AppPlatformCloudFunctionResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AppPlatformCloudFunctionResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AppPlatformCloudFunctionResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AppPlatformCloudFunctionResponse { + + /** Properties of a StructedOutputAnnotation. */ + interface IStructedOutputAnnotation { + + /** StructedOutputAnnotation annotation */ + annotation?: (google.protobuf.IStruct|null); + } + + /** Represents a StructedOutputAnnotation. */ + class StructedOutputAnnotation implements IStructedOutputAnnotation { + + /** + * Constructs a new StructedOutputAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse.IStructedOutputAnnotation); + + /** StructedOutputAnnotation annotation. */ + public annotation?: (google.protobuf.IStruct|null); + + /** + * Creates a new StructedOutputAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns StructedOutputAnnotation instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse.IStructedOutputAnnotation): google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse.StructedOutputAnnotation; + + /** + * Encodes the specified StructedOutputAnnotation message. Does not implicitly {@link google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse.StructedOutputAnnotation.verify|verify} messages. + * @param message StructedOutputAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse.IStructedOutputAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StructedOutputAnnotation message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse.StructedOutputAnnotation.verify|verify} messages. + * @param message StructedOutputAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse.IStructedOutputAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StructedOutputAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StructedOutputAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse.StructedOutputAnnotation; + + /** + * Decodes a StructedOutputAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StructedOutputAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse.StructedOutputAnnotation; + + /** + * Verifies a StructedOutputAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StructedOutputAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StructedOutputAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse.StructedOutputAnnotation; + + /** + * Creates a plain object from a StructedOutputAnnotation message. Also converts values to other types if specified. + * @param message StructedOutputAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse.StructedOutputAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StructedOutputAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StructedOutputAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an AppPlatformEventBody. */ + interface IAppPlatformEventBody { + + /** AppPlatformEventBody eventMessage */ + eventMessage?: (string|null); + + /** AppPlatformEventBody payload */ + payload?: (google.protobuf.IStruct|null); + + /** AppPlatformEventBody eventId */ + eventId?: (string|null); + } + + /** Represents an AppPlatformEventBody. */ + class AppPlatformEventBody implements IAppPlatformEventBody { + + /** + * Constructs a new AppPlatformEventBody. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IAppPlatformEventBody); + + /** AppPlatformEventBody eventMessage. */ + public eventMessage: string; + + /** AppPlatformEventBody payload. */ + public payload?: (google.protobuf.IStruct|null); + + /** AppPlatformEventBody eventId. */ + public eventId: string; + + /** + * Creates a new AppPlatformEventBody instance using the specified properties. + * @param [properties] Properties to set + * @returns AppPlatformEventBody instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IAppPlatformEventBody): google.cloud.visionai.v1alpha1.AppPlatformEventBody; + + /** + * Encodes the specified AppPlatformEventBody message. Does not implicitly {@link google.cloud.visionai.v1alpha1.AppPlatformEventBody.verify|verify} messages. + * @param message AppPlatformEventBody message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IAppPlatformEventBody, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AppPlatformEventBody message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.AppPlatformEventBody.verify|verify} messages. + * @param message AppPlatformEventBody message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IAppPlatformEventBody, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AppPlatformEventBody message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AppPlatformEventBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.AppPlatformEventBody; + + /** + * Decodes an AppPlatformEventBody message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AppPlatformEventBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.AppPlatformEventBody; + + /** + * Verifies an AppPlatformEventBody message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AppPlatformEventBody message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AppPlatformEventBody + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.AppPlatformEventBody; + + /** + * Creates a plain object from an AppPlatformEventBody message. Also converts values to other types if specified. + * @param message AppPlatformEventBody + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.AppPlatformEventBody, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AppPlatformEventBody to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AppPlatformEventBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Cluster. */ + interface ICluster { + + /** Cluster name */ + name?: (string|null); + + /** Cluster createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Cluster updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Cluster labels */ + labels?: ({ [k: string]: string }|null); + + /** Cluster annotations */ + annotations?: ({ [k: string]: string }|null); + + /** Cluster dataplaneServiceEndpoint */ + dataplaneServiceEndpoint?: (string|null); + + /** Cluster state */ + state?: (google.cloud.visionai.v1alpha1.Cluster.State|keyof typeof google.cloud.visionai.v1alpha1.Cluster.State|null); + + /** Cluster pscTarget */ + pscTarget?: (string|null); + } + + /** Represents a Cluster. */ + class Cluster implements ICluster { + + /** + * Constructs a new Cluster. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.ICluster); + + /** Cluster name. */ + public name: string; + + /** Cluster createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Cluster updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Cluster labels. */ + public labels: { [k: string]: string }; + + /** Cluster annotations. */ + public annotations: { [k: string]: string }; + + /** Cluster dataplaneServiceEndpoint. */ + public dataplaneServiceEndpoint: string; + + /** Cluster state. */ + public state: (google.cloud.visionai.v1alpha1.Cluster.State|keyof typeof google.cloud.visionai.v1alpha1.Cluster.State); + + /** Cluster pscTarget. */ + public pscTarget: string; + + /** + * Creates a new Cluster instance using the specified properties. + * @param [properties] Properties to set + * @returns Cluster instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.ICluster): google.cloud.visionai.v1alpha1.Cluster; + + /** + * Encodes the specified Cluster message. Does not implicitly {@link google.cloud.visionai.v1alpha1.Cluster.verify|verify} messages. + * @param message Cluster message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.ICluster, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Cluster message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.Cluster.verify|verify} messages. + * @param message Cluster message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.ICluster, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Cluster message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Cluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.Cluster; + + /** + * Decodes a Cluster message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Cluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.Cluster; + + /** + * Verifies a Cluster message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Cluster message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Cluster + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.Cluster; + + /** + * Creates a plain object from a Cluster message. Also converts values to other types if specified. + * @param message Cluster + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.Cluster, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Cluster to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Cluster + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Cluster { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + PROVISIONING = 1, + RUNNING = 2, + STOPPING = 3, + ERROR = 4 + } + } + + /** Properties of an OperationMetadata. */ + interface IOperationMetadata { + + /** OperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target */ + target?: (string|null); + + /** OperationMetadata verb */ + verb?: (string|null); + + /** OperationMetadata statusMessage */ + statusMessage?: (string|null); + + /** OperationMetadata requestedCancellation */ + requestedCancellation?: (boolean|null); + + /** OperationMetadata apiVersion */ + apiVersion?: (string|null); + } + + /** Represents an OperationMetadata. */ + class OperationMetadata implements IOperationMetadata { + + /** + * Constructs a new OperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IOperationMetadata); + + /** OperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target. */ + public target: string; + + /** OperationMetadata verb. */ + public verb: string; + + /** OperationMetadata statusMessage. */ + public statusMessage: string; + + /** OperationMetadata requestedCancellation. */ + public requestedCancellation: boolean; + + /** OperationMetadata apiVersion. */ + public apiVersion: string; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationMetadata instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IOperationMetadata): google.cloud.visionai.v1alpha1.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.visionai.v1alpha1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.OperationMetadata; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.OperationMetadata; + + /** + * Verifies an OperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.OperationMetadata; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @param message OperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GcsSource. */ + interface IGcsSource { + + /** GcsSource uris */ + uris?: (string[]|null); + } + + /** Represents a GcsSource. */ + class GcsSource implements IGcsSource { + + /** + * Constructs a new GcsSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IGcsSource); + + /** GcsSource uris. */ + public uris: string[]; + + /** + * Creates a new GcsSource instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsSource instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IGcsSource): google.cloud.visionai.v1alpha1.GcsSource; + + /** + * Encodes the specified GcsSource message. Does not implicitly {@link google.cloud.visionai.v1alpha1.GcsSource.verify|verify} messages. + * @param message GcsSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IGcsSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsSource message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.GcsSource.verify|verify} messages. + * @param message GcsSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IGcsSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcsSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcsSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.GcsSource; + + /** + * Decodes a GcsSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcsSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.GcsSource; + + /** + * Verifies a GcsSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GcsSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcsSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.GcsSource; + + /** + * Creates a plain object from a GcsSource message. Also converts values to other types if specified. + * @param message GcsSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.GcsSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcsSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AttributeValue. */ + interface IAttributeValue { + + /** AttributeValue i */ + i?: (number|Long|string|null); + + /** AttributeValue f */ + f?: (number|null); + + /** AttributeValue b */ + b?: (boolean|null); + + /** AttributeValue s */ + s?: (Uint8Array|Buffer|string|null); + } + + /** Represents an AttributeValue. */ + class AttributeValue implements IAttributeValue { + + /** + * Constructs a new AttributeValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IAttributeValue); + + /** AttributeValue i. */ + public i?: (number|Long|string|null); + + /** AttributeValue f. */ + public f?: (number|null); + + /** AttributeValue b. */ + public b?: (boolean|null); + + /** AttributeValue s. */ + public s?: (Uint8Array|Buffer|string|null); + + /** AttributeValue value. */ + public value?: ("i"|"f"|"b"|"s"); + + /** + * Creates a new AttributeValue instance using the specified properties. + * @param [properties] Properties to set + * @returns AttributeValue instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IAttributeValue): google.cloud.visionai.v1alpha1.AttributeValue; + + /** + * Encodes the specified AttributeValue message. Does not implicitly {@link google.cloud.visionai.v1alpha1.AttributeValue.verify|verify} messages. + * @param message AttributeValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IAttributeValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AttributeValue message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.AttributeValue.verify|verify} messages. + * @param message AttributeValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IAttributeValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AttributeValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AttributeValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.AttributeValue; + + /** + * Decodes an AttributeValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AttributeValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.AttributeValue; + + /** + * Verifies an AttributeValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AttributeValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AttributeValue + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.AttributeValue; + + /** + * Creates a plain object from an AttributeValue message. Also converts values to other types if specified. + * @param message AttributeValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.AttributeValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AttributeValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AttributeValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AnalyzerDefinition. */ + interface IAnalyzerDefinition { + + /** AnalyzerDefinition analyzer */ + analyzer?: (string|null); + + /** AnalyzerDefinition operator */ + operator?: (string|null); + + /** AnalyzerDefinition inputs */ + inputs?: (google.cloud.visionai.v1alpha1.AnalyzerDefinition.IStreamInput[]|null); + + /** AnalyzerDefinition attrs */ + attrs?: ({ [k: string]: google.cloud.visionai.v1alpha1.IAttributeValue }|null); + + /** AnalyzerDefinition debugOptions */ + debugOptions?: (google.cloud.visionai.v1alpha1.AnalyzerDefinition.IDebugOptions|null); + } + + /** Represents an AnalyzerDefinition. */ + class AnalyzerDefinition implements IAnalyzerDefinition { + + /** + * Constructs a new AnalyzerDefinition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IAnalyzerDefinition); + + /** AnalyzerDefinition analyzer. */ + public analyzer: string; + + /** AnalyzerDefinition operator. */ + public operator: string; + + /** AnalyzerDefinition inputs. */ + public inputs: google.cloud.visionai.v1alpha1.AnalyzerDefinition.IStreamInput[]; + + /** AnalyzerDefinition attrs. */ + public attrs: { [k: string]: google.cloud.visionai.v1alpha1.IAttributeValue }; + + /** AnalyzerDefinition debugOptions. */ + public debugOptions?: (google.cloud.visionai.v1alpha1.AnalyzerDefinition.IDebugOptions|null); + + /** + * Creates a new AnalyzerDefinition instance using the specified properties. + * @param [properties] Properties to set + * @returns AnalyzerDefinition instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IAnalyzerDefinition): google.cloud.visionai.v1alpha1.AnalyzerDefinition; + + /** + * Encodes the specified AnalyzerDefinition message. Does not implicitly {@link google.cloud.visionai.v1alpha1.AnalyzerDefinition.verify|verify} messages. + * @param message AnalyzerDefinition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IAnalyzerDefinition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnalyzerDefinition message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.AnalyzerDefinition.verify|verify} messages. + * @param message AnalyzerDefinition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IAnalyzerDefinition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnalyzerDefinition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnalyzerDefinition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.AnalyzerDefinition; + + /** + * Decodes an AnalyzerDefinition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnalyzerDefinition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.AnalyzerDefinition; + + /** + * Verifies an AnalyzerDefinition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AnalyzerDefinition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnalyzerDefinition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.AnalyzerDefinition; + + /** + * Creates a plain object from an AnalyzerDefinition message. Also converts values to other types if specified. + * @param message AnalyzerDefinition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.AnalyzerDefinition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnalyzerDefinition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnalyzerDefinition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AnalyzerDefinition { + + /** Properties of a StreamInput. */ + interface IStreamInput { + + /** StreamInput input */ + input?: (string|null); + } + + /** Represents a StreamInput. */ + class StreamInput implements IStreamInput { + + /** + * Constructs a new StreamInput. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.AnalyzerDefinition.IStreamInput); + + /** StreamInput input. */ + public input: string; + + /** + * Creates a new StreamInput instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamInput instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.AnalyzerDefinition.IStreamInput): google.cloud.visionai.v1alpha1.AnalyzerDefinition.StreamInput; + + /** + * Encodes the specified StreamInput message. Does not implicitly {@link google.cloud.visionai.v1alpha1.AnalyzerDefinition.StreamInput.verify|verify} messages. + * @param message StreamInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.AnalyzerDefinition.IStreamInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamInput message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.AnalyzerDefinition.StreamInput.verify|verify} messages. + * @param message StreamInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.AnalyzerDefinition.IStreamInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamInput message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.AnalyzerDefinition.StreamInput; + + /** + * Decodes a StreamInput message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.AnalyzerDefinition.StreamInput; + + /** + * Verifies a StreamInput message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamInput message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamInput + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.AnalyzerDefinition.StreamInput; + + /** + * Creates a plain object from a StreamInput message. Also converts values to other types if specified. + * @param message StreamInput + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.AnalyzerDefinition.StreamInput, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamInput to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamInput + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DebugOptions. */ + interface IDebugOptions { + + /** DebugOptions environmentVariables */ + environmentVariables?: ({ [k: string]: string }|null); + } + + /** Represents a DebugOptions. */ + class DebugOptions implements IDebugOptions { + + /** + * Constructs a new DebugOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.AnalyzerDefinition.IDebugOptions); + + /** DebugOptions environmentVariables. */ + public environmentVariables: { [k: string]: string }; + + /** + * Creates a new DebugOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns DebugOptions instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.AnalyzerDefinition.IDebugOptions): google.cloud.visionai.v1alpha1.AnalyzerDefinition.DebugOptions; + + /** + * Encodes the specified DebugOptions message. Does not implicitly {@link google.cloud.visionai.v1alpha1.AnalyzerDefinition.DebugOptions.verify|verify} messages. + * @param message DebugOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.AnalyzerDefinition.IDebugOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DebugOptions message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.AnalyzerDefinition.DebugOptions.verify|verify} messages. + * @param message DebugOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.AnalyzerDefinition.IDebugOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DebugOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DebugOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.AnalyzerDefinition.DebugOptions; + + /** + * Decodes a DebugOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DebugOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.AnalyzerDefinition.DebugOptions; + + /** + * Verifies a DebugOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DebugOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DebugOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.AnalyzerDefinition.DebugOptions; + + /** + * Creates a plain object from a DebugOptions message. Also converts values to other types if specified. + * @param message DebugOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.AnalyzerDefinition.DebugOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DebugOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DebugOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an AnalysisDefinition. */ + interface IAnalysisDefinition { + + /** AnalysisDefinition analyzers */ + analyzers?: (google.cloud.visionai.v1alpha1.IAnalyzerDefinition[]|null); + } + + /** Represents an AnalysisDefinition. */ + class AnalysisDefinition implements IAnalysisDefinition { + + /** + * Constructs a new AnalysisDefinition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IAnalysisDefinition); + + /** AnalysisDefinition analyzers. */ + public analyzers: google.cloud.visionai.v1alpha1.IAnalyzerDefinition[]; + + /** + * Creates a new AnalysisDefinition instance using the specified properties. + * @param [properties] Properties to set + * @returns AnalysisDefinition instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IAnalysisDefinition): google.cloud.visionai.v1alpha1.AnalysisDefinition; + + /** + * Encodes the specified AnalysisDefinition message. Does not implicitly {@link google.cloud.visionai.v1alpha1.AnalysisDefinition.verify|verify} messages. + * @param message AnalysisDefinition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IAnalysisDefinition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnalysisDefinition message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.AnalysisDefinition.verify|verify} messages. + * @param message AnalysisDefinition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IAnalysisDefinition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnalysisDefinition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnalysisDefinition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.AnalysisDefinition; + + /** + * Decodes an AnalysisDefinition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnalysisDefinition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.AnalysisDefinition; + + /** + * Verifies an AnalysisDefinition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AnalysisDefinition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnalysisDefinition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.AnalysisDefinition; + + /** + * Creates a plain object from an AnalysisDefinition message. Also converts values to other types if specified. + * @param message AnalysisDefinition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.AnalysisDefinition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnalysisDefinition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnalysisDefinition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Analysis. */ + interface IAnalysis { + + /** Analysis name */ + name?: (string|null); + + /** Analysis createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Analysis updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Analysis labels */ + labels?: ({ [k: string]: string }|null); + + /** Analysis analysisDefinition */ + analysisDefinition?: (google.cloud.visionai.v1alpha1.IAnalysisDefinition|null); + + /** Analysis inputStreamsMapping */ + inputStreamsMapping?: ({ [k: string]: string }|null); + + /** Analysis outputStreamsMapping */ + outputStreamsMapping?: ({ [k: string]: string }|null); + } + + /** Represents an Analysis. */ + class Analysis implements IAnalysis { + + /** + * Constructs a new Analysis. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IAnalysis); + + /** Analysis name. */ + public name: string; + + /** Analysis createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Analysis updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Analysis labels. */ + public labels: { [k: string]: string }; + + /** Analysis analysisDefinition. */ + public analysisDefinition?: (google.cloud.visionai.v1alpha1.IAnalysisDefinition|null); + + /** Analysis inputStreamsMapping. */ + public inputStreamsMapping: { [k: string]: string }; + + /** Analysis outputStreamsMapping. */ + public outputStreamsMapping: { [k: string]: string }; + + /** + * Creates a new Analysis instance using the specified properties. + * @param [properties] Properties to set + * @returns Analysis instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IAnalysis): google.cloud.visionai.v1alpha1.Analysis; + + /** + * Encodes the specified Analysis message. Does not implicitly {@link google.cloud.visionai.v1alpha1.Analysis.verify|verify} messages. + * @param message Analysis message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IAnalysis, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Analysis message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.Analysis.verify|verify} messages. + * @param message Analysis message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IAnalysis, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Analysis message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Analysis + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.Analysis; + + /** + * Decodes an Analysis message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Analysis + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.Analysis; + + /** + * Verifies an Analysis message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Analysis message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Analysis + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.Analysis; + + /** + * Creates a plain object from an Analysis message. Also converts values to other types if specified. + * @param message Analysis + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.Analysis, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Analysis to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Analysis + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a LiveVideoAnalytics */ + class LiveVideoAnalytics extends $protobuf.rpc.Service { + + /** + * Constructs a new LiveVideoAnalytics service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new LiveVideoAnalytics service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): LiveVideoAnalytics; + + /** + * Calls ListAnalyses. + * @param request ListAnalysesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAnalysesResponse + */ + public listAnalyses(request: google.cloud.visionai.v1alpha1.IListAnalysesRequest, callback: google.cloud.visionai.v1alpha1.LiveVideoAnalytics.ListAnalysesCallback): void; + + /** + * Calls ListAnalyses. + * @param request ListAnalysesRequest message or plain object + * @returns Promise + */ + public listAnalyses(request: google.cloud.visionai.v1alpha1.IListAnalysesRequest): Promise; + + /** + * Calls GetAnalysis. + * @param request GetAnalysisRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Analysis + */ + public getAnalysis(request: google.cloud.visionai.v1alpha1.IGetAnalysisRequest, callback: google.cloud.visionai.v1alpha1.LiveVideoAnalytics.GetAnalysisCallback): void; + + /** + * Calls GetAnalysis. + * @param request GetAnalysisRequest message or plain object + * @returns Promise + */ + public getAnalysis(request: google.cloud.visionai.v1alpha1.IGetAnalysisRequest): Promise; + + /** + * Calls CreateAnalysis. + * @param request CreateAnalysisRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createAnalysis(request: google.cloud.visionai.v1alpha1.ICreateAnalysisRequest, callback: google.cloud.visionai.v1alpha1.LiveVideoAnalytics.CreateAnalysisCallback): void; + + /** + * Calls CreateAnalysis. + * @param request CreateAnalysisRequest message or plain object + * @returns Promise + */ + public createAnalysis(request: google.cloud.visionai.v1alpha1.ICreateAnalysisRequest): Promise; + + /** + * Calls UpdateAnalysis. + * @param request UpdateAnalysisRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateAnalysis(request: google.cloud.visionai.v1alpha1.IUpdateAnalysisRequest, callback: google.cloud.visionai.v1alpha1.LiveVideoAnalytics.UpdateAnalysisCallback): void; + + /** + * Calls UpdateAnalysis. + * @param request UpdateAnalysisRequest message or plain object + * @returns Promise + */ + public updateAnalysis(request: google.cloud.visionai.v1alpha1.IUpdateAnalysisRequest): Promise; + + /** + * Calls DeleteAnalysis. + * @param request DeleteAnalysisRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteAnalysis(request: google.cloud.visionai.v1alpha1.IDeleteAnalysisRequest, callback: google.cloud.visionai.v1alpha1.LiveVideoAnalytics.DeleteAnalysisCallback): void; + + /** + * Calls DeleteAnalysis. + * @param request DeleteAnalysisRequest message or plain object + * @returns Promise + */ + public deleteAnalysis(request: google.cloud.visionai.v1alpha1.IDeleteAnalysisRequest): Promise; + } + + namespace LiveVideoAnalytics { + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.LiveVideoAnalytics|listAnalyses}. + * @param error Error, if any + * @param [response] ListAnalysesResponse + */ + type ListAnalysesCallback = (error: (Error|null), response?: google.cloud.visionai.v1alpha1.ListAnalysesResponse) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.LiveVideoAnalytics|getAnalysis}. + * @param error Error, if any + * @param [response] Analysis + */ + type GetAnalysisCallback = (error: (Error|null), response?: google.cloud.visionai.v1alpha1.Analysis) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.LiveVideoAnalytics|createAnalysis}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateAnalysisCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.LiveVideoAnalytics|updateAnalysis}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateAnalysisCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.LiveVideoAnalytics|deleteAnalysis}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteAnalysisCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a ListAnalysesRequest. */ + interface IListAnalysesRequest { + + /** ListAnalysesRequest parent */ + parent?: (string|null); + + /** ListAnalysesRequest pageSize */ + pageSize?: (number|null); + + /** ListAnalysesRequest pageToken */ + pageToken?: (string|null); + + /** ListAnalysesRequest filter */ + filter?: (string|null); + + /** ListAnalysesRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListAnalysesRequest. */ + class ListAnalysesRequest implements IListAnalysesRequest { + + /** + * Constructs a new ListAnalysesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IListAnalysesRequest); + + /** ListAnalysesRequest parent. */ + public parent: string; + + /** ListAnalysesRequest pageSize. */ + public pageSize: number; + + /** ListAnalysesRequest pageToken. */ + public pageToken: string; + + /** ListAnalysesRequest filter. */ + public filter: string; + + /** ListAnalysesRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListAnalysesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAnalysesRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IListAnalysesRequest): google.cloud.visionai.v1alpha1.ListAnalysesRequest; + + /** + * Encodes the specified ListAnalysesRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListAnalysesRequest.verify|verify} messages. + * @param message ListAnalysesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IListAnalysesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAnalysesRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListAnalysesRequest.verify|verify} messages. + * @param message ListAnalysesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IListAnalysesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAnalysesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAnalysesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ListAnalysesRequest; + + /** + * Decodes a ListAnalysesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAnalysesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ListAnalysesRequest; + + /** + * Verifies a ListAnalysesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAnalysesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAnalysesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ListAnalysesRequest; + + /** + * Creates a plain object from a ListAnalysesRequest message. Also converts values to other types if specified. + * @param message ListAnalysesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ListAnalysesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAnalysesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAnalysesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAnalysesResponse. */ + interface IListAnalysesResponse { + + /** ListAnalysesResponse analyses */ + analyses?: (google.cloud.visionai.v1alpha1.IAnalysis[]|null); + + /** ListAnalysesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListAnalysesResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListAnalysesResponse. */ + class ListAnalysesResponse implements IListAnalysesResponse { + + /** + * Constructs a new ListAnalysesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IListAnalysesResponse); + + /** ListAnalysesResponse analyses. */ + public analyses: google.cloud.visionai.v1alpha1.IAnalysis[]; + + /** ListAnalysesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListAnalysesResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListAnalysesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAnalysesResponse instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IListAnalysesResponse): google.cloud.visionai.v1alpha1.ListAnalysesResponse; + + /** + * Encodes the specified ListAnalysesResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListAnalysesResponse.verify|verify} messages. + * @param message ListAnalysesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IListAnalysesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAnalysesResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListAnalysesResponse.verify|verify} messages. + * @param message ListAnalysesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IListAnalysesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAnalysesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAnalysesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ListAnalysesResponse; + + /** + * Decodes a ListAnalysesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAnalysesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ListAnalysesResponse; + + /** + * Verifies a ListAnalysesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAnalysesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAnalysesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ListAnalysesResponse; + + /** + * Creates a plain object from a ListAnalysesResponse message. Also converts values to other types if specified. + * @param message ListAnalysesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ListAnalysesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAnalysesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAnalysesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetAnalysisRequest. */ + interface IGetAnalysisRequest { + + /** GetAnalysisRequest name */ + name?: (string|null); + } + + /** Represents a GetAnalysisRequest. */ + class GetAnalysisRequest implements IGetAnalysisRequest { + + /** + * Constructs a new GetAnalysisRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IGetAnalysisRequest); + + /** GetAnalysisRequest name. */ + public name: string; + + /** + * Creates a new GetAnalysisRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetAnalysisRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IGetAnalysisRequest): google.cloud.visionai.v1alpha1.GetAnalysisRequest; + + /** + * Encodes the specified GetAnalysisRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetAnalysisRequest.verify|verify} messages. + * @param message GetAnalysisRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IGetAnalysisRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetAnalysisRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetAnalysisRequest.verify|verify} messages. + * @param message GetAnalysisRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IGetAnalysisRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetAnalysisRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetAnalysisRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.GetAnalysisRequest; + + /** + * Decodes a GetAnalysisRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetAnalysisRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.GetAnalysisRequest; + + /** + * Verifies a GetAnalysisRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetAnalysisRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetAnalysisRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.GetAnalysisRequest; + + /** + * Creates a plain object from a GetAnalysisRequest message. Also converts values to other types if specified. + * @param message GetAnalysisRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.GetAnalysisRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetAnalysisRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetAnalysisRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateAnalysisRequest. */ + interface ICreateAnalysisRequest { + + /** CreateAnalysisRequest parent */ + parent?: (string|null); + + /** CreateAnalysisRequest analysisId */ + analysisId?: (string|null); + + /** CreateAnalysisRequest analysis */ + analysis?: (google.cloud.visionai.v1alpha1.IAnalysis|null); + + /** CreateAnalysisRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateAnalysisRequest. */ + class CreateAnalysisRequest implements ICreateAnalysisRequest { + + /** + * Constructs a new CreateAnalysisRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.ICreateAnalysisRequest); + + /** CreateAnalysisRequest parent. */ + public parent: string; + + /** CreateAnalysisRequest analysisId. */ + public analysisId: string; + + /** CreateAnalysisRequest analysis. */ + public analysis?: (google.cloud.visionai.v1alpha1.IAnalysis|null); + + /** CreateAnalysisRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateAnalysisRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateAnalysisRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.ICreateAnalysisRequest): google.cloud.visionai.v1alpha1.CreateAnalysisRequest; + + /** + * Encodes the specified CreateAnalysisRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateAnalysisRequest.verify|verify} messages. + * @param message CreateAnalysisRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.ICreateAnalysisRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateAnalysisRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateAnalysisRequest.verify|verify} messages. + * @param message CreateAnalysisRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.ICreateAnalysisRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateAnalysisRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateAnalysisRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.CreateAnalysisRequest; + + /** + * Decodes a CreateAnalysisRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateAnalysisRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.CreateAnalysisRequest; + + /** + * Verifies a CreateAnalysisRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateAnalysisRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateAnalysisRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.CreateAnalysisRequest; + + /** + * Creates a plain object from a CreateAnalysisRequest message. Also converts values to other types if specified. + * @param message CreateAnalysisRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.CreateAnalysisRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateAnalysisRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateAnalysisRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateAnalysisRequest. */ + interface IUpdateAnalysisRequest { + + /** UpdateAnalysisRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateAnalysisRequest analysis */ + analysis?: (google.cloud.visionai.v1alpha1.IAnalysis|null); + + /** UpdateAnalysisRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateAnalysisRequest. */ + class UpdateAnalysisRequest implements IUpdateAnalysisRequest { + + /** + * Constructs a new UpdateAnalysisRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IUpdateAnalysisRequest); + + /** UpdateAnalysisRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateAnalysisRequest analysis. */ + public analysis?: (google.cloud.visionai.v1alpha1.IAnalysis|null); + + /** UpdateAnalysisRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpdateAnalysisRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateAnalysisRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IUpdateAnalysisRequest): google.cloud.visionai.v1alpha1.UpdateAnalysisRequest; + + /** + * Encodes the specified UpdateAnalysisRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateAnalysisRequest.verify|verify} messages. + * @param message UpdateAnalysisRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IUpdateAnalysisRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateAnalysisRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateAnalysisRequest.verify|verify} messages. + * @param message UpdateAnalysisRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IUpdateAnalysisRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateAnalysisRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateAnalysisRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.UpdateAnalysisRequest; + + /** + * Decodes an UpdateAnalysisRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateAnalysisRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.UpdateAnalysisRequest; + + /** + * Verifies an UpdateAnalysisRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateAnalysisRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateAnalysisRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.UpdateAnalysisRequest; + + /** + * Creates a plain object from an UpdateAnalysisRequest message. Also converts values to other types if specified. + * @param message UpdateAnalysisRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.UpdateAnalysisRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateAnalysisRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateAnalysisRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteAnalysisRequest. */ + interface IDeleteAnalysisRequest { + + /** DeleteAnalysisRequest name */ + name?: (string|null); + + /** DeleteAnalysisRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteAnalysisRequest. */ + class DeleteAnalysisRequest implements IDeleteAnalysisRequest { + + /** + * Constructs a new DeleteAnalysisRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IDeleteAnalysisRequest); + + /** DeleteAnalysisRequest name. */ + public name: string; + + /** DeleteAnalysisRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteAnalysisRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteAnalysisRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IDeleteAnalysisRequest): google.cloud.visionai.v1alpha1.DeleteAnalysisRequest; + + /** + * Encodes the specified DeleteAnalysisRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteAnalysisRequest.verify|verify} messages. + * @param message DeleteAnalysisRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IDeleteAnalysisRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteAnalysisRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteAnalysisRequest.verify|verify} messages. + * @param message DeleteAnalysisRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IDeleteAnalysisRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteAnalysisRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteAnalysisRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.DeleteAnalysisRequest; + + /** + * Decodes a DeleteAnalysisRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteAnalysisRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.DeleteAnalysisRequest; + + /** + * Verifies a DeleteAnalysisRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteAnalysisRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteAnalysisRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.DeleteAnalysisRequest; + + /** + * Creates a plain object from a DeleteAnalysisRequest message. Also converts values to other types if specified. + * @param message DeleteAnalysisRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.DeleteAnalysisRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteAnalysisRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteAnalysisRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents an AppPlatform */ + class AppPlatform extends $protobuf.rpc.Service { + + /** + * Constructs a new AppPlatform service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new AppPlatform service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): AppPlatform; + + /** + * Calls ListApplications. + * @param request ListApplicationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListApplicationsResponse + */ + public listApplications(request: google.cloud.visionai.v1alpha1.IListApplicationsRequest, callback: google.cloud.visionai.v1alpha1.AppPlatform.ListApplicationsCallback): void; + + /** + * Calls ListApplications. + * @param request ListApplicationsRequest message or plain object + * @returns Promise + */ + public listApplications(request: google.cloud.visionai.v1alpha1.IListApplicationsRequest): Promise; + + /** + * Calls GetApplication. + * @param request GetApplicationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Application + */ + public getApplication(request: google.cloud.visionai.v1alpha1.IGetApplicationRequest, callback: google.cloud.visionai.v1alpha1.AppPlatform.GetApplicationCallback): void; + + /** + * Calls GetApplication. + * @param request GetApplicationRequest message or plain object + * @returns Promise + */ + public getApplication(request: google.cloud.visionai.v1alpha1.IGetApplicationRequest): Promise; + + /** + * Calls CreateApplication. + * @param request CreateApplicationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createApplication(request: google.cloud.visionai.v1alpha1.ICreateApplicationRequest, callback: google.cloud.visionai.v1alpha1.AppPlatform.CreateApplicationCallback): void; + + /** + * Calls CreateApplication. + * @param request CreateApplicationRequest message or plain object + * @returns Promise + */ + public createApplication(request: google.cloud.visionai.v1alpha1.ICreateApplicationRequest): Promise; + + /** + * Calls UpdateApplication. + * @param request UpdateApplicationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateApplication(request: google.cloud.visionai.v1alpha1.IUpdateApplicationRequest, callback: google.cloud.visionai.v1alpha1.AppPlatform.UpdateApplicationCallback): void; + + /** + * Calls UpdateApplication. + * @param request UpdateApplicationRequest message or plain object + * @returns Promise + */ + public updateApplication(request: google.cloud.visionai.v1alpha1.IUpdateApplicationRequest): Promise; + + /** + * Calls DeleteApplication. + * @param request DeleteApplicationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteApplication(request: google.cloud.visionai.v1alpha1.IDeleteApplicationRequest, callback: google.cloud.visionai.v1alpha1.AppPlatform.DeleteApplicationCallback): void; + + /** + * Calls DeleteApplication. + * @param request DeleteApplicationRequest message or plain object + * @returns Promise + */ + public deleteApplication(request: google.cloud.visionai.v1alpha1.IDeleteApplicationRequest): Promise; + + /** + * Calls DeployApplication. + * @param request DeployApplicationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deployApplication(request: google.cloud.visionai.v1alpha1.IDeployApplicationRequest, callback: google.cloud.visionai.v1alpha1.AppPlatform.DeployApplicationCallback): void; + + /** + * Calls DeployApplication. + * @param request DeployApplicationRequest message or plain object + * @returns Promise + */ + public deployApplication(request: google.cloud.visionai.v1alpha1.IDeployApplicationRequest): Promise; + + /** + * Calls UndeployApplication. + * @param request UndeployApplicationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public undeployApplication(request: google.cloud.visionai.v1alpha1.IUndeployApplicationRequest, callback: google.cloud.visionai.v1alpha1.AppPlatform.UndeployApplicationCallback): void; + + /** + * Calls UndeployApplication. + * @param request UndeployApplicationRequest message or plain object + * @returns Promise + */ + public undeployApplication(request: google.cloud.visionai.v1alpha1.IUndeployApplicationRequest): Promise; + + /** + * Calls AddApplicationStreamInput. + * @param request AddApplicationStreamInputRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public addApplicationStreamInput(request: google.cloud.visionai.v1alpha1.IAddApplicationStreamInputRequest, callback: google.cloud.visionai.v1alpha1.AppPlatform.AddApplicationStreamInputCallback): void; + + /** + * Calls AddApplicationStreamInput. + * @param request AddApplicationStreamInputRequest message or plain object + * @returns Promise + */ + public addApplicationStreamInput(request: google.cloud.visionai.v1alpha1.IAddApplicationStreamInputRequest): Promise; + + /** + * Calls RemoveApplicationStreamInput. + * @param request RemoveApplicationStreamInputRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public removeApplicationStreamInput(request: google.cloud.visionai.v1alpha1.IRemoveApplicationStreamInputRequest, callback: google.cloud.visionai.v1alpha1.AppPlatform.RemoveApplicationStreamInputCallback): void; + + /** + * Calls RemoveApplicationStreamInput. + * @param request RemoveApplicationStreamInputRequest message or plain object + * @returns Promise + */ + public removeApplicationStreamInput(request: google.cloud.visionai.v1alpha1.IRemoveApplicationStreamInputRequest): Promise; + + /** + * Calls UpdateApplicationStreamInput. + * @param request UpdateApplicationStreamInputRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateApplicationStreamInput(request: google.cloud.visionai.v1alpha1.IUpdateApplicationStreamInputRequest, callback: google.cloud.visionai.v1alpha1.AppPlatform.UpdateApplicationStreamInputCallback): void; + + /** + * Calls UpdateApplicationStreamInput. + * @param request UpdateApplicationStreamInputRequest message or plain object + * @returns Promise + */ + public updateApplicationStreamInput(request: google.cloud.visionai.v1alpha1.IUpdateApplicationStreamInputRequest): Promise; + + /** + * Calls ListInstances. + * @param request ListInstancesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListInstancesResponse + */ + public listInstances(request: google.cloud.visionai.v1alpha1.IListInstancesRequest, callback: google.cloud.visionai.v1alpha1.AppPlatform.ListInstancesCallback): void; + + /** + * Calls ListInstances. + * @param request ListInstancesRequest message or plain object + * @returns Promise + */ + public listInstances(request: google.cloud.visionai.v1alpha1.IListInstancesRequest): Promise; + + /** + * Calls GetInstance. + * @param request GetInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Instance + */ + public getInstance(request: google.cloud.visionai.v1alpha1.IGetInstanceRequest, callback: google.cloud.visionai.v1alpha1.AppPlatform.GetInstanceCallback): void; + + /** + * Calls GetInstance. + * @param request GetInstanceRequest message or plain object + * @returns Promise + */ + public getInstance(request: google.cloud.visionai.v1alpha1.IGetInstanceRequest): Promise; + + /** + * Calls CreateApplicationInstances. + * @param request CreateApplicationInstancesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createApplicationInstances(request: google.cloud.visionai.v1alpha1.ICreateApplicationInstancesRequest, callback: google.cloud.visionai.v1alpha1.AppPlatform.CreateApplicationInstancesCallback): void; + + /** + * Calls CreateApplicationInstances. + * @param request CreateApplicationInstancesRequest message or plain object + * @returns Promise + */ + public createApplicationInstances(request: google.cloud.visionai.v1alpha1.ICreateApplicationInstancesRequest): Promise; + + /** + * Calls DeleteApplicationInstances. + * @param request DeleteApplicationInstancesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteApplicationInstances(request: google.cloud.visionai.v1alpha1.IDeleteApplicationInstancesRequest, callback: google.cloud.visionai.v1alpha1.AppPlatform.DeleteApplicationInstancesCallback): void; + + /** + * Calls DeleteApplicationInstances. + * @param request DeleteApplicationInstancesRequest message or plain object + * @returns Promise + */ + public deleteApplicationInstances(request: google.cloud.visionai.v1alpha1.IDeleteApplicationInstancesRequest): Promise; + + /** + * Calls UpdateApplicationInstances. + * @param request UpdateApplicationInstancesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateApplicationInstances(request: google.cloud.visionai.v1alpha1.IUpdateApplicationInstancesRequest, callback: google.cloud.visionai.v1alpha1.AppPlatform.UpdateApplicationInstancesCallback): void; + + /** + * Calls UpdateApplicationInstances. + * @param request UpdateApplicationInstancesRequest message or plain object + * @returns Promise + */ + public updateApplicationInstances(request: google.cloud.visionai.v1alpha1.IUpdateApplicationInstancesRequest): Promise; + + /** + * Calls ListDrafts. + * @param request ListDraftsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListDraftsResponse + */ + public listDrafts(request: google.cloud.visionai.v1alpha1.IListDraftsRequest, callback: google.cloud.visionai.v1alpha1.AppPlatform.ListDraftsCallback): void; + + /** + * Calls ListDrafts. + * @param request ListDraftsRequest message or plain object + * @returns Promise + */ + public listDrafts(request: google.cloud.visionai.v1alpha1.IListDraftsRequest): Promise; + + /** + * Calls GetDraft. + * @param request GetDraftRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Draft + */ + public getDraft(request: google.cloud.visionai.v1alpha1.IGetDraftRequest, callback: google.cloud.visionai.v1alpha1.AppPlatform.GetDraftCallback): void; + + /** + * Calls GetDraft. + * @param request GetDraftRequest message or plain object + * @returns Promise + */ + public getDraft(request: google.cloud.visionai.v1alpha1.IGetDraftRequest): Promise; + + /** + * Calls CreateDraft. + * @param request CreateDraftRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createDraft(request: google.cloud.visionai.v1alpha1.ICreateDraftRequest, callback: google.cloud.visionai.v1alpha1.AppPlatform.CreateDraftCallback): void; + + /** + * Calls CreateDraft. + * @param request CreateDraftRequest message or plain object + * @returns Promise + */ + public createDraft(request: google.cloud.visionai.v1alpha1.ICreateDraftRequest): Promise; + + /** + * Calls UpdateDraft. + * @param request UpdateDraftRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateDraft(request: google.cloud.visionai.v1alpha1.IUpdateDraftRequest, callback: google.cloud.visionai.v1alpha1.AppPlatform.UpdateDraftCallback): void; + + /** + * Calls UpdateDraft. + * @param request UpdateDraftRequest message or plain object + * @returns Promise + */ + public updateDraft(request: google.cloud.visionai.v1alpha1.IUpdateDraftRequest): Promise; + + /** + * Calls DeleteDraft. + * @param request DeleteDraftRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteDraft(request: google.cloud.visionai.v1alpha1.IDeleteDraftRequest, callback: google.cloud.visionai.v1alpha1.AppPlatform.DeleteDraftCallback): void; + + /** + * Calls DeleteDraft. + * @param request DeleteDraftRequest message or plain object + * @returns Promise + */ + public deleteDraft(request: google.cloud.visionai.v1alpha1.IDeleteDraftRequest): Promise; + + /** + * Calls ListProcessors. + * @param request ListProcessorsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListProcessorsResponse + */ + public listProcessors(request: google.cloud.visionai.v1alpha1.IListProcessorsRequest, callback: google.cloud.visionai.v1alpha1.AppPlatform.ListProcessorsCallback): void; + + /** + * Calls ListProcessors. + * @param request ListProcessorsRequest message or plain object + * @returns Promise + */ + public listProcessors(request: google.cloud.visionai.v1alpha1.IListProcessorsRequest): Promise; + + /** + * Calls ListPrebuiltProcessors. + * @param request ListPrebuiltProcessorsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListPrebuiltProcessorsResponse + */ + public listPrebuiltProcessors(request: google.cloud.visionai.v1alpha1.IListPrebuiltProcessorsRequest, callback: google.cloud.visionai.v1alpha1.AppPlatform.ListPrebuiltProcessorsCallback): void; + + /** + * Calls ListPrebuiltProcessors. + * @param request ListPrebuiltProcessorsRequest message or plain object + * @returns Promise + */ + public listPrebuiltProcessors(request: google.cloud.visionai.v1alpha1.IListPrebuiltProcessorsRequest): Promise; + + /** + * Calls GetProcessor. + * @param request GetProcessorRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Processor + */ + public getProcessor(request: google.cloud.visionai.v1alpha1.IGetProcessorRequest, callback: google.cloud.visionai.v1alpha1.AppPlatform.GetProcessorCallback): void; + + /** + * Calls GetProcessor. + * @param request GetProcessorRequest message or plain object + * @returns Promise + */ + public getProcessor(request: google.cloud.visionai.v1alpha1.IGetProcessorRequest): Promise; + + /** + * Calls CreateProcessor. + * @param request CreateProcessorRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createProcessor(request: google.cloud.visionai.v1alpha1.ICreateProcessorRequest, callback: google.cloud.visionai.v1alpha1.AppPlatform.CreateProcessorCallback): void; + + /** + * Calls CreateProcessor. + * @param request CreateProcessorRequest message or plain object + * @returns Promise + */ + public createProcessor(request: google.cloud.visionai.v1alpha1.ICreateProcessorRequest): Promise; + + /** + * Calls UpdateProcessor. + * @param request UpdateProcessorRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateProcessor(request: google.cloud.visionai.v1alpha1.IUpdateProcessorRequest, callback: google.cloud.visionai.v1alpha1.AppPlatform.UpdateProcessorCallback): void; + + /** + * Calls UpdateProcessor. + * @param request UpdateProcessorRequest message or plain object + * @returns Promise + */ + public updateProcessor(request: google.cloud.visionai.v1alpha1.IUpdateProcessorRequest): Promise; + + /** + * Calls DeleteProcessor. + * @param request DeleteProcessorRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteProcessor(request: google.cloud.visionai.v1alpha1.IDeleteProcessorRequest, callback: google.cloud.visionai.v1alpha1.AppPlatform.DeleteProcessorCallback): void; + + /** + * Calls DeleteProcessor. + * @param request DeleteProcessorRequest message or plain object + * @returns Promise + */ + public deleteProcessor(request: google.cloud.visionai.v1alpha1.IDeleteProcessorRequest): Promise; + } + + namespace AppPlatform { + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.AppPlatform|listApplications}. + * @param error Error, if any + * @param [response] ListApplicationsResponse + */ + type ListApplicationsCallback = (error: (Error|null), response?: google.cloud.visionai.v1alpha1.ListApplicationsResponse) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.AppPlatform|getApplication}. + * @param error Error, if any + * @param [response] Application + */ + type GetApplicationCallback = (error: (Error|null), response?: google.cloud.visionai.v1alpha1.Application) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.AppPlatform|createApplication}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateApplicationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.AppPlatform|updateApplication}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateApplicationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.AppPlatform|deleteApplication}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteApplicationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.AppPlatform|deployApplication}. + * @param error Error, if any + * @param [response] Operation + */ + type DeployApplicationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.AppPlatform|undeployApplication}. + * @param error Error, if any + * @param [response] Operation + */ + type UndeployApplicationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.AppPlatform|addApplicationStreamInput}. + * @param error Error, if any + * @param [response] Operation + */ + type AddApplicationStreamInputCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.AppPlatform|removeApplicationStreamInput}. + * @param error Error, if any + * @param [response] Operation + */ + type RemoveApplicationStreamInputCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.AppPlatform|updateApplicationStreamInput}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateApplicationStreamInputCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.AppPlatform|listInstances}. + * @param error Error, if any + * @param [response] ListInstancesResponse + */ + type ListInstancesCallback = (error: (Error|null), response?: google.cloud.visionai.v1alpha1.ListInstancesResponse) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.AppPlatform|getInstance}. + * @param error Error, if any + * @param [response] Instance + */ + type GetInstanceCallback = (error: (Error|null), response?: google.cloud.visionai.v1alpha1.Instance) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.AppPlatform|createApplicationInstances}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateApplicationInstancesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.AppPlatform|deleteApplicationInstances}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteApplicationInstancesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.AppPlatform|updateApplicationInstances}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateApplicationInstancesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.AppPlatform|listDrafts}. + * @param error Error, if any + * @param [response] ListDraftsResponse + */ + type ListDraftsCallback = (error: (Error|null), response?: google.cloud.visionai.v1alpha1.ListDraftsResponse) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.AppPlatform|getDraft}. + * @param error Error, if any + * @param [response] Draft + */ + type GetDraftCallback = (error: (Error|null), response?: google.cloud.visionai.v1alpha1.Draft) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.AppPlatform|createDraft}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateDraftCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.AppPlatform|updateDraft}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateDraftCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.AppPlatform|deleteDraft}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteDraftCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.AppPlatform|listProcessors}. + * @param error Error, if any + * @param [response] ListProcessorsResponse + */ + type ListProcessorsCallback = (error: (Error|null), response?: google.cloud.visionai.v1alpha1.ListProcessorsResponse) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.AppPlatform|listPrebuiltProcessors}. + * @param error Error, if any + * @param [response] ListPrebuiltProcessorsResponse + */ + type ListPrebuiltProcessorsCallback = (error: (Error|null), response?: google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsResponse) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.AppPlatform|getProcessor}. + * @param error Error, if any + * @param [response] Processor + */ + type GetProcessorCallback = (error: (Error|null), response?: google.cloud.visionai.v1alpha1.Processor) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.AppPlatform|createProcessor}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateProcessorCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.AppPlatform|updateProcessor}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateProcessorCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.AppPlatform|deleteProcessor}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteProcessorCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** ModelType enum. */ + enum ModelType { + MODEL_TYPE_UNSPECIFIED = 0, + IMAGE_CLASSIFICATION = 1, + OBJECT_DETECTION = 2, + VIDEO_CLASSIFICATION = 3, + VIDEO_OBJECT_TRACKING = 4, + VIDEO_ACTION_RECOGNITION = 5, + OCCUPANCY_COUNTING = 6, + PERSON_BLUR = 7, + VERTEX_CUSTOM = 8 + } + + /** AcceleratorType enum. */ + enum AcceleratorType { + ACCELERATOR_TYPE_UNSPECIFIED = 0, + NVIDIA_TESLA_K80 = 1, + NVIDIA_TESLA_P100 = 2, + NVIDIA_TESLA_V100 = 3, + NVIDIA_TESLA_P4 = 4, + NVIDIA_TESLA_T4 = 5, + NVIDIA_TESLA_A100 = 8, + TPU_V2 = 6, + TPU_V3 = 7 + } + + /** Properties of a DeleteApplicationInstancesResponse. */ + interface IDeleteApplicationInstancesResponse { + } + + /** Represents a DeleteApplicationInstancesResponse. */ + class DeleteApplicationInstancesResponse implements IDeleteApplicationInstancesResponse { + + /** + * Constructs a new DeleteApplicationInstancesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IDeleteApplicationInstancesResponse); + + /** + * Creates a new DeleteApplicationInstancesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteApplicationInstancesResponse instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IDeleteApplicationInstancesResponse): google.cloud.visionai.v1alpha1.DeleteApplicationInstancesResponse; + + /** + * Encodes the specified DeleteApplicationInstancesResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteApplicationInstancesResponse.verify|verify} messages. + * @param message DeleteApplicationInstancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IDeleteApplicationInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteApplicationInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteApplicationInstancesResponse.verify|verify} messages. + * @param message DeleteApplicationInstancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IDeleteApplicationInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteApplicationInstancesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteApplicationInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.DeleteApplicationInstancesResponse; + + /** + * Decodes a DeleteApplicationInstancesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteApplicationInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.DeleteApplicationInstancesResponse; + + /** + * Verifies a DeleteApplicationInstancesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteApplicationInstancesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteApplicationInstancesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.DeleteApplicationInstancesResponse; + + /** + * Creates a plain object from a DeleteApplicationInstancesResponse message. Also converts values to other types if specified. + * @param message DeleteApplicationInstancesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.DeleteApplicationInstancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteApplicationInstancesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteApplicationInstancesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateApplicationInstancesResponse. */ + interface ICreateApplicationInstancesResponse { + } + + /** Represents a CreateApplicationInstancesResponse. */ + class CreateApplicationInstancesResponse implements ICreateApplicationInstancesResponse { + + /** + * Constructs a new CreateApplicationInstancesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.ICreateApplicationInstancesResponse); + + /** + * Creates a new CreateApplicationInstancesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateApplicationInstancesResponse instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.ICreateApplicationInstancesResponse): google.cloud.visionai.v1alpha1.CreateApplicationInstancesResponse; + + /** + * Encodes the specified CreateApplicationInstancesResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateApplicationInstancesResponse.verify|verify} messages. + * @param message CreateApplicationInstancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.ICreateApplicationInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateApplicationInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateApplicationInstancesResponse.verify|verify} messages. + * @param message CreateApplicationInstancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.ICreateApplicationInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateApplicationInstancesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateApplicationInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.CreateApplicationInstancesResponse; + + /** + * Decodes a CreateApplicationInstancesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateApplicationInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.CreateApplicationInstancesResponse; + + /** + * Verifies a CreateApplicationInstancesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateApplicationInstancesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateApplicationInstancesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.CreateApplicationInstancesResponse; + + /** + * Creates a plain object from a CreateApplicationInstancesResponse message. Also converts values to other types if specified. + * @param message CreateApplicationInstancesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.CreateApplicationInstancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateApplicationInstancesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateApplicationInstancesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateApplicationInstancesResponse. */ + interface IUpdateApplicationInstancesResponse { + } + + /** Represents an UpdateApplicationInstancesResponse. */ + class UpdateApplicationInstancesResponse implements IUpdateApplicationInstancesResponse { + + /** + * Constructs a new UpdateApplicationInstancesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IUpdateApplicationInstancesResponse); + + /** + * Creates a new UpdateApplicationInstancesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateApplicationInstancesResponse instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IUpdateApplicationInstancesResponse): google.cloud.visionai.v1alpha1.UpdateApplicationInstancesResponse; + + /** + * Encodes the specified UpdateApplicationInstancesResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateApplicationInstancesResponse.verify|verify} messages. + * @param message UpdateApplicationInstancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IUpdateApplicationInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateApplicationInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateApplicationInstancesResponse.verify|verify} messages. + * @param message UpdateApplicationInstancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IUpdateApplicationInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateApplicationInstancesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateApplicationInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.UpdateApplicationInstancesResponse; + + /** + * Decodes an UpdateApplicationInstancesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateApplicationInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.UpdateApplicationInstancesResponse; + + /** + * Verifies an UpdateApplicationInstancesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateApplicationInstancesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateApplicationInstancesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.UpdateApplicationInstancesResponse; + + /** + * Creates a plain object from an UpdateApplicationInstancesResponse message. Also converts values to other types if specified. + * @param message UpdateApplicationInstancesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.UpdateApplicationInstancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateApplicationInstancesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateApplicationInstancesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateApplicationInstancesRequest. */ + interface ICreateApplicationInstancesRequest { + + /** CreateApplicationInstancesRequest name */ + name?: (string|null); + + /** CreateApplicationInstancesRequest applicationInstances */ + applicationInstances?: (google.cloud.visionai.v1alpha1.IApplicationInstance[]|null); + + /** CreateApplicationInstancesRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateApplicationInstancesRequest. */ + class CreateApplicationInstancesRequest implements ICreateApplicationInstancesRequest { + + /** + * Constructs a new CreateApplicationInstancesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.ICreateApplicationInstancesRequest); + + /** CreateApplicationInstancesRequest name. */ + public name: string; + + /** CreateApplicationInstancesRequest applicationInstances. */ + public applicationInstances: google.cloud.visionai.v1alpha1.IApplicationInstance[]; + + /** CreateApplicationInstancesRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateApplicationInstancesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateApplicationInstancesRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.ICreateApplicationInstancesRequest): google.cloud.visionai.v1alpha1.CreateApplicationInstancesRequest; + + /** + * Encodes the specified CreateApplicationInstancesRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateApplicationInstancesRequest.verify|verify} messages. + * @param message CreateApplicationInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.ICreateApplicationInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateApplicationInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateApplicationInstancesRequest.verify|verify} messages. + * @param message CreateApplicationInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.ICreateApplicationInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateApplicationInstancesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateApplicationInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.CreateApplicationInstancesRequest; + + /** + * Decodes a CreateApplicationInstancesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateApplicationInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.CreateApplicationInstancesRequest; + + /** + * Verifies a CreateApplicationInstancesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateApplicationInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateApplicationInstancesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.CreateApplicationInstancesRequest; + + /** + * Creates a plain object from a CreateApplicationInstancesRequest message. Also converts values to other types if specified. + * @param message CreateApplicationInstancesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.CreateApplicationInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateApplicationInstancesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateApplicationInstancesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteApplicationInstancesRequest. */ + interface IDeleteApplicationInstancesRequest { + + /** DeleteApplicationInstancesRequest name */ + name?: (string|null); + + /** DeleteApplicationInstancesRequest instanceIds */ + instanceIds?: (string[]|null); + + /** DeleteApplicationInstancesRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteApplicationInstancesRequest. */ + class DeleteApplicationInstancesRequest implements IDeleteApplicationInstancesRequest { + + /** + * Constructs a new DeleteApplicationInstancesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IDeleteApplicationInstancesRequest); + + /** DeleteApplicationInstancesRequest name. */ + public name: string; + + /** DeleteApplicationInstancesRequest instanceIds. */ + public instanceIds: string[]; + + /** DeleteApplicationInstancesRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteApplicationInstancesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteApplicationInstancesRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IDeleteApplicationInstancesRequest): google.cloud.visionai.v1alpha1.DeleteApplicationInstancesRequest; + + /** + * Encodes the specified DeleteApplicationInstancesRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteApplicationInstancesRequest.verify|verify} messages. + * @param message DeleteApplicationInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IDeleteApplicationInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteApplicationInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteApplicationInstancesRequest.verify|verify} messages. + * @param message DeleteApplicationInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IDeleteApplicationInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteApplicationInstancesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteApplicationInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.DeleteApplicationInstancesRequest; + + /** + * Decodes a DeleteApplicationInstancesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteApplicationInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.DeleteApplicationInstancesRequest; + + /** + * Verifies a DeleteApplicationInstancesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteApplicationInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteApplicationInstancesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.DeleteApplicationInstancesRequest; + + /** + * Creates a plain object from a DeleteApplicationInstancesRequest message. Also converts values to other types if specified. + * @param message DeleteApplicationInstancesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.DeleteApplicationInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteApplicationInstancesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteApplicationInstancesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeployApplicationResponse. */ + interface IDeployApplicationResponse { + } + + /** Represents a DeployApplicationResponse. */ + class DeployApplicationResponse implements IDeployApplicationResponse { + + /** + * Constructs a new DeployApplicationResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IDeployApplicationResponse); + + /** + * Creates a new DeployApplicationResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns DeployApplicationResponse instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IDeployApplicationResponse): google.cloud.visionai.v1alpha1.DeployApplicationResponse; + + /** + * Encodes the specified DeployApplicationResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeployApplicationResponse.verify|verify} messages. + * @param message DeployApplicationResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IDeployApplicationResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeployApplicationResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeployApplicationResponse.verify|verify} messages. + * @param message DeployApplicationResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IDeployApplicationResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeployApplicationResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeployApplicationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.DeployApplicationResponse; + + /** + * Decodes a DeployApplicationResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeployApplicationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.DeployApplicationResponse; + + /** + * Verifies a DeployApplicationResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeployApplicationResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeployApplicationResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.DeployApplicationResponse; + + /** + * Creates a plain object from a DeployApplicationResponse message. Also converts values to other types if specified. + * @param message DeployApplicationResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.DeployApplicationResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeployApplicationResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeployApplicationResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UndeployApplicationResponse. */ + interface IUndeployApplicationResponse { + } + + /** Represents an UndeployApplicationResponse. */ + class UndeployApplicationResponse implements IUndeployApplicationResponse { + + /** + * Constructs a new UndeployApplicationResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IUndeployApplicationResponse); + + /** + * Creates a new UndeployApplicationResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns UndeployApplicationResponse instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IUndeployApplicationResponse): google.cloud.visionai.v1alpha1.UndeployApplicationResponse; + + /** + * Encodes the specified UndeployApplicationResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.UndeployApplicationResponse.verify|verify} messages. + * @param message UndeployApplicationResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IUndeployApplicationResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UndeployApplicationResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.UndeployApplicationResponse.verify|verify} messages. + * @param message UndeployApplicationResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IUndeployApplicationResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UndeployApplicationResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UndeployApplicationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.UndeployApplicationResponse; + + /** + * Decodes an UndeployApplicationResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UndeployApplicationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.UndeployApplicationResponse; + + /** + * Verifies an UndeployApplicationResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UndeployApplicationResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UndeployApplicationResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.UndeployApplicationResponse; + + /** + * Creates a plain object from an UndeployApplicationResponse message. Also converts values to other types if specified. + * @param message UndeployApplicationResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.UndeployApplicationResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UndeployApplicationResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UndeployApplicationResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RemoveApplicationStreamInputResponse. */ + interface IRemoveApplicationStreamInputResponse { + } + + /** Represents a RemoveApplicationStreamInputResponse. */ + class RemoveApplicationStreamInputResponse implements IRemoveApplicationStreamInputResponse { + + /** + * Constructs a new RemoveApplicationStreamInputResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IRemoveApplicationStreamInputResponse); + + /** + * Creates a new RemoveApplicationStreamInputResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RemoveApplicationStreamInputResponse instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IRemoveApplicationStreamInputResponse): google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputResponse; + + /** + * Encodes the specified RemoveApplicationStreamInputResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputResponse.verify|verify} messages. + * @param message RemoveApplicationStreamInputResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IRemoveApplicationStreamInputResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RemoveApplicationStreamInputResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputResponse.verify|verify} messages. + * @param message RemoveApplicationStreamInputResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IRemoveApplicationStreamInputResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RemoveApplicationStreamInputResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RemoveApplicationStreamInputResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputResponse; + + /** + * Decodes a RemoveApplicationStreamInputResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RemoveApplicationStreamInputResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputResponse; + + /** + * Verifies a RemoveApplicationStreamInputResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RemoveApplicationStreamInputResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RemoveApplicationStreamInputResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputResponse; + + /** + * Creates a plain object from a RemoveApplicationStreamInputResponse message. Also converts values to other types if specified. + * @param message RemoveApplicationStreamInputResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RemoveApplicationStreamInputResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RemoveApplicationStreamInputResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AddApplicationStreamInputResponse. */ + interface IAddApplicationStreamInputResponse { + } + + /** Represents an AddApplicationStreamInputResponse. */ + class AddApplicationStreamInputResponse implements IAddApplicationStreamInputResponse { + + /** + * Constructs a new AddApplicationStreamInputResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IAddApplicationStreamInputResponse); + + /** + * Creates a new AddApplicationStreamInputResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AddApplicationStreamInputResponse instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IAddApplicationStreamInputResponse): google.cloud.visionai.v1alpha1.AddApplicationStreamInputResponse; + + /** + * Encodes the specified AddApplicationStreamInputResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.AddApplicationStreamInputResponse.verify|verify} messages. + * @param message AddApplicationStreamInputResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IAddApplicationStreamInputResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AddApplicationStreamInputResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.AddApplicationStreamInputResponse.verify|verify} messages. + * @param message AddApplicationStreamInputResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IAddApplicationStreamInputResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AddApplicationStreamInputResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AddApplicationStreamInputResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.AddApplicationStreamInputResponse; + + /** + * Decodes an AddApplicationStreamInputResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AddApplicationStreamInputResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.AddApplicationStreamInputResponse; + + /** + * Verifies an AddApplicationStreamInputResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AddApplicationStreamInputResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AddApplicationStreamInputResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.AddApplicationStreamInputResponse; + + /** + * Creates a plain object from an AddApplicationStreamInputResponse message. Also converts values to other types if specified. + * @param message AddApplicationStreamInputResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.AddApplicationStreamInputResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AddApplicationStreamInputResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AddApplicationStreamInputResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateApplicationStreamInputResponse. */ + interface IUpdateApplicationStreamInputResponse { + } + + /** Represents an UpdateApplicationStreamInputResponse. */ + class UpdateApplicationStreamInputResponse implements IUpdateApplicationStreamInputResponse { + + /** + * Constructs a new UpdateApplicationStreamInputResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IUpdateApplicationStreamInputResponse); + + /** + * Creates a new UpdateApplicationStreamInputResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateApplicationStreamInputResponse instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IUpdateApplicationStreamInputResponse): google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputResponse; + + /** + * Encodes the specified UpdateApplicationStreamInputResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputResponse.verify|verify} messages. + * @param message UpdateApplicationStreamInputResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IUpdateApplicationStreamInputResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateApplicationStreamInputResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputResponse.verify|verify} messages. + * @param message UpdateApplicationStreamInputResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IUpdateApplicationStreamInputResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateApplicationStreamInputResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateApplicationStreamInputResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputResponse; + + /** + * Decodes an UpdateApplicationStreamInputResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateApplicationStreamInputResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputResponse; + + /** + * Verifies an UpdateApplicationStreamInputResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateApplicationStreamInputResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateApplicationStreamInputResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputResponse; + + /** + * Creates a plain object from an UpdateApplicationStreamInputResponse message. Also converts values to other types if specified. + * @param message UpdateApplicationStreamInputResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateApplicationStreamInputResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateApplicationStreamInputResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListApplicationsRequest. */ + interface IListApplicationsRequest { + + /** ListApplicationsRequest parent */ + parent?: (string|null); + + /** ListApplicationsRequest pageSize */ + pageSize?: (number|null); + + /** ListApplicationsRequest pageToken */ + pageToken?: (string|null); + + /** ListApplicationsRequest filter */ + filter?: (string|null); + + /** ListApplicationsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListApplicationsRequest. */ + class ListApplicationsRequest implements IListApplicationsRequest { + + /** + * Constructs a new ListApplicationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IListApplicationsRequest); + + /** ListApplicationsRequest parent. */ + public parent: string; + + /** ListApplicationsRequest pageSize. */ + public pageSize: number; + + /** ListApplicationsRequest pageToken. */ + public pageToken: string; + + /** ListApplicationsRequest filter. */ + public filter: string; + + /** ListApplicationsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListApplicationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListApplicationsRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IListApplicationsRequest): google.cloud.visionai.v1alpha1.ListApplicationsRequest; + + /** + * Encodes the specified ListApplicationsRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListApplicationsRequest.verify|verify} messages. + * @param message ListApplicationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IListApplicationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListApplicationsRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListApplicationsRequest.verify|verify} messages. + * @param message ListApplicationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IListApplicationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListApplicationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListApplicationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ListApplicationsRequest; + + /** + * Decodes a ListApplicationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListApplicationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ListApplicationsRequest; + + /** + * Verifies a ListApplicationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListApplicationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListApplicationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ListApplicationsRequest; + + /** + * Creates a plain object from a ListApplicationsRequest message. Also converts values to other types if specified. + * @param message ListApplicationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ListApplicationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListApplicationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListApplicationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListApplicationsResponse. */ + interface IListApplicationsResponse { + + /** ListApplicationsResponse applications */ + applications?: (google.cloud.visionai.v1alpha1.IApplication[]|null); + + /** ListApplicationsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListApplicationsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListApplicationsResponse. */ + class ListApplicationsResponse implements IListApplicationsResponse { + + /** + * Constructs a new ListApplicationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IListApplicationsResponse); + + /** ListApplicationsResponse applications. */ + public applications: google.cloud.visionai.v1alpha1.IApplication[]; + + /** ListApplicationsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListApplicationsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListApplicationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListApplicationsResponse instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IListApplicationsResponse): google.cloud.visionai.v1alpha1.ListApplicationsResponse; + + /** + * Encodes the specified ListApplicationsResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListApplicationsResponse.verify|verify} messages. + * @param message ListApplicationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IListApplicationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListApplicationsResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListApplicationsResponse.verify|verify} messages. + * @param message ListApplicationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IListApplicationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListApplicationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListApplicationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ListApplicationsResponse; + + /** + * Decodes a ListApplicationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListApplicationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ListApplicationsResponse; + + /** + * Verifies a ListApplicationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListApplicationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListApplicationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ListApplicationsResponse; + + /** + * Creates a plain object from a ListApplicationsResponse message. Also converts values to other types if specified. + * @param message ListApplicationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ListApplicationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListApplicationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListApplicationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetApplicationRequest. */ + interface IGetApplicationRequest { + + /** GetApplicationRequest name */ + name?: (string|null); + } + + /** Represents a GetApplicationRequest. */ + class GetApplicationRequest implements IGetApplicationRequest { + + /** + * Constructs a new GetApplicationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IGetApplicationRequest); + + /** GetApplicationRequest name. */ + public name: string; + + /** + * Creates a new GetApplicationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetApplicationRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IGetApplicationRequest): google.cloud.visionai.v1alpha1.GetApplicationRequest; + + /** + * Encodes the specified GetApplicationRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetApplicationRequest.verify|verify} messages. + * @param message GetApplicationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IGetApplicationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetApplicationRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetApplicationRequest.verify|verify} messages. + * @param message GetApplicationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IGetApplicationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetApplicationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetApplicationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.GetApplicationRequest; + + /** + * Decodes a GetApplicationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetApplicationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.GetApplicationRequest; + + /** + * Verifies a GetApplicationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetApplicationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetApplicationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.GetApplicationRequest; + + /** + * Creates a plain object from a GetApplicationRequest message. Also converts values to other types if specified. + * @param message GetApplicationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.GetApplicationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetApplicationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetApplicationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateApplicationRequest. */ + interface ICreateApplicationRequest { + + /** CreateApplicationRequest parent */ + parent?: (string|null); + + /** CreateApplicationRequest applicationId */ + applicationId?: (string|null); + + /** CreateApplicationRequest application */ + application?: (google.cloud.visionai.v1alpha1.IApplication|null); + + /** CreateApplicationRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateApplicationRequest. */ + class CreateApplicationRequest implements ICreateApplicationRequest { + + /** + * Constructs a new CreateApplicationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.ICreateApplicationRequest); + + /** CreateApplicationRequest parent. */ + public parent: string; + + /** CreateApplicationRequest applicationId. */ + public applicationId: string; + + /** CreateApplicationRequest application. */ + public application?: (google.cloud.visionai.v1alpha1.IApplication|null); + + /** CreateApplicationRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateApplicationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateApplicationRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.ICreateApplicationRequest): google.cloud.visionai.v1alpha1.CreateApplicationRequest; + + /** + * Encodes the specified CreateApplicationRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateApplicationRequest.verify|verify} messages. + * @param message CreateApplicationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.ICreateApplicationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateApplicationRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateApplicationRequest.verify|verify} messages. + * @param message CreateApplicationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.ICreateApplicationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateApplicationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateApplicationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.CreateApplicationRequest; + + /** + * Decodes a CreateApplicationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateApplicationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.CreateApplicationRequest; + + /** + * Verifies a CreateApplicationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateApplicationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateApplicationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.CreateApplicationRequest; + + /** + * Creates a plain object from a CreateApplicationRequest message. Also converts values to other types if specified. + * @param message CreateApplicationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.CreateApplicationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateApplicationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateApplicationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateApplicationRequest. */ + interface IUpdateApplicationRequest { + + /** UpdateApplicationRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateApplicationRequest application */ + application?: (google.cloud.visionai.v1alpha1.IApplication|null); + + /** UpdateApplicationRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateApplicationRequest. */ + class UpdateApplicationRequest implements IUpdateApplicationRequest { + + /** + * Constructs a new UpdateApplicationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IUpdateApplicationRequest); + + /** UpdateApplicationRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateApplicationRequest application. */ + public application?: (google.cloud.visionai.v1alpha1.IApplication|null); + + /** UpdateApplicationRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpdateApplicationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateApplicationRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IUpdateApplicationRequest): google.cloud.visionai.v1alpha1.UpdateApplicationRequest; + + /** + * Encodes the specified UpdateApplicationRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateApplicationRequest.verify|verify} messages. + * @param message UpdateApplicationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IUpdateApplicationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateApplicationRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateApplicationRequest.verify|verify} messages. + * @param message UpdateApplicationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IUpdateApplicationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateApplicationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateApplicationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.UpdateApplicationRequest; + + /** + * Decodes an UpdateApplicationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateApplicationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.UpdateApplicationRequest; + + /** + * Verifies an UpdateApplicationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateApplicationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateApplicationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.UpdateApplicationRequest; + + /** + * Creates a plain object from an UpdateApplicationRequest message. Also converts values to other types if specified. + * @param message UpdateApplicationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.UpdateApplicationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateApplicationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateApplicationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteApplicationRequest. */ + interface IDeleteApplicationRequest { + + /** DeleteApplicationRequest name */ + name?: (string|null); + + /** DeleteApplicationRequest requestId */ + requestId?: (string|null); + + /** DeleteApplicationRequest force */ + force?: (boolean|null); + } + + /** Represents a DeleteApplicationRequest. */ + class DeleteApplicationRequest implements IDeleteApplicationRequest { + + /** + * Constructs a new DeleteApplicationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IDeleteApplicationRequest); + + /** DeleteApplicationRequest name. */ + public name: string; + + /** DeleteApplicationRequest requestId. */ + public requestId: string; + + /** DeleteApplicationRequest force. */ + public force: boolean; + + /** + * Creates a new DeleteApplicationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteApplicationRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IDeleteApplicationRequest): google.cloud.visionai.v1alpha1.DeleteApplicationRequest; + + /** + * Encodes the specified DeleteApplicationRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteApplicationRequest.verify|verify} messages. + * @param message DeleteApplicationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IDeleteApplicationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteApplicationRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteApplicationRequest.verify|verify} messages. + * @param message DeleteApplicationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IDeleteApplicationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteApplicationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteApplicationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.DeleteApplicationRequest; + + /** + * Decodes a DeleteApplicationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteApplicationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.DeleteApplicationRequest; + + /** + * Verifies a DeleteApplicationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteApplicationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteApplicationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.DeleteApplicationRequest; + + /** + * Creates a plain object from a DeleteApplicationRequest message. Also converts values to other types if specified. + * @param message DeleteApplicationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.DeleteApplicationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteApplicationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteApplicationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeployApplicationRequest. */ + interface IDeployApplicationRequest { + + /** DeployApplicationRequest name */ + name?: (string|null); + + /** DeployApplicationRequest validateOnly */ + validateOnly?: (boolean|null); + + /** DeployApplicationRequest requestId */ + requestId?: (string|null); + + /** DeployApplicationRequest enableMonitoring */ + enableMonitoring?: (boolean|null); + } + + /** Represents a DeployApplicationRequest. */ + class DeployApplicationRequest implements IDeployApplicationRequest { + + /** + * Constructs a new DeployApplicationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IDeployApplicationRequest); + + /** DeployApplicationRequest name. */ + public name: string; + + /** DeployApplicationRequest validateOnly. */ + public validateOnly: boolean; + + /** DeployApplicationRequest requestId. */ + public requestId: string; + + /** DeployApplicationRequest enableMonitoring. */ + public enableMonitoring: boolean; + + /** + * Creates a new DeployApplicationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeployApplicationRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IDeployApplicationRequest): google.cloud.visionai.v1alpha1.DeployApplicationRequest; + + /** + * Encodes the specified DeployApplicationRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeployApplicationRequest.verify|verify} messages. + * @param message DeployApplicationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IDeployApplicationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeployApplicationRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeployApplicationRequest.verify|verify} messages. + * @param message DeployApplicationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IDeployApplicationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeployApplicationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeployApplicationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.DeployApplicationRequest; + + /** + * Decodes a DeployApplicationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeployApplicationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.DeployApplicationRequest; + + /** + * Verifies a DeployApplicationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeployApplicationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeployApplicationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.DeployApplicationRequest; + + /** + * Creates a plain object from a DeployApplicationRequest message. Also converts values to other types if specified. + * @param message DeployApplicationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.DeployApplicationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeployApplicationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeployApplicationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UndeployApplicationRequest. */ + interface IUndeployApplicationRequest { + + /** UndeployApplicationRequest name */ + name?: (string|null); + + /** UndeployApplicationRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UndeployApplicationRequest. */ + class UndeployApplicationRequest implements IUndeployApplicationRequest { + + /** + * Constructs a new UndeployApplicationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IUndeployApplicationRequest); + + /** UndeployApplicationRequest name. */ + public name: string; + + /** UndeployApplicationRequest requestId. */ + public requestId: string; + + /** + * Creates a new UndeployApplicationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UndeployApplicationRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IUndeployApplicationRequest): google.cloud.visionai.v1alpha1.UndeployApplicationRequest; + + /** + * Encodes the specified UndeployApplicationRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.UndeployApplicationRequest.verify|verify} messages. + * @param message UndeployApplicationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IUndeployApplicationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UndeployApplicationRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.UndeployApplicationRequest.verify|verify} messages. + * @param message UndeployApplicationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IUndeployApplicationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UndeployApplicationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UndeployApplicationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.UndeployApplicationRequest; + + /** + * Decodes an UndeployApplicationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UndeployApplicationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.UndeployApplicationRequest; + + /** + * Verifies an UndeployApplicationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UndeployApplicationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UndeployApplicationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.UndeployApplicationRequest; + + /** + * Creates a plain object from an UndeployApplicationRequest message. Also converts values to other types if specified. + * @param message UndeployApplicationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.UndeployApplicationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UndeployApplicationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UndeployApplicationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ApplicationStreamInput. */ + interface IApplicationStreamInput { + + /** ApplicationStreamInput streamWithAnnotation */ + streamWithAnnotation?: (google.cloud.visionai.v1alpha1.IStreamWithAnnotation|null); + } + + /** Represents an ApplicationStreamInput. */ + class ApplicationStreamInput implements IApplicationStreamInput { + + /** + * Constructs a new ApplicationStreamInput. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IApplicationStreamInput); + + /** ApplicationStreamInput streamWithAnnotation. */ + public streamWithAnnotation?: (google.cloud.visionai.v1alpha1.IStreamWithAnnotation|null); + + /** + * Creates a new ApplicationStreamInput instance using the specified properties. + * @param [properties] Properties to set + * @returns ApplicationStreamInput instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IApplicationStreamInput): google.cloud.visionai.v1alpha1.ApplicationStreamInput; + + /** + * Encodes the specified ApplicationStreamInput message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ApplicationStreamInput.verify|verify} messages. + * @param message ApplicationStreamInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IApplicationStreamInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApplicationStreamInput message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ApplicationStreamInput.verify|verify} messages. + * @param message ApplicationStreamInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IApplicationStreamInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApplicationStreamInput message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApplicationStreamInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ApplicationStreamInput; + + /** + * Decodes an ApplicationStreamInput message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApplicationStreamInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ApplicationStreamInput; + + /** + * Verifies an ApplicationStreamInput message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ApplicationStreamInput message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApplicationStreamInput + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ApplicationStreamInput; + + /** + * Creates a plain object from an ApplicationStreamInput message. Also converts values to other types if specified. + * @param message ApplicationStreamInput + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ApplicationStreamInput, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApplicationStreamInput to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ApplicationStreamInput + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AddApplicationStreamInputRequest. */ + interface IAddApplicationStreamInputRequest { + + /** AddApplicationStreamInputRequest name */ + name?: (string|null); + + /** AddApplicationStreamInputRequest applicationStreamInputs */ + applicationStreamInputs?: (google.cloud.visionai.v1alpha1.IApplicationStreamInput[]|null); + + /** AddApplicationStreamInputRequest requestId */ + requestId?: (string|null); + } + + /** Represents an AddApplicationStreamInputRequest. */ + class AddApplicationStreamInputRequest implements IAddApplicationStreamInputRequest { + + /** + * Constructs a new AddApplicationStreamInputRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IAddApplicationStreamInputRequest); + + /** AddApplicationStreamInputRequest name. */ + public name: string; + + /** AddApplicationStreamInputRequest applicationStreamInputs. */ + public applicationStreamInputs: google.cloud.visionai.v1alpha1.IApplicationStreamInput[]; + + /** AddApplicationStreamInputRequest requestId. */ + public requestId: string; + + /** + * Creates a new AddApplicationStreamInputRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AddApplicationStreamInputRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IAddApplicationStreamInputRequest): google.cloud.visionai.v1alpha1.AddApplicationStreamInputRequest; + + /** + * Encodes the specified AddApplicationStreamInputRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.AddApplicationStreamInputRequest.verify|verify} messages. + * @param message AddApplicationStreamInputRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IAddApplicationStreamInputRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AddApplicationStreamInputRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.AddApplicationStreamInputRequest.verify|verify} messages. + * @param message AddApplicationStreamInputRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IAddApplicationStreamInputRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AddApplicationStreamInputRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AddApplicationStreamInputRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.AddApplicationStreamInputRequest; + + /** + * Decodes an AddApplicationStreamInputRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AddApplicationStreamInputRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.AddApplicationStreamInputRequest; + + /** + * Verifies an AddApplicationStreamInputRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AddApplicationStreamInputRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AddApplicationStreamInputRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.AddApplicationStreamInputRequest; + + /** + * Creates a plain object from an AddApplicationStreamInputRequest message. Also converts values to other types if specified. + * @param message AddApplicationStreamInputRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.AddApplicationStreamInputRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AddApplicationStreamInputRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AddApplicationStreamInputRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateApplicationStreamInputRequest. */ + interface IUpdateApplicationStreamInputRequest { + + /** UpdateApplicationStreamInputRequest name */ + name?: (string|null); + + /** UpdateApplicationStreamInputRequest applicationStreamInputs */ + applicationStreamInputs?: (google.cloud.visionai.v1alpha1.IApplicationStreamInput[]|null); + + /** UpdateApplicationStreamInputRequest requestId */ + requestId?: (string|null); + + /** UpdateApplicationStreamInputRequest allowMissing */ + allowMissing?: (boolean|null); + } + + /** Represents an UpdateApplicationStreamInputRequest. */ + class UpdateApplicationStreamInputRequest implements IUpdateApplicationStreamInputRequest { + + /** + * Constructs a new UpdateApplicationStreamInputRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IUpdateApplicationStreamInputRequest); + + /** UpdateApplicationStreamInputRequest name. */ + public name: string; + + /** UpdateApplicationStreamInputRequest applicationStreamInputs. */ + public applicationStreamInputs: google.cloud.visionai.v1alpha1.IApplicationStreamInput[]; + + /** UpdateApplicationStreamInputRequest requestId. */ + public requestId: string; + + /** UpdateApplicationStreamInputRequest allowMissing. */ + public allowMissing: boolean; + + /** + * Creates a new UpdateApplicationStreamInputRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateApplicationStreamInputRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IUpdateApplicationStreamInputRequest): google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputRequest; + + /** + * Encodes the specified UpdateApplicationStreamInputRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputRequest.verify|verify} messages. + * @param message UpdateApplicationStreamInputRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IUpdateApplicationStreamInputRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateApplicationStreamInputRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputRequest.verify|verify} messages. + * @param message UpdateApplicationStreamInputRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IUpdateApplicationStreamInputRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateApplicationStreamInputRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateApplicationStreamInputRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputRequest; + + /** + * Decodes an UpdateApplicationStreamInputRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateApplicationStreamInputRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputRequest; + + /** + * Verifies an UpdateApplicationStreamInputRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateApplicationStreamInputRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateApplicationStreamInputRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputRequest; + + /** + * Creates a plain object from an UpdateApplicationStreamInputRequest message. Also converts values to other types if specified. + * @param message UpdateApplicationStreamInputRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateApplicationStreamInputRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateApplicationStreamInputRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RemoveApplicationStreamInputRequest. */ + interface IRemoveApplicationStreamInputRequest { + + /** RemoveApplicationStreamInputRequest name */ + name?: (string|null); + + /** RemoveApplicationStreamInputRequest targetStreamInputs */ + targetStreamInputs?: (google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest.ITargetStreamInput[]|null); + + /** RemoveApplicationStreamInputRequest requestId */ + requestId?: (string|null); + } + + /** Represents a RemoveApplicationStreamInputRequest. */ + class RemoveApplicationStreamInputRequest implements IRemoveApplicationStreamInputRequest { + + /** + * Constructs a new RemoveApplicationStreamInputRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IRemoveApplicationStreamInputRequest); + + /** RemoveApplicationStreamInputRequest name. */ + public name: string; + + /** RemoveApplicationStreamInputRequest targetStreamInputs. */ + public targetStreamInputs: google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest.ITargetStreamInput[]; + + /** RemoveApplicationStreamInputRequest requestId. */ + public requestId: string; + + /** + * Creates a new RemoveApplicationStreamInputRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RemoveApplicationStreamInputRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IRemoveApplicationStreamInputRequest): google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest; + + /** + * Encodes the specified RemoveApplicationStreamInputRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest.verify|verify} messages. + * @param message RemoveApplicationStreamInputRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IRemoveApplicationStreamInputRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RemoveApplicationStreamInputRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest.verify|verify} messages. + * @param message RemoveApplicationStreamInputRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IRemoveApplicationStreamInputRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RemoveApplicationStreamInputRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RemoveApplicationStreamInputRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest; + + /** + * Decodes a RemoveApplicationStreamInputRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RemoveApplicationStreamInputRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest; + + /** + * Verifies a RemoveApplicationStreamInputRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RemoveApplicationStreamInputRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RemoveApplicationStreamInputRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest; + + /** + * Creates a plain object from a RemoveApplicationStreamInputRequest message. Also converts values to other types if specified. + * @param message RemoveApplicationStreamInputRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RemoveApplicationStreamInputRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RemoveApplicationStreamInputRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RemoveApplicationStreamInputRequest { + + /** Properties of a TargetStreamInput. */ + interface ITargetStreamInput { + + /** TargetStreamInput stream */ + stream?: (string|null); + } + + /** Represents a TargetStreamInput. */ + class TargetStreamInput implements ITargetStreamInput { + + /** + * Constructs a new TargetStreamInput. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest.ITargetStreamInput); + + /** TargetStreamInput stream. */ + public stream: string; + + /** + * Creates a new TargetStreamInput instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetStreamInput instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest.ITargetStreamInput): google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest.TargetStreamInput; + + /** + * Encodes the specified TargetStreamInput message. Does not implicitly {@link google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest.TargetStreamInput.verify|verify} messages. + * @param message TargetStreamInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest.ITargetStreamInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetStreamInput message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest.TargetStreamInput.verify|verify} messages. + * @param message TargetStreamInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest.ITargetStreamInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetStreamInput message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetStreamInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest.TargetStreamInput; + + /** + * Decodes a TargetStreamInput message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetStreamInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest.TargetStreamInput; + + /** + * Verifies a TargetStreamInput message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetStreamInput message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetStreamInput + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest.TargetStreamInput; + + /** + * Creates a plain object from a TargetStreamInput message. Also converts values to other types if specified. + * @param message TargetStreamInput + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest.TargetStreamInput, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetStreamInput to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TargetStreamInput + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ListInstancesRequest. */ + interface IListInstancesRequest { + + /** ListInstancesRequest parent */ + parent?: (string|null); + + /** ListInstancesRequest pageSize */ + pageSize?: (number|null); + + /** ListInstancesRequest pageToken */ + pageToken?: (string|null); + + /** ListInstancesRequest filter */ + filter?: (string|null); + + /** ListInstancesRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListInstancesRequest. */ + class ListInstancesRequest implements IListInstancesRequest { + + /** + * Constructs a new ListInstancesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IListInstancesRequest); + + /** ListInstancesRequest parent. */ + public parent: string; + + /** ListInstancesRequest pageSize. */ + public pageSize: number; + + /** ListInstancesRequest pageToken. */ + public pageToken: string; + + /** ListInstancesRequest filter. */ + public filter: string; + + /** ListInstancesRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListInstancesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstancesRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IListInstancesRequest): google.cloud.visionai.v1alpha1.ListInstancesRequest; + + /** + * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListInstancesRequest.verify|verify} messages. + * @param message ListInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListInstancesRequest.verify|verify} messages. + * @param message ListInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ListInstancesRequest; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ListInstancesRequest; + + /** + * Verifies a ListInstancesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstancesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ListInstancesRequest; + + /** + * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. + * @param message ListInstancesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ListInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstancesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInstancesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInstancesResponse. */ + interface IListInstancesResponse { + + /** ListInstancesResponse instances */ + instances?: (google.cloud.visionai.v1alpha1.IInstance[]|null); + + /** ListInstancesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListInstancesResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListInstancesResponse. */ + class ListInstancesResponse implements IListInstancesResponse { + + /** + * Constructs a new ListInstancesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IListInstancesResponse); + + /** ListInstancesResponse instances. */ + public instances: google.cloud.visionai.v1alpha1.IInstance[]; + + /** ListInstancesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListInstancesResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListInstancesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstancesResponse instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IListInstancesResponse): google.cloud.visionai.v1alpha1.ListInstancesResponse; + + /** + * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListInstancesResponse.verify|verify} messages. + * @param message ListInstancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListInstancesResponse.verify|verify} messages. + * @param message ListInstancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ListInstancesResponse; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ListInstancesResponse; + + /** + * Verifies a ListInstancesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstancesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ListInstancesResponse; + + /** + * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. + * @param message ListInstancesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ListInstancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstancesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInstancesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetInstanceRequest. */ + interface IGetInstanceRequest { + + /** GetInstanceRequest name */ + name?: (string|null); + } + + /** Represents a GetInstanceRequest. */ + class GetInstanceRequest implements IGetInstanceRequest { + + /** + * Constructs a new GetInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IGetInstanceRequest); + + /** GetInstanceRequest name. */ + public name: string; + + /** + * Creates a new GetInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetInstanceRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IGetInstanceRequest): google.cloud.visionai.v1alpha1.GetInstanceRequest; + + /** + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetInstanceRequest.verify|verify} messages. + * @param message GetInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetInstanceRequest.verify|verify} messages. + * @param message GetInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.GetInstanceRequest; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.GetInstanceRequest; + + /** + * Verifies a GetInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.GetInstanceRequest; + + /** + * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. + * @param message GetInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.GetInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDraftsRequest. */ + interface IListDraftsRequest { + + /** ListDraftsRequest parent */ + parent?: (string|null); + + /** ListDraftsRequest pageSize */ + pageSize?: (number|null); + + /** ListDraftsRequest pageToken */ + pageToken?: (string|null); + + /** ListDraftsRequest filter */ + filter?: (string|null); + + /** ListDraftsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListDraftsRequest. */ + class ListDraftsRequest implements IListDraftsRequest { + + /** + * Constructs a new ListDraftsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IListDraftsRequest); + + /** ListDraftsRequest parent. */ + public parent: string; + + /** ListDraftsRequest pageSize. */ + public pageSize: number; + + /** ListDraftsRequest pageToken. */ + public pageToken: string; + + /** ListDraftsRequest filter. */ + public filter: string; + + /** ListDraftsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListDraftsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDraftsRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IListDraftsRequest): google.cloud.visionai.v1alpha1.ListDraftsRequest; + + /** + * Encodes the specified ListDraftsRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListDraftsRequest.verify|verify} messages. + * @param message ListDraftsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IListDraftsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDraftsRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListDraftsRequest.verify|verify} messages. + * @param message ListDraftsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IListDraftsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDraftsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDraftsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ListDraftsRequest; + + /** + * Decodes a ListDraftsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDraftsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ListDraftsRequest; + + /** + * Verifies a ListDraftsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDraftsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDraftsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ListDraftsRequest; + + /** + * Creates a plain object from a ListDraftsRequest message. Also converts values to other types if specified. + * @param message ListDraftsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ListDraftsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDraftsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDraftsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDraftsResponse. */ + interface IListDraftsResponse { + + /** ListDraftsResponse drafts */ + drafts?: (google.cloud.visionai.v1alpha1.IDraft[]|null); + + /** ListDraftsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListDraftsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListDraftsResponse. */ + class ListDraftsResponse implements IListDraftsResponse { + + /** + * Constructs a new ListDraftsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IListDraftsResponse); + + /** ListDraftsResponse drafts. */ + public drafts: google.cloud.visionai.v1alpha1.IDraft[]; + + /** ListDraftsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListDraftsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListDraftsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDraftsResponse instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IListDraftsResponse): google.cloud.visionai.v1alpha1.ListDraftsResponse; + + /** + * Encodes the specified ListDraftsResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListDraftsResponse.verify|verify} messages. + * @param message ListDraftsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IListDraftsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDraftsResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListDraftsResponse.verify|verify} messages. + * @param message ListDraftsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IListDraftsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDraftsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDraftsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ListDraftsResponse; + + /** + * Decodes a ListDraftsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDraftsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ListDraftsResponse; + + /** + * Verifies a ListDraftsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDraftsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDraftsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ListDraftsResponse; + + /** + * Creates a plain object from a ListDraftsResponse message. Also converts values to other types if specified. + * @param message ListDraftsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ListDraftsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDraftsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDraftsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetDraftRequest. */ + interface IGetDraftRequest { + + /** GetDraftRequest name */ + name?: (string|null); + } + + /** Represents a GetDraftRequest. */ + class GetDraftRequest implements IGetDraftRequest { + + /** + * Constructs a new GetDraftRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IGetDraftRequest); + + /** GetDraftRequest name. */ + public name: string; + + /** + * Creates a new GetDraftRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDraftRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IGetDraftRequest): google.cloud.visionai.v1alpha1.GetDraftRequest; + + /** + * Encodes the specified GetDraftRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetDraftRequest.verify|verify} messages. + * @param message GetDraftRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IGetDraftRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDraftRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetDraftRequest.verify|verify} messages. + * @param message GetDraftRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IGetDraftRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDraftRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDraftRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.GetDraftRequest; + + /** + * Decodes a GetDraftRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDraftRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.GetDraftRequest; + + /** + * Verifies a GetDraftRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetDraftRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetDraftRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.GetDraftRequest; + + /** + * Creates a plain object from a GetDraftRequest message. Also converts values to other types if specified. + * @param message GetDraftRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.GetDraftRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetDraftRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetDraftRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateDraftRequest. */ + interface ICreateDraftRequest { + + /** CreateDraftRequest parent */ + parent?: (string|null); + + /** CreateDraftRequest draftId */ + draftId?: (string|null); + + /** CreateDraftRequest draft */ + draft?: (google.cloud.visionai.v1alpha1.IDraft|null); + + /** CreateDraftRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateDraftRequest. */ + class CreateDraftRequest implements ICreateDraftRequest { + + /** + * Constructs a new CreateDraftRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.ICreateDraftRequest); + + /** CreateDraftRequest parent. */ + public parent: string; + + /** CreateDraftRequest draftId. */ + public draftId: string; + + /** CreateDraftRequest draft. */ + public draft?: (google.cloud.visionai.v1alpha1.IDraft|null); + + /** CreateDraftRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateDraftRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateDraftRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.ICreateDraftRequest): google.cloud.visionai.v1alpha1.CreateDraftRequest; + + /** + * Encodes the specified CreateDraftRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateDraftRequest.verify|verify} messages. + * @param message CreateDraftRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.ICreateDraftRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateDraftRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateDraftRequest.verify|verify} messages. + * @param message CreateDraftRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.ICreateDraftRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateDraftRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateDraftRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.CreateDraftRequest; + + /** + * Decodes a CreateDraftRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateDraftRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.CreateDraftRequest; + + /** + * Verifies a CreateDraftRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateDraftRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateDraftRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.CreateDraftRequest; + + /** + * Creates a plain object from a CreateDraftRequest message. Also converts values to other types if specified. + * @param message CreateDraftRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.CreateDraftRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateDraftRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateDraftRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateDraftRequest. */ + interface IUpdateDraftRequest { + + /** UpdateDraftRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateDraftRequest draft */ + draft?: (google.cloud.visionai.v1alpha1.IDraft|null); + + /** UpdateDraftRequest requestId */ + requestId?: (string|null); + + /** UpdateDraftRequest allowMissing */ + allowMissing?: (boolean|null); + } + + /** Represents an UpdateDraftRequest. */ + class UpdateDraftRequest implements IUpdateDraftRequest { + + /** + * Constructs a new UpdateDraftRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IUpdateDraftRequest); + + /** UpdateDraftRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateDraftRequest draft. */ + public draft?: (google.cloud.visionai.v1alpha1.IDraft|null); + + /** UpdateDraftRequest requestId. */ + public requestId: string; + + /** UpdateDraftRequest allowMissing. */ + public allowMissing: boolean; + + /** + * Creates a new UpdateDraftRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateDraftRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IUpdateDraftRequest): google.cloud.visionai.v1alpha1.UpdateDraftRequest; + + /** + * Encodes the specified UpdateDraftRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateDraftRequest.verify|verify} messages. + * @param message UpdateDraftRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IUpdateDraftRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateDraftRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateDraftRequest.verify|verify} messages. + * @param message UpdateDraftRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IUpdateDraftRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateDraftRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateDraftRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.UpdateDraftRequest; + + /** + * Decodes an UpdateDraftRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateDraftRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.UpdateDraftRequest; + + /** + * Verifies an UpdateDraftRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateDraftRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateDraftRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.UpdateDraftRequest; + + /** + * Creates a plain object from an UpdateDraftRequest message. Also converts values to other types if specified. + * @param message UpdateDraftRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.UpdateDraftRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateDraftRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateDraftRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateApplicationInstancesRequest. */ + interface IUpdateApplicationInstancesRequest { + + /** UpdateApplicationInstancesRequest name */ + name?: (string|null); + + /** UpdateApplicationInstancesRequest applicationInstances */ + applicationInstances?: (google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest.IUpdateApplicationInstance[]|null); + + /** UpdateApplicationInstancesRequest requestId */ + requestId?: (string|null); + + /** UpdateApplicationInstancesRequest allowMissing */ + allowMissing?: (boolean|null); + } + + /** Represents an UpdateApplicationInstancesRequest. */ + class UpdateApplicationInstancesRequest implements IUpdateApplicationInstancesRequest { + + /** + * Constructs a new UpdateApplicationInstancesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IUpdateApplicationInstancesRequest); + + /** UpdateApplicationInstancesRequest name. */ + public name: string; + + /** UpdateApplicationInstancesRequest applicationInstances. */ + public applicationInstances: google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest.IUpdateApplicationInstance[]; + + /** UpdateApplicationInstancesRequest requestId. */ + public requestId: string; + + /** UpdateApplicationInstancesRequest allowMissing. */ + public allowMissing: boolean; + + /** + * Creates a new UpdateApplicationInstancesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateApplicationInstancesRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IUpdateApplicationInstancesRequest): google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest; + + /** + * Encodes the specified UpdateApplicationInstancesRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest.verify|verify} messages. + * @param message UpdateApplicationInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IUpdateApplicationInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateApplicationInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest.verify|verify} messages. + * @param message UpdateApplicationInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IUpdateApplicationInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateApplicationInstancesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateApplicationInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest; + + /** + * Decodes an UpdateApplicationInstancesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateApplicationInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest; + + /** + * Verifies an UpdateApplicationInstancesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateApplicationInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateApplicationInstancesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest; + + /** + * Creates a plain object from an UpdateApplicationInstancesRequest message. Also converts values to other types if specified. + * @param message UpdateApplicationInstancesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateApplicationInstancesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateApplicationInstancesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UpdateApplicationInstancesRequest { + + /** Properties of an UpdateApplicationInstance. */ + interface IUpdateApplicationInstance { + + /** UpdateApplicationInstance updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateApplicationInstance instance */ + instance?: (google.cloud.visionai.v1alpha1.IInstance|null); + + /** UpdateApplicationInstance instanceId */ + instanceId?: (string|null); + } + + /** Represents an UpdateApplicationInstance. */ + class UpdateApplicationInstance implements IUpdateApplicationInstance { + + /** + * Constructs a new UpdateApplicationInstance. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest.IUpdateApplicationInstance); + + /** UpdateApplicationInstance updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateApplicationInstance instance. */ + public instance?: (google.cloud.visionai.v1alpha1.IInstance|null); + + /** UpdateApplicationInstance instanceId. */ + public instanceId: string; + + /** + * Creates a new UpdateApplicationInstance instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateApplicationInstance instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest.IUpdateApplicationInstance): google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest.UpdateApplicationInstance; + + /** + * Encodes the specified UpdateApplicationInstance message. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest.UpdateApplicationInstance.verify|verify} messages. + * @param message UpdateApplicationInstance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest.IUpdateApplicationInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateApplicationInstance message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest.UpdateApplicationInstance.verify|verify} messages. + * @param message UpdateApplicationInstance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest.IUpdateApplicationInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateApplicationInstance message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateApplicationInstance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest.UpdateApplicationInstance; + + /** + * Decodes an UpdateApplicationInstance message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateApplicationInstance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest.UpdateApplicationInstance; + + /** + * Verifies an UpdateApplicationInstance message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateApplicationInstance message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateApplicationInstance + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest.UpdateApplicationInstance; + + /** + * Creates a plain object from an UpdateApplicationInstance message. Also converts values to other types if specified. + * @param message UpdateApplicationInstance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest.UpdateApplicationInstance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateApplicationInstance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateApplicationInstance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a DeleteDraftRequest. */ + interface IDeleteDraftRequest { + + /** DeleteDraftRequest name */ + name?: (string|null); + + /** DeleteDraftRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteDraftRequest. */ + class DeleteDraftRequest implements IDeleteDraftRequest { + + /** + * Constructs a new DeleteDraftRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IDeleteDraftRequest); + + /** DeleteDraftRequest name. */ + public name: string; + + /** DeleteDraftRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteDraftRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteDraftRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IDeleteDraftRequest): google.cloud.visionai.v1alpha1.DeleteDraftRequest; + + /** + * Encodes the specified DeleteDraftRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteDraftRequest.verify|verify} messages. + * @param message DeleteDraftRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IDeleteDraftRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteDraftRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteDraftRequest.verify|verify} messages. + * @param message DeleteDraftRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IDeleteDraftRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteDraftRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteDraftRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.DeleteDraftRequest; + + /** + * Decodes a DeleteDraftRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteDraftRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.DeleteDraftRequest; + + /** + * Verifies a DeleteDraftRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteDraftRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteDraftRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.DeleteDraftRequest; + + /** + * Creates a plain object from a DeleteDraftRequest message. Also converts values to other types if specified. + * @param message DeleteDraftRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.DeleteDraftRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteDraftRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteDraftRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListProcessorsRequest. */ + interface IListProcessorsRequest { + + /** ListProcessorsRequest parent */ + parent?: (string|null); + + /** ListProcessorsRequest pageSize */ + pageSize?: (number|null); + + /** ListProcessorsRequest pageToken */ + pageToken?: (string|null); + + /** ListProcessorsRequest filter */ + filter?: (string|null); + + /** ListProcessorsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListProcessorsRequest. */ + class ListProcessorsRequest implements IListProcessorsRequest { + + /** + * Constructs a new ListProcessorsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IListProcessorsRequest); + + /** ListProcessorsRequest parent. */ + public parent: string; + + /** ListProcessorsRequest pageSize. */ + public pageSize: number; + + /** ListProcessorsRequest pageToken. */ + public pageToken: string; + + /** ListProcessorsRequest filter. */ + public filter: string; + + /** ListProcessorsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListProcessorsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListProcessorsRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IListProcessorsRequest): google.cloud.visionai.v1alpha1.ListProcessorsRequest; + + /** + * Encodes the specified ListProcessorsRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListProcessorsRequest.verify|verify} messages. + * @param message ListProcessorsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IListProcessorsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListProcessorsRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListProcessorsRequest.verify|verify} messages. + * @param message ListProcessorsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IListProcessorsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListProcessorsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListProcessorsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ListProcessorsRequest; + + /** + * Decodes a ListProcessorsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListProcessorsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ListProcessorsRequest; + + /** + * Verifies a ListProcessorsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListProcessorsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListProcessorsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ListProcessorsRequest; + + /** + * Creates a plain object from a ListProcessorsRequest message. Also converts values to other types if specified. + * @param message ListProcessorsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ListProcessorsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListProcessorsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListProcessorsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListProcessorsResponse. */ + interface IListProcessorsResponse { + + /** ListProcessorsResponse processors */ + processors?: (google.cloud.visionai.v1alpha1.IProcessor[]|null); + + /** ListProcessorsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListProcessorsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListProcessorsResponse. */ + class ListProcessorsResponse implements IListProcessorsResponse { + + /** + * Constructs a new ListProcessorsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IListProcessorsResponse); + + /** ListProcessorsResponse processors. */ + public processors: google.cloud.visionai.v1alpha1.IProcessor[]; + + /** ListProcessorsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListProcessorsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListProcessorsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListProcessorsResponse instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IListProcessorsResponse): google.cloud.visionai.v1alpha1.ListProcessorsResponse; + + /** + * Encodes the specified ListProcessorsResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListProcessorsResponse.verify|verify} messages. + * @param message ListProcessorsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IListProcessorsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListProcessorsResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListProcessorsResponse.verify|verify} messages. + * @param message ListProcessorsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IListProcessorsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListProcessorsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListProcessorsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ListProcessorsResponse; + + /** + * Decodes a ListProcessorsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListProcessorsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ListProcessorsResponse; + + /** + * Verifies a ListProcessorsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListProcessorsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListProcessorsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ListProcessorsResponse; + + /** + * Creates a plain object from a ListProcessorsResponse message. Also converts values to other types if specified. + * @param message ListProcessorsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ListProcessorsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListProcessorsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListProcessorsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListPrebuiltProcessorsRequest. */ + interface IListPrebuiltProcessorsRequest { + + /** ListPrebuiltProcessorsRequest parent */ + parent?: (string|null); + } + + /** Represents a ListPrebuiltProcessorsRequest. */ + class ListPrebuiltProcessorsRequest implements IListPrebuiltProcessorsRequest { + + /** + * Constructs a new ListPrebuiltProcessorsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IListPrebuiltProcessorsRequest); + + /** ListPrebuiltProcessorsRequest parent. */ + public parent: string; + + /** + * Creates a new ListPrebuiltProcessorsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPrebuiltProcessorsRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IListPrebuiltProcessorsRequest): google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsRequest; + + /** + * Encodes the specified ListPrebuiltProcessorsRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsRequest.verify|verify} messages. + * @param message ListPrebuiltProcessorsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IListPrebuiltProcessorsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPrebuiltProcessorsRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsRequest.verify|verify} messages. + * @param message ListPrebuiltProcessorsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IListPrebuiltProcessorsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPrebuiltProcessorsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPrebuiltProcessorsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsRequest; + + /** + * Decodes a ListPrebuiltProcessorsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPrebuiltProcessorsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsRequest; + + /** + * Verifies a ListPrebuiltProcessorsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListPrebuiltProcessorsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPrebuiltProcessorsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsRequest; + + /** + * Creates a plain object from a ListPrebuiltProcessorsRequest message. Also converts values to other types if specified. + * @param message ListPrebuiltProcessorsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPrebuiltProcessorsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPrebuiltProcessorsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListPrebuiltProcessorsResponse. */ + interface IListPrebuiltProcessorsResponse { + + /** ListPrebuiltProcessorsResponse processors */ + processors?: (google.cloud.visionai.v1alpha1.IProcessor[]|null); + } + + /** Represents a ListPrebuiltProcessorsResponse. */ + class ListPrebuiltProcessorsResponse implements IListPrebuiltProcessorsResponse { + + /** + * Constructs a new ListPrebuiltProcessorsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IListPrebuiltProcessorsResponse); + + /** ListPrebuiltProcessorsResponse processors. */ + public processors: google.cloud.visionai.v1alpha1.IProcessor[]; + + /** + * Creates a new ListPrebuiltProcessorsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPrebuiltProcessorsResponse instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IListPrebuiltProcessorsResponse): google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsResponse; + + /** + * Encodes the specified ListPrebuiltProcessorsResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsResponse.verify|verify} messages. + * @param message ListPrebuiltProcessorsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IListPrebuiltProcessorsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPrebuiltProcessorsResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsResponse.verify|verify} messages. + * @param message ListPrebuiltProcessorsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IListPrebuiltProcessorsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPrebuiltProcessorsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPrebuiltProcessorsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsResponse; + + /** + * Decodes a ListPrebuiltProcessorsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPrebuiltProcessorsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsResponse; + + /** + * Verifies a ListPrebuiltProcessorsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListPrebuiltProcessorsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPrebuiltProcessorsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsResponse; + + /** + * Creates a plain object from a ListPrebuiltProcessorsResponse message. Also converts values to other types if specified. + * @param message ListPrebuiltProcessorsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPrebuiltProcessorsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPrebuiltProcessorsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetProcessorRequest. */ + interface IGetProcessorRequest { + + /** GetProcessorRequest name */ + name?: (string|null); + } + + /** Represents a GetProcessorRequest. */ + class GetProcessorRequest implements IGetProcessorRequest { + + /** + * Constructs a new GetProcessorRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IGetProcessorRequest); + + /** GetProcessorRequest name. */ + public name: string; + + /** + * Creates a new GetProcessorRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetProcessorRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IGetProcessorRequest): google.cloud.visionai.v1alpha1.GetProcessorRequest; + + /** + * Encodes the specified GetProcessorRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetProcessorRequest.verify|verify} messages. + * @param message GetProcessorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IGetProcessorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetProcessorRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetProcessorRequest.verify|verify} messages. + * @param message GetProcessorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IGetProcessorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetProcessorRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetProcessorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.GetProcessorRequest; + + /** + * Decodes a GetProcessorRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetProcessorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.GetProcessorRequest; + + /** + * Verifies a GetProcessorRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetProcessorRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetProcessorRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.GetProcessorRequest; + + /** + * Creates a plain object from a GetProcessorRequest message. Also converts values to other types if specified. + * @param message GetProcessorRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.GetProcessorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetProcessorRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetProcessorRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateProcessorRequest. */ + interface ICreateProcessorRequest { + + /** CreateProcessorRequest parent */ + parent?: (string|null); + + /** CreateProcessorRequest processorId */ + processorId?: (string|null); + + /** CreateProcessorRequest processor */ + processor?: (google.cloud.visionai.v1alpha1.IProcessor|null); + + /** CreateProcessorRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateProcessorRequest. */ + class CreateProcessorRequest implements ICreateProcessorRequest { + + /** + * Constructs a new CreateProcessorRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.ICreateProcessorRequest); + + /** CreateProcessorRequest parent. */ + public parent: string; + + /** CreateProcessorRequest processorId. */ + public processorId: string; + + /** CreateProcessorRequest processor. */ + public processor?: (google.cloud.visionai.v1alpha1.IProcessor|null); + + /** CreateProcessorRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateProcessorRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateProcessorRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.ICreateProcessorRequest): google.cloud.visionai.v1alpha1.CreateProcessorRequest; + + /** + * Encodes the specified CreateProcessorRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateProcessorRequest.verify|verify} messages. + * @param message CreateProcessorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.ICreateProcessorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateProcessorRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateProcessorRequest.verify|verify} messages. + * @param message CreateProcessorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.ICreateProcessorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateProcessorRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateProcessorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.CreateProcessorRequest; + + /** + * Decodes a CreateProcessorRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateProcessorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.CreateProcessorRequest; + + /** + * Verifies a CreateProcessorRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateProcessorRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateProcessorRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.CreateProcessorRequest; + + /** + * Creates a plain object from a CreateProcessorRequest message. Also converts values to other types if specified. + * @param message CreateProcessorRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.CreateProcessorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateProcessorRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateProcessorRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateProcessorRequest. */ + interface IUpdateProcessorRequest { + + /** UpdateProcessorRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateProcessorRequest processor */ + processor?: (google.cloud.visionai.v1alpha1.IProcessor|null); + + /** UpdateProcessorRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateProcessorRequest. */ + class UpdateProcessorRequest implements IUpdateProcessorRequest { + + /** + * Constructs a new UpdateProcessorRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IUpdateProcessorRequest); + + /** UpdateProcessorRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateProcessorRequest processor. */ + public processor?: (google.cloud.visionai.v1alpha1.IProcessor|null); + + /** UpdateProcessorRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpdateProcessorRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateProcessorRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IUpdateProcessorRequest): google.cloud.visionai.v1alpha1.UpdateProcessorRequest; + + /** + * Encodes the specified UpdateProcessorRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateProcessorRequest.verify|verify} messages. + * @param message UpdateProcessorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IUpdateProcessorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateProcessorRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateProcessorRequest.verify|verify} messages. + * @param message UpdateProcessorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IUpdateProcessorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateProcessorRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateProcessorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.UpdateProcessorRequest; + + /** + * Decodes an UpdateProcessorRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateProcessorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.UpdateProcessorRequest; + + /** + * Verifies an UpdateProcessorRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateProcessorRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateProcessorRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.UpdateProcessorRequest; + + /** + * Creates a plain object from an UpdateProcessorRequest message. Also converts values to other types if specified. + * @param message UpdateProcessorRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.UpdateProcessorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateProcessorRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateProcessorRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteProcessorRequest. */ + interface IDeleteProcessorRequest { + + /** DeleteProcessorRequest name */ + name?: (string|null); + + /** DeleteProcessorRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteProcessorRequest. */ + class DeleteProcessorRequest implements IDeleteProcessorRequest { + + /** + * Constructs a new DeleteProcessorRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IDeleteProcessorRequest); + + /** DeleteProcessorRequest name. */ + public name: string; + + /** DeleteProcessorRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteProcessorRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteProcessorRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IDeleteProcessorRequest): google.cloud.visionai.v1alpha1.DeleteProcessorRequest; + + /** + * Encodes the specified DeleteProcessorRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteProcessorRequest.verify|verify} messages. + * @param message DeleteProcessorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IDeleteProcessorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteProcessorRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteProcessorRequest.verify|verify} messages. + * @param message DeleteProcessorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IDeleteProcessorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteProcessorRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteProcessorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.DeleteProcessorRequest; + + /** + * Decodes a DeleteProcessorRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteProcessorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.DeleteProcessorRequest; + + /** + * Verifies a DeleteProcessorRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteProcessorRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteProcessorRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.DeleteProcessorRequest; + + /** + * Creates a plain object from a DeleteProcessorRequest message. Also converts values to other types if specified. + * @param message DeleteProcessorRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.DeleteProcessorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteProcessorRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteProcessorRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Application. */ + interface IApplication { + + /** Application name */ + name?: (string|null); + + /** Application createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Application updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Application labels */ + labels?: ({ [k: string]: string }|null); + + /** Application displayName */ + displayName?: (string|null); + + /** Application description */ + description?: (string|null); + + /** Application applicationConfigs */ + applicationConfigs?: (google.cloud.visionai.v1alpha1.IApplicationConfigs|null); + + /** Application runtimeInfo */ + runtimeInfo?: (google.cloud.visionai.v1alpha1.Application.IApplicationRuntimeInfo|null); + + /** Application state */ + state?: (google.cloud.visionai.v1alpha1.Application.State|keyof typeof google.cloud.visionai.v1alpha1.Application.State|null); + } + + /** Represents an Application. */ + class Application implements IApplication { + + /** + * Constructs a new Application. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IApplication); + + /** Application name. */ + public name: string; + + /** Application createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Application updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Application labels. */ + public labels: { [k: string]: string }; + + /** Application displayName. */ + public displayName: string; + + /** Application description. */ + public description: string; + + /** Application applicationConfigs. */ + public applicationConfigs?: (google.cloud.visionai.v1alpha1.IApplicationConfigs|null); + + /** Application runtimeInfo. */ + public runtimeInfo?: (google.cloud.visionai.v1alpha1.Application.IApplicationRuntimeInfo|null); + + /** Application state. */ + public state: (google.cloud.visionai.v1alpha1.Application.State|keyof typeof google.cloud.visionai.v1alpha1.Application.State); + + /** + * Creates a new Application instance using the specified properties. + * @param [properties] Properties to set + * @returns Application instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IApplication): google.cloud.visionai.v1alpha1.Application; + + /** + * Encodes the specified Application message. Does not implicitly {@link google.cloud.visionai.v1alpha1.Application.verify|verify} messages. + * @param message Application message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IApplication, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Application message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.Application.verify|verify} messages. + * @param message Application message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IApplication, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Application message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Application + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.Application; + + /** + * Decodes an Application message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Application + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.Application; + + /** + * Verifies an Application message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Application message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Application + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.Application; + + /** + * Creates a plain object from an Application message. Also converts values to other types if specified. + * @param message Application + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.Application, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Application to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Application + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Application { + + /** Properties of an ApplicationRuntimeInfo. */ + interface IApplicationRuntimeInfo { + + /** ApplicationRuntimeInfo deployTime */ + deployTime?: (google.protobuf.ITimestamp|null); + + /** ApplicationRuntimeInfo globalOutputResources */ + globalOutputResources?: (google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.IGlobalOutputResource[]|null); + + /** ApplicationRuntimeInfo monitoringConfig */ + monitoringConfig?: (google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.IMonitoringConfig|null); + } + + /** Represents an ApplicationRuntimeInfo. */ + class ApplicationRuntimeInfo implements IApplicationRuntimeInfo { + + /** + * Constructs a new ApplicationRuntimeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.Application.IApplicationRuntimeInfo); + + /** ApplicationRuntimeInfo deployTime. */ + public deployTime?: (google.protobuf.ITimestamp|null); + + /** ApplicationRuntimeInfo globalOutputResources. */ + public globalOutputResources: google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.IGlobalOutputResource[]; + + /** ApplicationRuntimeInfo monitoringConfig. */ + public monitoringConfig?: (google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.IMonitoringConfig|null); + + /** + * Creates a new ApplicationRuntimeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ApplicationRuntimeInfo instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.Application.IApplicationRuntimeInfo): google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo; + + /** + * Encodes the specified ApplicationRuntimeInfo message. Does not implicitly {@link google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.verify|verify} messages. + * @param message ApplicationRuntimeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.Application.IApplicationRuntimeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApplicationRuntimeInfo message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.verify|verify} messages. + * @param message ApplicationRuntimeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.Application.IApplicationRuntimeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApplicationRuntimeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApplicationRuntimeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo; + + /** + * Decodes an ApplicationRuntimeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApplicationRuntimeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo; + + /** + * Verifies an ApplicationRuntimeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ApplicationRuntimeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApplicationRuntimeInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo; + + /** + * Creates a plain object from an ApplicationRuntimeInfo message. Also converts values to other types if specified. + * @param message ApplicationRuntimeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApplicationRuntimeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ApplicationRuntimeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ApplicationRuntimeInfo { + + /** Properties of a GlobalOutputResource. */ + interface IGlobalOutputResource { + + /** GlobalOutputResource outputResource */ + outputResource?: (string|null); + + /** GlobalOutputResource producerNode */ + producerNode?: (string|null); + + /** GlobalOutputResource key */ + key?: (string|null); + } + + /** Represents a GlobalOutputResource. */ + class GlobalOutputResource implements IGlobalOutputResource { + + /** + * Constructs a new GlobalOutputResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.IGlobalOutputResource); + + /** GlobalOutputResource outputResource. */ + public outputResource: string; + + /** GlobalOutputResource producerNode. */ + public producerNode: string; + + /** GlobalOutputResource key. */ + public key: string; + + /** + * Creates a new GlobalOutputResource instance using the specified properties. + * @param [properties] Properties to set + * @returns GlobalOutputResource instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.IGlobalOutputResource): google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.GlobalOutputResource; + + /** + * Encodes the specified GlobalOutputResource message. Does not implicitly {@link google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.GlobalOutputResource.verify|verify} messages. + * @param message GlobalOutputResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.IGlobalOutputResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GlobalOutputResource message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.GlobalOutputResource.verify|verify} messages. + * @param message GlobalOutputResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.IGlobalOutputResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GlobalOutputResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GlobalOutputResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.GlobalOutputResource; + + /** + * Decodes a GlobalOutputResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GlobalOutputResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.GlobalOutputResource; + + /** + * Verifies a GlobalOutputResource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GlobalOutputResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GlobalOutputResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.GlobalOutputResource; + + /** + * Creates a plain object from a GlobalOutputResource message. Also converts values to other types if specified. + * @param message GlobalOutputResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.GlobalOutputResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GlobalOutputResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GlobalOutputResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MonitoringConfig. */ + interface IMonitoringConfig { + + /** MonitoringConfig enabled */ + enabled?: (boolean|null); + } + + /** Represents a MonitoringConfig. */ + class MonitoringConfig implements IMonitoringConfig { + + /** + * Constructs a new MonitoringConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.IMonitoringConfig); + + /** MonitoringConfig enabled. */ + public enabled: boolean; + + /** + * Creates a new MonitoringConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns MonitoringConfig instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.IMonitoringConfig): google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.MonitoringConfig; + + /** + * Encodes the specified MonitoringConfig message. Does not implicitly {@link google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.MonitoringConfig.verify|verify} messages. + * @param message MonitoringConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.IMonitoringConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MonitoringConfig message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.MonitoringConfig.verify|verify} messages. + * @param message MonitoringConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.IMonitoringConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MonitoringConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MonitoringConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.MonitoringConfig; + + /** + * Decodes a MonitoringConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MonitoringConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.MonitoringConfig; + + /** + * Verifies a MonitoringConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MonitoringConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MonitoringConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.MonitoringConfig; + + /** + * Creates a plain object from a MonitoringConfig message. Also converts values to other types if specified. + * @param message MonitoringConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.MonitoringConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MonitoringConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MonitoringConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATED = 1, + DEPLOYING = 2, + DEPLOYED = 3, + UNDEPLOYING = 4, + DELETED = 5, + ERROR = 6, + CREATING = 7, + UPDATING = 8, + DELETING = 9, + FIXING = 10 + } + } + + /** Properties of an ApplicationConfigs. */ + interface IApplicationConfigs { + + /** ApplicationConfigs nodes */ + nodes?: (google.cloud.visionai.v1alpha1.INode[]|null); + + /** ApplicationConfigs eventDeliveryConfig */ + eventDeliveryConfig?: (google.cloud.visionai.v1alpha1.ApplicationConfigs.IEventDeliveryConfig|null); + } + + /** Represents an ApplicationConfigs. */ + class ApplicationConfigs implements IApplicationConfigs { + + /** + * Constructs a new ApplicationConfigs. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IApplicationConfigs); + + /** ApplicationConfigs nodes. */ + public nodes: google.cloud.visionai.v1alpha1.INode[]; + + /** ApplicationConfigs eventDeliveryConfig. */ + public eventDeliveryConfig?: (google.cloud.visionai.v1alpha1.ApplicationConfigs.IEventDeliveryConfig|null); + + /** + * Creates a new ApplicationConfigs instance using the specified properties. + * @param [properties] Properties to set + * @returns ApplicationConfigs instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IApplicationConfigs): google.cloud.visionai.v1alpha1.ApplicationConfigs; + + /** + * Encodes the specified ApplicationConfigs message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ApplicationConfigs.verify|verify} messages. + * @param message ApplicationConfigs message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IApplicationConfigs, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApplicationConfigs message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ApplicationConfigs.verify|verify} messages. + * @param message ApplicationConfigs message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IApplicationConfigs, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApplicationConfigs message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApplicationConfigs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ApplicationConfigs; + + /** + * Decodes an ApplicationConfigs message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApplicationConfigs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ApplicationConfigs; + + /** + * Verifies an ApplicationConfigs message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ApplicationConfigs message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApplicationConfigs + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ApplicationConfigs; + + /** + * Creates a plain object from an ApplicationConfigs message. Also converts values to other types if specified. + * @param message ApplicationConfigs + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ApplicationConfigs, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApplicationConfigs to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ApplicationConfigs + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ApplicationConfigs { + + /** Properties of an EventDeliveryConfig. */ + interface IEventDeliveryConfig { + + /** EventDeliveryConfig channel */ + channel?: (string|null); + + /** EventDeliveryConfig minimalDeliveryInterval */ + minimalDeliveryInterval?: (google.protobuf.IDuration|null); + } + + /** Represents an EventDeliveryConfig. */ + class EventDeliveryConfig implements IEventDeliveryConfig { + + /** + * Constructs a new EventDeliveryConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.ApplicationConfigs.IEventDeliveryConfig); + + /** EventDeliveryConfig channel. */ + public channel: string; + + /** EventDeliveryConfig minimalDeliveryInterval. */ + public minimalDeliveryInterval?: (google.protobuf.IDuration|null); + + /** + * Creates a new EventDeliveryConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns EventDeliveryConfig instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.ApplicationConfigs.IEventDeliveryConfig): google.cloud.visionai.v1alpha1.ApplicationConfigs.EventDeliveryConfig; + + /** + * Encodes the specified EventDeliveryConfig message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ApplicationConfigs.EventDeliveryConfig.verify|verify} messages. + * @param message EventDeliveryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.ApplicationConfigs.IEventDeliveryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EventDeliveryConfig message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ApplicationConfigs.EventDeliveryConfig.verify|verify} messages. + * @param message EventDeliveryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.ApplicationConfigs.IEventDeliveryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EventDeliveryConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EventDeliveryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ApplicationConfigs.EventDeliveryConfig; + + /** + * Decodes an EventDeliveryConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EventDeliveryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ApplicationConfigs.EventDeliveryConfig; + + /** + * Verifies an EventDeliveryConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EventDeliveryConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EventDeliveryConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ApplicationConfigs.EventDeliveryConfig; + + /** + * Creates a plain object from an EventDeliveryConfig message. Also converts values to other types if specified. + * @param message EventDeliveryConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ApplicationConfigs.EventDeliveryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EventDeliveryConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EventDeliveryConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Node. */ + interface INode { + + /** Node outputAllOutputChannelsToStream */ + outputAllOutputChannelsToStream?: (boolean|null); + + /** Node name */ + name?: (string|null); + + /** Node displayName */ + displayName?: (string|null); + + /** Node nodeConfig */ + nodeConfig?: (google.cloud.visionai.v1alpha1.IProcessorConfig|null); + + /** Node processor */ + processor?: (string|null); + + /** Node parents */ + parents?: (google.cloud.visionai.v1alpha1.Node.IInputEdge[]|null); + } + + /** Represents a Node. */ + class Node implements INode { + + /** + * Constructs a new Node. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.INode); + + /** Node outputAllOutputChannelsToStream. */ + public outputAllOutputChannelsToStream?: (boolean|null); + + /** Node name. */ + public name: string; + + /** Node displayName. */ + public displayName: string; + + /** Node nodeConfig. */ + public nodeConfig?: (google.cloud.visionai.v1alpha1.IProcessorConfig|null); + + /** Node processor. */ + public processor: string; + + /** Node parents. */ + public parents: google.cloud.visionai.v1alpha1.Node.IInputEdge[]; + + /** Node streamOutputConfig. */ + public streamOutputConfig?: "outputAllOutputChannelsToStream"; + + /** + * Creates a new Node instance using the specified properties. + * @param [properties] Properties to set + * @returns Node instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.INode): google.cloud.visionai.v1alpha1.Node; + + /** + * Encodes the specified Node message. Does not implicitly {@link google.cloud.visionai.v1alpha1.Node.verify|verify} messages. + * @param message Node message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.INode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Node message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.Node.verify|verify} messages. + * @param message Node message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.INode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Node message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.Node; + + /** + * Decodes a Node message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.Node; + + /** + * Verifies a Node message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Node message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Node + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.Node; + + /** + * Creates a plain object from a Node message. Also converts values to other types if specified. + * @param message Node + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.Node, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Node to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Node + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Node { + + /** Properties of an InputEdge. */ + interface IInputEdge { + + /** InputEdge parentNode */ + parentNode?: (string|null); + + /** InputEdge parentOutputChannel */ + parentOutputChannel?: (string|null); + + /** InputEdge connectedInputChannel */ + connectedInputChannel?: (string|null); + } + + /** Represents an InputEdge. */ + class InputEdge implements IInputEdge { + + /** + * Constructs a new InputEdge. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.Node.IInputEdge); + + /** InputEdge parentNode. */ + public parentNode: string; + + /** InputEdge parentOutputChannel. */ + public parentOutputChannel: string; + + /** InputEdge connectedInputChannel. */ + public connectedInputChannel: string; + + /** + * Creates a new InputEdge instance using the specified properties. + * @param [properties] Properties to set + * @returns InputEdge instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.Node.IInputEdge): google.cloud.visionai.v1alpha1.Node.InputEdge; + + /** + * Encodes the specified InputEdge message. Does not implicitly {@link google.cloud.visionai.v1alpha1.Node.InputEdge.verify|verify} messages. + * @param message InputEdge message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.Node.IInputEdge, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InputEdge message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.Node.InputEdge.verify|verify} messages. + * @param message InputEdge message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.Node.IInputEdge, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InputEdge message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InputEdge + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.Node.InputEdge; + + /** + * Decodes an InputEdge message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InputEdge + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.Node.InputEdge; + + /** + * Verifies an InputEdge message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InputEdge message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InputEdge + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.Node.InputEdge; + + /** + * Creates a plain object from an InputEdge message. Also converts values to other types if specified. + * @param message InputEdge + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.Node.InputEdge, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InputEdge to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InputEdge + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Draft. */ + interface IDraft { + + /** Draft name */ + name?: (string|null); + + /** Draft createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Draft updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Draft labels */ + labels?: ({ [k: string]: string }|null); + + /** Draft displayName */ + displayName?: (string|null); + + /** Draft description */ + description?: (string|null); + + /** Draft draftApplicationConfigs */ + draftApplicationConfigs?: (google.cloud.visionai.v1alpha1.IApplicationConfigs|null); + } + + /** Represents a Draft. */ + class Draft implements IDraft { + + /** + * Constructs a new Draft. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IDraft); + + /** Draft name. */ + public name: string; + + /** Draft createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Draft updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Draft labels. */ + public labels: { [k: string]: string }; + + /** Draft displayName. */ + public displayName: string; + + /** Draft description. */ + public description: string; + + /** Draft draftApplicationConfigs. */ + public draftApplicationConfigs?: (google.cloud.visionai.v1alpha1.IApplicationConfigs|null); + + /** + * Creates a new Draft instance using the specified properties. + * @param [properties] Properties to set + * @returns Draft instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IDraft): google.cloud.visionai.v1alpha1.Draft; + + /** + * Encodes the specified Draft message. Does not implicitly {@link google.cloud.visionai.v1alpha1.Draft.verify|verify} messages. + * @param message Draft message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IDraft, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Draft message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.Draft.verify|verify} messages. + * @param message Draft message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IDraft, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Draft message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Draft + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.Draft; + + /** + * Decodes a Draft message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Draft + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.Draft; + + /** + * Verifies a Draft message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Draft message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Draft + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.Draft; + + /** + * Creates a plain object from a Draft message. Also converts values to other types if specified. + * @param message Draft + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.Draft, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Draft to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Draft + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Instance. */ + interface IInstance { + + /** Instance name */ + name?: (string|null); + + /** Instance createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Instance updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Instance labels */ + labels?: ({ [k: string]: string }|null); + + /** Instance displayName */ + displayName?: (string|null); + + /** Instance description */ + description?: (string|null); + + /** Instance inputResources */ + inputResources?: (google.cloud.visionai.v1alpha1.Instance.IInputResource[]|null); + + /** Instance outputResources */ + outputResources?: (google.cloud.visionai.v1alpha1.Instance.IOutputResource[]|null); + + /** Instance state */ + state?: (google.cloud.visionai.v1alpha1.Instance.State|keyof typeof google.cloud.visionai.v1alpha1.Instance.State|null); + } + + /** Represents an Instance. */ + class Instance implements IInstance { + + /** + * Constructs a new Instance. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IInstance); + + /** Instance name. */ + public name: string; + + /** Instance createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Instance updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Instance labels. */ + public labels: { [k: string]: string }; + + /** Instance displayName. */ + public displayName: string; + + /** Instance description. */ + public description: string; + + /** Instance inputResources. */ + public inputResources: google.cloud.visionai.v1alpha1.Instance.IInputResource[]; + + /** Instance outputResources. */ + public outputResources: google.cloud.visionai.v1alpha1.Instance.IOutputResource[]; + + /** Instance state. */ + public state: (google.cloud.visionai.v1alpha1.Instance.State|keyof typeof google.cloud.visionai.v1alpha1.Instance.State); + + /** + * Creates a new Instance instance using the specified properties. + * @param [properties] Properties to set + * @returns Instance instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IInstance): google.cloud.visionai.v1alpha1.Instance; + + /** + * Encodes the specified Instance message. Does not implicitly {@link google.cloud.visionai.v1alpha1.Instance.verify|verify} messages. + * @param message Instance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.Instance.verify|verify} messages. + * @param message Instance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Instance message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.Instance; + + /** + * Decodes an Instance message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.Instance; + + /** + * Verifies an Instance message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Instance message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Instance + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.Instance; + + /** + * Creates a plain object from an Instance message. Also converts values to other types if specified. + * @param message Instance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.Instance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Instance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Instance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Instance { + + /** Properties of an InputResource. */ + interface IInputResource { + + /** InputResource inputResource */ + inputResource?: (string|null); + + /** InputResource annotatedStream */ + annotatedStream?: (google.cloud.visionai.v1alpha1.IStreamWithAnnotation|null); + + /** InputResource consumerNode */ + consumerNode?: (string|null); + + /** InputResource inputResourceBinding */ + inputResourceBinding?: (string|null); + + /** InputResource annotations */ + annotations?: (google.cloud.visionai.v1alpha1.IResourceAnnotations|null); + } + + /** Represents an InputResource. */ + class InputResource implements IInputResource { + + /** + * Constructs a new InputResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.Instance.IInputResource); + + /** InputResource inputResource. */ + public inputResource?: (string|null); + + /** InputResource annotatedStream. */ + public annotatedStream?: (google.cloud.visionai.v1alpha1.IStreamWithAnnotation|null); + + /** InputResource consumerNode. */ + public consumerNode: string; + + /** InputResource inputResourceBinding. */ + public inputResourceBinding: string; + + /** InputResource annotations. */ + public annotations?: (google.cloud.visionai.v1alpha1.IResourceAnnotations|null); + + /** InputResource inputResourceInformation. */ + public inputResourceInformation?: ("inputResource"|"annotatedStream"); + + /** + * Creates a new InputResource instance using the specified properties. + * @param [properties] Properties to set + * @returns InputResource instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.Instance.IInputResource): google.cloud.visionai.v1alpha1.Instance.InputResource; + + /** + * Encodes the specified InputResource message. Does not implicitly {@link google.cloud.visionai.v1alpha1.Instance.InputResource.verify|verify} messages. + * @param message InputResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.Instance.IInputResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InputResource message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.Instance.InputResource.verify|verify} messages. + * @param message InputResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.Instance.IInputResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InputResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InputResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.Instance.InputResource; + + /** + * Decodes an InputResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InputResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.Instance.InputResource; + + /** + * Verifies an InputResource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InputResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InputResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.Instance.InputResource; + + /** + * Creates a plain object from an InputResource message. Also converts values to other types if specified. + * @param message InputResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.Instance.InputResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InputResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InputResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OutputResource. */ + interface IOutputResource { + + /** OutputResource outputResource */ + outputResource?: (string|null); + + /** OutputResource producerNode */ + producerNode?: (string|null); + + /** OutputResource outputResourceBinding */ + outputResourceBinding?: (string|null); + + /** OutputResource isTemporary */ + isTemporary?: (boolean|null); + + /** OutputResource autogen */ + autogen?: (boolean|null); + } + + /** Represents an OutputResource. */ + class OutputResource implements IOutputResource { + + /** + * Constructs a new OutputResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.Instance.IOutputResource); + + /** OutputResource outputResource. */ + public outputResource: string; + + /** OutputResource producerNode. */ + public producerNode: string; + + /** OutputResource outputResourceBinding. */ + public outputResourceBinding: string; + + /** OutputResource isTemporary. */ + public isTemporary: boolean; + + /** OutputResource autogen. */ + public autogen: boolean; + + /** + * Creates a new OutputResource instance using the specified properties. + * @param [properties] Properties to set + * @returns OutputResource instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.Instance.IOutputResource): google.cloud.visionai.v1alpha1.Instance.OutputResource; + + /** + * Encodes the specified OutputResource message. Does not implicitly {@link google.cloud.visionai.v1alpha1.Instance.OutputResource.verify|verify} messages. + * @param message OutputResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.Instance.IOutputResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OutputResource message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.Instance.OutputResource.verify|verify} messages. + * @param message OutputResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.Instance.IOutputResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OutputResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OutputResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.Instance.OutputResource; + + /** + * Decodes an OutputResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OutputResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.Instance.OutputResource; + + /** + * Verifies an OutputResource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OutputResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OutputResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.Instance.OutputResource; + + /** + * Creates a plain object from an OutputResource message. Also converts values to other types if specified. + * @param message OutputResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.Instance.OutputResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OutputResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OutputResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + CREATED = 2, + DEPLOYING = 3, + DEPLOYED = 4, + UNDEPLOYING = 5, + DELETED = 6, + ERROR = 7, + UPDATING = 8, + DELETING = 9, + FIXING = 10 + } + } + + /** Properties of an ApplicationInstance. */ + interface IApplicationInstance { + + /** ApplicationInstance instanceId */ + instanceId?: (string|null); + + /** ApplicationInstance instance */ + instance?: (google.cloud.visionai.v1alpha1.IInstance|null); + } + + /** Represents an ApplicationInstance. */ + class ApplicationInstance implements IApplicationInstance { + + /** + * Constructs a new ApplicationInstance. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IApplicationInstance); + + /** ApplicationInstance instanceId. */ + public instanceId: string; + + /** ApplicationInstance instance. */ + public instance?: (google.cloud.visionai.v1alpha1.IInstance|null); + + /** + * Creates a new ApplicationInstance instance using the specified properties. + * @param [properties] Properties to set + * @returns ApplicationInstance instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IApplicationInstance): google.cloud.visionai.v1alpha1.ApplicationInstance; + + /** + * Encodes the specified ApplicationInstance message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ApplicationInstance.verify|verify} messages. + * @param message ApplicationInstance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IApplicationInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApplicationInstance message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ApplicationInstance.verify|verify} messages. + * @param message ApplicationInstance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IApplicationInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApplicationInstance message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApplicationInstance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ApplicationInstance; + + /** + * Decodes an ApplicationInstance message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApplicationInstance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ApplicationInstance; + + /** + * Verifies an ApplicationInstance message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ApplicationInstance message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApplicationInstance + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ApplicationInstance; + + /** + * Creates a plain object from an ApplicationInstance message. Also converts values to other types if specified. + * @param message ApplicationInstance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ApplicationInstance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApplicationInstance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ApplicationInstance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Processor. */ + interface IProcessor { + + /** Processor name */ + name?: (string|null); + + /** Processor createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Processor updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Processor labels */ + labels?: ({ [k: string]: string }|null); + + /** Processor displayName */ + displayName?: (string|null); + + /** Processor description */ + description?: (string|null); + + /** Processor processorType */ + processorType?: (google.cloud.visionai.v1alpha1.Processor.ProcessorType|keyof typeof google.cloud.visionai.v1alpha1.Processor.ProcessorType|null); + + /** Processor modelType */ + modelType?: (google.cloud.visionai.v1alpha1.ModelType|keyof typeof google.cloud.visionai.v1alpha1.ModelType|null); + + /** Processor customProcessorSourceInfo */ + customProcessorSourceInfo?: (google.cloud.visionai.v1alpha1.ICustomProcessorSourceInfo|null); + + /** Processor state */ + state?: (google.cloud.visionai.v1alpha1.Processor.ProcessorState|keyof typeof google.cloud.visionai.v1alpha1.Processor.ProcessorState|null); + + /** Processor processorIoSpec */ + processorIoSpec?: (google.cloud.visionai.v1alpha1.IProcessorIOSpec|null); + + /** Processor configurationTypeurl */ + configurationTypeurl?: (string|null); + + /** Processor supportedAnnotationTypes */ + supportedAnnotationTypes?: (google.cloud.visionai.v1alpha1.StreamAnnotationType[]|null); + + /** Processor supportsPostProcessing */ + supportsPostProcessing?: (boolean|null); + } + + /** Represents a Processor. */ + class Processor implements IProcessor { + + /** + * Constructs a new Processor. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IProcessor); + + /** Processor name. */ + public name: string; + + /** Processor createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Processor updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Processor labels. */ + public labels: { [k: string]: string }; + + /** Processor displayName. */ + public displayName: string; + + /** Processor description. */ + public description: string; + + /** Processor processorType. */ + public processorType: (google.cloud.visionai.v1alpha1.Processor.ProcessorType|keyof typeof google.cloud.visionai.v1alpha1.Processor.ProcessorType); + + /** Processor modelType. */ + public modelType: (google.cloud.visionai.v1alpha1.ModelType|keyof typeof google.cloud.visionai.v1alpha1.ModelType); + + /** Processor customProcessorSourceInfo. */ + public customProcessorSourceInfo?: (google.cloud.visionai.v1alpha1.ICustomProcessorSourceInfo|null); + + /** Processor state. */ + public state: (google.cloud.visionai.v1alpha1.Processor.ProcessorState|keyof typeof google.cloud.visionai.v1alpha1.Processor.ProcessorState); + + /** Processor processorIoSpec. */ + public processorIoSpec?: (google.cloud.visionai.v1alpha1.IProcessorIOSpec|null); + + /** Processor configurationTypeurl. */ + public configurationTypeurl: string; + + /** Processor supportedAnnotationTypes. */ + public supportedAnnotationTypes: google.cloud.visionai.v1alpha1.StreamAnnotationType[]; + + /** Processor supportsPostProcessing. */ + public supportsPostProcessing: boolean; + + /** + * Creates a new Processor instance using the specified properties. + * @param [properties] Properties to set + * @returns Processor instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IProcessor): google.cloud.visionai.v1alpha1.Processor; + + /** + * Encodes the specified Processor message. Does not implicitly {@link google.cloud.visionai.v1alpha1.Processor.verify|verify} messages. + * @param message Processor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IProcessor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Processor message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.Processor.verify|verify} messages. + * @param message Processor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IProcessor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Processor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Processor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.Processor; + + /** + * Decodes a Processor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Processor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.Processor; + + /** + * Verifies a Processor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Processor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Processor + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.Processor; + + /** + * Creates a plain object from a Processor message. Also converts values to other types if specified. + * @param message Processor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.Processor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Processor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Processor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Processor { + + /** ProcessorType enum. */ + enum ProcessorType { + PROCESSOR_TYPE_UNSPECIFIED = 0, + PRETRAINED = 1, + CUSTOM = 2, + CONNECTOR = 3 + } + + /** ProcessorState enum. */ + enum ProcessorState { + PROCESSOR_STATE_UNSPECIFIED = 0, + CREATING = 1, + ACTIVE = 2, + DELETING = 3, + FAILED = 4 + } + } + + /** Properties of a ProcessorIOSpec. */ + interface IProcessorIOSpec { + + /** ProcessorIOSpec graphInputChannelSpecs */ + graphInputChannelSpecs?: (google.cloud.visionai.v1alpha1.ProcessorIOSpec.IGraphInputChannelSpec[]|null); + + /** ProcessorIOSpec graphOutputChannelSpecs */ + graphOutputChannelSpecs?: (google.cloud.visionai.v1alpha1.ProcessorIOSpec.IGraphOutputChannelSpec[]|null); + + /** ProcessorIOSpec instanceResourceInputBindingSpecs */ + instanceResourceInputBindingSpecs?: (google.cloud.visionai.v1alpha1.ProcessorIOSpec.IInstanceResourceInputBindingSpec[]|null); + + /** ProcessorIOSpec instanceResourceOutputBindingSpecs */ + instanceResourceOutputBindingSpecs?: (google.cloud.visionai.v1alpha1.ProcessorIOSpec.IInstanceResourceOutputBindingSpec[]|null); + } + + /** Represents a ProcessorIOSpec. */ + class ProcessorIOSpec implements IProcessorIOSpec { + + /** + * Constructs a new ProcessorIOSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IProcessorIOSpec); + + /** ProcessorIOSpec graphInputChannelSpecs. */ + public graphInputChannelSpecs: google.cloud.visionai.v1alpha1.ProcessorIOSpec.IGraphInputChannelSpec[]; + + /** ProcessorIOSpec graphOutputChannelSpecs. */ + public graphOutputChannelSpecs: google.cloud.visionai.v1alpha1.ProcessorIOSpec.IGraphOutputChannelSpec[]; + + /** ProcessorIOSpec instanceResourceInputBindingSpecs. */ + public instanceResourceInputBindingSpecs: google.cloud.visionai.v1alpha1.ProcessorIOSpec.IInstanceResourceInputBindingSpec[]; + + /** ProcessorIOSpec instanceResourceOutputBindingSpecs. */ + public instanceResourceOutputBindingSpecs: google.cloud.visionai.v1alpha1.ProcessorIOSpec.IInstanceResourceOutputBindingSpec[]; + + /** + * Creates a new ProcessorIOSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns ProcessorIOSpec instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IProcessorIOSpec): google.cloud.visionai.v1alpha1.ProcessorIOSpec; + + /** + * Encodes the specified ProcessorIOSpec message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ProcessorIOSpec.verify|verify} messages. + * @param message ProcessorIOSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IProcessorIOSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProcessorIOSpec message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ProcessorIOSpec.verify|verify} messages. + * @param message ProcessorIOSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IProcessorIOSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProcessorIOSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProcessorIOSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ProcessorIOSpec; + + /** + * Decodes a ProcessorIOSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProcessorIOSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ProcessorIOSpec; + + /** + * Verifies a ProcessorIOSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProcessorIOSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProcessorIOSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ProcessorIOSpec; + + /** + * Creates a plain object from a ProcessorIOSpec message. Also converts values to other types if specified. + * @param message ProcessorIOSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ProcessorIOSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProcessorIOSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ProcessorIOSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ProcessorIOSpec { + + /** Properties of a GraphInputChannelSpec. */ + interface IGraphInputChannelSpec { + + /** GraphInputChannelSpec name */ + name?: (string|null); + + /** GraphInputChannelSpec dataType */ + dataType?: (google.cloud.visionai.v1alpha1.ProcessorIOSpec.DataType|keyof typeof google.cloud.visionai.v1alpha1.ProcessorIOSpec.DataType|null); + + /** GraphInputChannelSpec acceptedDataTypeUris */ + acceptedDataTypeUris?: (string[]|null); + + /** GraphInputChannelSpec required */ + required?: (boolean|null); + + /** GraphInputChannelSpec maxConnectionAllowed */ + maxConnectionAllowed?: (number|Long|string|null); + } + + /** Represents a GraphInputChannelSpec. */ + class GraphInputChannelSpec implements IGraphInputChannelSpec { + + /** + * Constructs a new GraphInputChannelSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.ProcessorIOSpec.IGraphInputChannelSpec); + + /** GraphInputChannelSpec name. */ + public name: string; + + /** GraphInputChannelSpec dataType. */ + public dataType: (google.cloud.visionai.v1alpha1.ProcessorIOSpec.DataType|keyof typeof google.cloud.visionai.v1alpha1.ProcessorIOSpec.DataType); + + /** GraphInputChannelSpec acceptedDataTypeUris. */ + public acceptedDataTypeUris: string[]; + + /** GraphInputChannelSpec required. */ + public required: boolean; + + /** GraphInputChannelSpec maxConnectionAllowed. */ + public maxConnectionAllowed: (number|Long|string); + + /** + * Creates a new GraphInputChannelSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns GraphInputChannelSpec instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.ProcessorIOSpec.IGraphInputChannelSpec): google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphInputChannelSpec; + + /** + * Encodes the specified GraphInputChannelSpec message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphInputChannelSpec.verify|verify} messages. + * @param message GraphInputChannelSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.ProcessorIOSpec.IGraphInputChannelSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GraphInputChannelSpec message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphInputChannelSpec.verify|verify} messages. + * @param message GraphInputChannelSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.ProcessorIOSpec.IGraphInputChannelSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GraphInputChannelSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GraphInputChannelSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphInputChannelSpec; + + /** + * Decodes a GraphInputChannelSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GraphInputChannelSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphInputChannelSpec; + + /** + * Verifies a GraphInputChannelSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GraphInputChannelSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GraphInputChannelSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphInputChannelSpec; + + /** + * Creates a plain object from a GraphInputChannelSpec message. Also converts values to other types if specified. + * @param message GraphInputChannelSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphInputChannelSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GraphInputChannelSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GraphInputChannelSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GraphOutputChannelSpec. */ + interface IGraphOutputChannelSpec { + + /** GraphOutputChannelSpec name */ + name?: (string|null); + + /** GraphOutputChannelSpec dataType */ + dataType?: (google.cloud.visionai.v1alpha1.ProcessorIOSpec.DataType|keyof typeof google.cloud.visionai.v1alpha1.ProcessorIOSpec.DataType|null); + + /** GraphOutputChannelSpec dataTypeUri */ + dataTypeUri?: (string|null); + } + + /** Represents a GraphOutputChannelSpec. */ + class GraphOutputChannelSpec implements IGraphOutputChannelSpec { + + /** + * Constructs a new GraphOutputChannelSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.ProcessorIOSpec.IGraphOutputChannelSpec); + + /** GraphOutputChannelSpec name. */ + public name: string; + + /** GraphOutputChannelSpec dataType. */ + public dataType: (google.cloud.visionai.v1alpha1.ProcessorIOSpec.DataType|keyof typeof google.cloud.visionai.v1alpha1.ProcessorIOSpec.DataType); + + /** GraphOutputChannelSpec dataTypeUri. */ + public dataTypeUri: string; + + /** + * Creates a new GraphOutputChannelSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns GraphOutputChannelSpec instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.ProcessorIOSpec.IGraphOutputChannelSpec): google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphOutputChannelSpec; + + /** + * Encodes the specified GraphOutputChannelSpec message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphOutputChannelSpec.verify|verify} messages. + * @param message GraphOutputChannelSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.ProcessorIOSpec.IGraphOutputChannelSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GraphOutputChannelSpec message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphOutputChannelSpec.verify|verify} messages. + * @param message GraphOutputChannelSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.ProcessorIOSpec.IGraphOutputChannelSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GraphOutputChannelSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GraphOutputChannelSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphOutputChannelSpec; + + /** + * Decodes a GraphOutputChannelSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GraphOutputChannelSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphOutputChannelSpec; + + /** + * Verifies a GraphOutputChannelSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GraphOutputChannelSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GraphOutputChannelSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphOutputChannelSpec; + + /** + * Creates a plain object from a GraphOutputChannelSpec message. Also converts values to other types if specified. + * @param message GraphOutputChannelSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphOutputChannelSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GraphOutputChannelSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GraphOutputChannelSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InstanceResourceInputBindingSpec. */ + interface IInstanceResourceInputBindingSpec { + + /** InstanceResourceInputBindingSpec configTypeUri */ + configTypeUri?: (string|null); + + /** InstanceResourceInputBindingSpec resourceTypeUri */ + resourceTypeUri?: (string|null); + + /** InstanceResourceInputBindingSpec name */ + name?: (string|null); + } + + /** Represents an InstanceResourceInputBindingSpec. */ + class InstanceResourceInputBindingSpec implements IInstanceResourceInputBindingSpec { + + /** + * Constructs a new InstanceResourceInputBindingSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.ProcessorIOSpec.IInstanceResourceInputBindingSpec); + + /** InstanceResourceInputBindingSpec configTypeUri. */ + public configTypeUri?: (string|null); + + /** InstanceResourceInputBindingSpec resourceTypeUri. */ + public resourceTypeUri?: (string|null); + + /** InstanceResourceInputBindingSpec name. */ + public name: string; + + /** InstanceResourceInputBindingSpec resourceType. */ + public resourceType?: ("configTypeUri"|"resourceTypeUri"); + + /** + * Creates a new InstanceResourceInputBindingSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceResourceInputBindingSpec instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.ProcessorIOSpec.IInstanceResourceInputBindingSpec): google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceInputBindingSpec; + + /** + * Encodes the specified InstanceResourceInputBindingSpec message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceInputBindingSpec.verify|verify} messages. + * @param message InstanceResourceInputBindingSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.ProcessorIOSpec.IInstanceResourceInputBindingSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceResourceInputBindingSpec message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceInputBindingSpec.verify|verify} messages. + * @param message InstanceResourceInputBindingSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.ProcessorIOSpec.IInstanceResourceInputBindingSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceResourceInputBindingSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceResourceInputBindingSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceInputBindingSpec; + + /** + * Decodes an InstanceResourceInputBindingSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceResourceInputBindingSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceInputBindingSpec; + + /** + * Verifies an InstanceResourceInputBindingSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceResourceInputBindingSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceResourceInputBindingSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceInputBindingSpec; + + /** + * Creates a plain object from an InstanceResourceInputBindingSpec message. Also converts values to other types if specified. + * @param message InstanceResourceInputBindingSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceInputBindingSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceResourceInputBindingSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InstanceResourceInputBindingSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InstanceResourceOutputBindingSpec. */ + interface IInstanceResourceOutputBindingSpec { + + /** InstanceResourceOutputBindingSpec name */ + name?: (string|null); + + /** InstanceResourceOutputBindingSpec resourceTypeUri */ + resourceTypeUri?: (string|null); + + /** InstanceResourceOutputBindingSpec explicit */ + explicit?: (boolean|null); + } + + /** Represents an InstanceResourceOutputBindingSpec. */ + class InstanceResourceOutputBindingSpec implements IInstanceResourceOutputBindingSpec { + + /** + * Constructs a new InstanceResourceOutputBindingSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.ProcessorIOSpec.IInstanceResourceOutputBindingSpec); + + /** InstanceResourceOutputBindingSpec name. */ + public name: string; + + /** InstanceResourceOutputBindingSpec resourceTypeUri. */ + public resourceTypeUri: string; + + /** InstanceResourceOutputBindingSpec explicit. */ + public explicit: boolean; + + /** + * Creates a new InstanceResourceOutputBindingSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceResourceOutputBindingSpec instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.ProcessorIOSpec.IInstanceResourceOutputBindingSpec): google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceOutputBindingSpec; + + /** + * Encodes the specified InstanceResourceOutputBindingSpec message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceOutputBindingSpec.verify|verify} messages. + * @param message InstanceResourceOutputBindingSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.ProcessorIOSpec.IInstanceResourceOutputBindingSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceResourceOutputBindingSpec message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceOutputBindingSpec.verify|verify} messages. + * @param message InstanceResourceOutputBindingSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.ProcessorIOSpec.IInstanceResourceOutputBindingSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceResourceOutputBindingSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceResourceOutputBindingSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceOutputBindingSpec; + + /** + * Decodes an InstanceResourceOutputBindingSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceResourceOutputBindingSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceOutputBindingSpec; + + /** + * Verifies an InstanceResourceOutputBindingSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceResourceOutputBindingSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceResourceOutputBindingSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceOutputBindingSpec; + + /** + * Creates a plain object from an InstanceResourceOutputBindingSpec message. Also converts values to other types if specified. + * @param message InstanceResourceOutputBindingSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceOutputBindingSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceResourceOutputBindingSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InstanceResourceOutputBindingSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** DataType enum. */ + enum DataType { + DATA_TYPE_UNSPECIFIED = 0, + VIDEO = 1, + PROTO = 2 + } + } + + /** Properties of a CustomProcessorSourceInfo. */ + interface ICustomProcessorSourceInfo { + + /** CustomProcessorSourceInfo vertexModel */ + vertexModel?: (string|null); + + /** CustomProcessorSourceInfo sourceType */ + sourceType?: (google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.SourceType|keyof typeof google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.SourceType|null); + + /** CustomProcessorSourceInfo additionalInfo */ + additionalInfo?: ({ [k: string]: string }|null); + + /** CustomProcessorSourceInfo modelSchema */ + modelSchema?: (google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.IModelSchema|null); + } + + /** Represents a CustomProcessorSourceInfo. */ + class CustomProcessorSourceInfo implements ICustomProcessorSourceInfo { + + /** + * Constructs a new CustomProcessorSourceInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.ICustomProcessorSourceInfo); + + /** CustomProcessorSourceInfo vertexModel. */ + public vertexModel?: (string|null); + + /** CustomProcessorSourceInfo sourceType. */ + public sourceType: (google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.SourceType|keyof typeof google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.SourceType); + + /** CustomProcessorSourceInfo additionalInfo. */ + public additionalInfo: { [k: string]: string }; + + /** CustomProcessorSourceInfo modelSchema. */ + public modelSchema?: (google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.IModelSchema|null); + + /** CustomProcessorSourceInfo artifactPath. */ + public artifactPath?: "vertexModel"; + + /** + * Creates a new CustomProcessorSourceInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomProcessorSourceInfo instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.ICustomProcessorSourceInfo): google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo; + + /** + * Encodes the specified CustomProcessorSourceInfo message. Does not implicitly {@link google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.verify|verify} messages. + * @param message CustomProcessorSourceInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.ICustomProcessorSourceInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomProcessorSourceInfo message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.verify|verify} messages. + * @param message CustomProcessorSourceInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.ICustomProcessorSourceInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomProcessorSourceInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomProcessorSourceInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo; + + /** + * Decodes a CustomProcessorSourceInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomProcessorSourceInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo; + + /** + * Verifies a CustomProcessorSourceInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomProcessorSourceInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomProcessorSourceInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo; + + /** + * Creates a plain object from a CustomProcessorSourceInfo message. Also converts values to other types if specified. + * @param message CustomProcessorSourceInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomProcessorSourceInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomProcessorSourceInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CustomProcessorSourceInfo { + + /** Properties of a ModelSchema. */ + interface IModelSchema { + + /** ModelSchema instancesSchema */ + instancesSchema?: (google.cloud.visionai.v1alpha1.IGcsSource|null); + + /** ModelSchema parametersSchema */ + parametersSchema?: (google.cloud.visionai.v1alpha1.IGcsSource|null); + + /** ModelSchema predictionsSchema */ + predictionsSchema?: (google.cloud.visionai.v1alpha1.IGcsSource|null); + } + + /** Represents a ModelSchema. */ + class ModelSchema implements IModelSchema { + + /** + * Constructs a new ModelSchema. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.IModelSchema); + + /** ModelSchema instancesSchema. */ + public instancesSchema?: (google.cloud.visionai.v1alpha1.IGcsSource|null); + + /** ModelSchema parametersSchema. */ + public parametersSchema?: (google.cloud.visionai.v1alpha1.IGcsSource|null); + + /** ModelSchema predictionsSchema. */ + public predictionsSchema?: (google.cloud.visionai.v1alpha1.IGcsSource|null); + + /** + * Creates a new ModelSchema instance using the specified properties. + * @param [properties] Properties to set + * @returns ModelSchema instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.IModelSchema): google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.ModelSchema; + + /** + * Encodes the specified ModelSchema message. Does not implicitly {@link google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.ModelSchema.verify|verify} messages. + * @param message ModelSchema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.IModelSchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ModelSchema message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.ModelSchema.verify|verify} messages. + * @param message ModelSchema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.IModelSchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ModelSchema message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ModelSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.ModelSchema; + + /** + * Decodes a ModelSchema message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ModelSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.ModelSchema; + + /** + * Verifies a ModelSchema message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ModelSchema message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ModelSchema + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.ModelSchema; + + /** + * Creates a plain object from a ModelSchema message. Also converts values to other types if specified. + * @param message ModelSchema + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.ModelSchema, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ModelSchema to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ModelSchema + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** SourceType enum. */ + enum SourceType { + SOURCE_TYPE_UNSPECIFIED = 0, + VERTEX_AUTOML = 1, + VERTEX_CUSTOM = 2 + } + } + + /** Properties of a ProcessorConfig. */ + interface IProcessorConfig { + + /** ProcessorConfig videoStreamInputConfig */ + videoStreamInputConfig?: (google.cloud.visionai.v1alpha1.IVideoStreamInputConfig|null); + + /** ProcessorConfig aiEnabledDevicesInputConfig */ + aiEnabledDevicesInputConfig?: (google.cloud.visionai.v1alpha1.IAIEnabledDevicesInputConfig|null); + + /** ProcessorConfig mediaWarehouseConfig */ + mediaWarehouseConfig?: (google.cloud.visionai.v1alpha1.IMediaWarehouseConfig|null); + + /** ProcessorConfig personBlurConfig */ + personBlurConfig?: (google.cloud.visionai.v1alpha1.IPersonBlurConfig|null); + + /** ProcessorConfig occupancyCountConfig */ + occupancyCountConfig?: (google.cloud.visionai.v1alpha1.IOccupancyCountConfig|null); + + /** ProcessorConfig personVehicleDetectionConfig */ + personVehicleDetectionConfig?: (google.cloud.visionai.v1alpha1.IPersonVehicleDetectionConfig|null); + + /** ProcessorConfig vertexAutomlVisionConfig */ + vertexAutomlVisionConfig?: (google.cloud.visionai.v1alpha1.IVertexAutoMLVisionConfig|null); + + /** ProcessorConfig vertexAutomlVideoConfig */ + vertexAutomlVideoConfig?: (google.cloud.visionai.v1alpha1.IVertexAutoMLVideoConfig|null); + + /** ProcessorConfig vertexCustomConfig */ + vertexCustomConfig?: (google.cloud.visionai.v1alpha1.IVertexCustomConfig|null); + + /** ProcessorConfig generalObjectDetectionConfig */ + generalObjectDetectionConfig?: (google.cloud.visionai.v1alpha1.IGeneralObjectDetectionConfig|null); + + /** ProcessorConfig bigQueryConfig */ + bigQueryConfig?: (google.cloud.visionai.v1alpha1.IBigQueryConfig|null); + + /** ProcessorConfig personalProtectiveEquipmentDetectionConfig */ + personalProtectiveEquipmentDetectionConfig?: (google.cloud.visionai.v1alpha1.IPersonalProtectiveEquipmentDetectionConfig|null); + } + + /** Represents a ProcessorConfig. */ + class ProcessorConfig implements IProcessorConfig { + + /** + * Constructs a new ProcessorConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IProcessorConfig); + + /** ProcessorConfig videoStreamInputConfig. */ + public videoStreamInputConfig?: (google.cloud.visionai.v1alpha1.IVideoStreamInputConfig|null); + + /** ProcessorConfig aiEnabledDevicesInputConfig. */ + public aiEnabledDevicesInputConfig?: (google.cloud.visionai.v1alpha1.IAIEnabledDevicesInputConfig|null); + + /** ProcessorConfig mediaWarehouseConfig. */ + public mediaWarehouseConfig?: (google.cloud.visionai.v1alpha1.IMediaWarehouseConfig|null); + + /** ProcessorConfig personBlurConfig. */ + public personBlurConfig?: (google.cloud.visionai.v1alpha1.IPersonBlurConfig|null); + + /** ProcessorConfig occupancyCountConfig. */ + public occupancyCountConfig?: (google.cloud.visionai.v1alpha1.IOccupancyCountConfig|null); + + /** ProcessorConfig personVehicleDetectionConfig. */ + public personVehicleDetectionConfig?: (google.cloud.visionai.v1alpha1.IPersonVehicleDetectionConfig|null); + + /** ProcessorConfig vertexAutomlVisionConfig. */ + public vertexAutomlVisionConfig?: (google.cloud.visionai.v1alpha1.IVertexAutoMLVisionConfig|null); + + /** ProcessorConfig vertexAutomlVideoConfig. */ + public vertexAutomlVideoConfig?: (google.cloud.visionai.v1alpha1.IVertexAutoMLVideoConfig|null); + + /** ProcessorConfig vertexCustomConfig. */ + public vertexCustomConfig?: (google.cloud.visionai.v1alpha1.IVertexCustomConfig|null); + + /** ProcessorConfig generalObjectDetectionConfig. */ + public generalObjectDetectionConfig?: (google.cloud.visionai.v1alpha1.IGeneralObjectDetectionConfig|null); + + /** ProcessorConfig bigQueryConfig. */ + public bigQueryConfig?: (google.cloud.visionai.v1alpha1.IBigQueryConfig|null); + + /** ProcessorConfig personalProtectiveEquipmentDetectionConfig. */ + public personalProtectiveEquipmentDetectionConfig?: (google.cloud.visionai.v1alpha1.IPersonalProtectiveEquipmentDetectionConfig|null); + + /** ProcessorConfig processorConfig. */ + public processorConfig?: ("videoStreamInputConfig"|"aiEnabledDevicesInputConfig"|"mediaWarehouseConfig"|"personBlurConfig"|"occupancyCountConfig"|"personVehicleDetectionConfig"|"vertexAutomlVisionConfig"|"vertexAutomlVideoConfig"|"vertexCustomConfig"|"generalObjectDetectionConfig"|"bigQueryConfig"|"personalProtectiveEquipmentDetectionConfig"); + + /** + * Creates a new ProcessorConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ProcessorConfig instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IProcessorConfig): google.cloud.visionai.v1alpha1.ProcessorConfig; + + /** + * Encodes the specified ProcessorConfig message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ProcessorConfig.verify|verify} messages. + * @param message ProcessorConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IProcessorConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProcessorConfig message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ProcessorConfig.verify|verify} messages. + * @param message ProcessorConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IProcessorConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProcessorConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProcessorConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ProcessorConfig; + + /** + * Decodes a ProcessorConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProcessorConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ProcessorConfig; + + /** + * Verifies a ProcessorConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProcessorConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProcessorConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ProcessorConfig; + + /** + * Creates a plain object from a ProcessorConfig message. Also converts values to other types if specified. + * @param message ProcessorConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ProcessorConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProcessorConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ProcessorConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StreamWithAnnotation. */ + interface IStreamWithAnnotation { + + /** StreamWithAnnotation stream */ + stream?: (string|null); + + /** StreamWithAnnotation applicationAnnotations */ + applicationAnnotations?: (google.cloud.visionai.v1alpha1.IStreamAnnotation[]|null); + + /** StreamWithAnnotation nodeAnnotations */ + nodeAnnotations?: (google.cloud.visionai.v1alpha1.StreamWithAnnotation.INodeAnnotation[]|null); + } + + /** Represents a StreamWithAnnotation. */ + class StreamWithAnnotation implements IStreamWithAnnotation { + + /** + * Constructs a new StreamWithAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IStreamWithAnnotation); + + /** StreamWithAnnotation stream. */ + public stream: string; + + /** StreamWithAnnotation applicationAnnotations. */ + public applicationAnnotations: google.cloud.visionai.v1alpha1.IStreamAnnotation[]; + + /** StreamWithAnnotation nodeAnnotations. */ + public nodeAnnotations: google.cloud.visionai.v1alpha1.StreamWithAnnotation.INodeAnnotation[]; + + /** + * Creates a new StreamWithAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamWithAnnotation instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IStreamWithAnnotation): google.cloud.visionai.v1alpha1.StreamWithAnnotation; + + /** + * Encodes the specified StreamWithAnnotation message. Does not implicitly {@link google.cloud.visionai.v1alpha1.StreamWithAnnotation.verify|verify} messages. + * @param message StreamWithAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IStreamWithAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamWithAnnotation message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.StreamWithAnnotation.verify|verify} messages. + * @param message StreamWithAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IStreamWithAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamWithAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamWithAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.StreamWithAnnotation; + + /** + * Decodes a StreamWithAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamWithAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.StreamWithAnnotation; + + /** + * Verifies a StreamWithAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamWithAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamWithAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.StreamWithAnnotation; + + /** + * Creates a plain object from a StreamWithAnnotation message. Also converts values to other types if specified. + * @param message StreamWithAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.StreamWithAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamWithAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamWithAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace StreamWithAnnotation { + + /** Properties of a NodeAnnotation. */ + interface INodeAnnotation { + + /** NodeAnnotation node */ + node?: (string|null); + + /** NodeAnnotation annotations */ + annotations?: (google.cloud.visionai.v1alpha1.IStreamAnnotation[]|null); + } + + /** Represents a NodeAnnotation. */ + class NodeAnnotation implements INodeAnnotation { + + /** + * Constructs a new NodeAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.StreamWithAnnotation.INodeAnnotation); + + /** NodeAnnotation node. */ + public node: string; + + /** NodeAnnotation annotations. */ + public annotations: google.cloud.visionai.v1alpha1.IStreamAnnotation[]; + + /** + * Creates a new NodeAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAnnotation instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.StreamWithAnnotation.INodeAnnotation): google.cloud.visionai.v1alpha1.StreamWithAnnotation.NodeAnnotation; + + /** + * Encodes the specified NodeAnnotation message. Does not implicitly {@link google.cloud.visionai.v1alpha1.StreamWithAnnotation.NodeAnnotation.verify|verify} messages. + * @param message NodeAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.StreamWithAnnotation.INodeAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeAnnotation message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.StreamWithAnnotation.NodeAnnotation.verify|verify} messages. + * @param message NodeAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.StreamWithAnnotation.INodeAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.StreamWithAnnotation.NodeAnnotation; + + /** + * Decodes a NodeAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.StreamWithAnnotation.NodeAnnotation; + + /** + * Verifies a NodeAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.StreamWithAnnotation.NodeAnnotation; + + /** + * Creates a plain object from a NodeAnnotation message. Also converts values to other types if specified. + * @param message NodeAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.StreamWithAnnotation.NodeAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ApplicationNodeAnnotation. */ + interface IApplicationNodeAnnotation { + + /** ApplicationNodeAnnotation node */ + node?: (string|null); + + /** ApplicationNodeAnnotation annotations */ + annotations?: (google.cloud.visionai.v1alpha1.IStreamAnnotation[]|null); + } + + /** Represents an ApplicationNodeAnnotation. */ + class ApplicationNodeAnnotation implements IApplicationNodeAnnotation { + + /** + * Constructs a new ApplicationNodeAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IApplicationNodeAnnotation); + + /** ApplicationNodeAnnotation node. */ + public node: string; + + /** ApplicationNodeAnnotation annotations. */ + public annotations: google.cloud.visionai.v1alpha1.IStreamAnnotation[]; + + /** + * Creates a new ApplicationNodeAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns ApplicationNodeAnnotation instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IApplicationNodeAnnotation): google.cloud.visionai.v1alpha1.ApplicationNodeAnnotation; + + /** + * Encodes the specified ApplicationNodeAnnotation message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ApplicationNodeAnnotation.verify|verify} messages. + * @param message ApplicationNodeAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IApplicationNodeAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApplicationNodeAnnotation message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ApplicationNodeAnnotation.verify|verify} messages. + * @param message ApplicationNodeAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IApplicationNodeAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApplicationNodeAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApplicationNodeAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ApplicationNodeAnnotation; + + /** + * Decodes an ApplicationNodeAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApplicationNodeAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ApplicationNodeAnnotation; + + /** + * Verifies an ApplicationNodeAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ApplicationNodeAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApplicationNodeAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ApplicationNodeAnnotation; + + /** + * Creates a plain object from an ApplicationNodeAnnotation message. Also converts values to other types if specified. + * @param message ApplicationNodeAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ApplicationNodeAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApplicationNodeAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ApplicationNodeAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ResourceAnnotations. */ + interface IResourceAnnotations { + + /** ResourceAnnotations applicationAnnotations */ + applicationAnnotations?: (google.cloud.visionai.v1alpha1.IStreamAnnotation[]|null); + + /** ResourceAnnotations nodeAnnotations */ + nodeAnnotations?: (google.cloud.visionai.v1alpha1.IApplicationNodeAnnotation[]|null); + } + + /** Represents a ResourceAnnotations. */ + class ResourceAnnotations implements IResourceAnnotations { + + /** + * Constructs a new ResourceAnnotations. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IResourceAnnotations); + + /** ResourceAnnotations applicationAnnotations. */ + public applicationAnnotations: google.cloud.visionai.v1alpha1.IStreamAnnotation[]; + + /** ResourceAnnotations nodeAnnotations. */ + public nodeAnnotations: google.cloud.visionai.v1alpha1.IApplicationNodeAnnotation[]; + + /** + * Creates a new ResourceAnnotations instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceAnnotations instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IResourceAnnotations): google.cloud.visionai.v1alpha1.ResourceAnnotations; + + /** + * Encodes the specified ResourceAnnotations message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ResourceAnnotations.verify|verify} messages. + * @param message ResourceAnnotations message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IResourceAnnotations, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceAnnotations message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ResourceAnnotations.verify|verify} messages. + * @param message ResourceAnnotations message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IResourceAnnotations, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceAnnotations message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceAnnotations + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ResourceAnnotations; + + /** + * Decodes a ResourceAnnotations message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceAnnotations + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ResourceAnnotations; + + /** + * Verifies a ResourceAnnotations message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceAnnotations message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceAnnotations + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ResourceAnnotations; + + /** + * Creates a plain object from a ResourceAnnotations message. Also converts values to other types if specified. + * @param message ResourceAnnotations + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ResourceAnnotations, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceAnnotations to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceAnnotations + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VideoStreamInputConfig. */ + interface IVideoStreamInputConfig { + + /** VideoStreamInputConfig streams */ + streams?: (string[]|null); + + /** VideoStreamInputConfig streamsWithAnnotation */ + streamsWithAnnotation?: (google.cloud.visionai.v1alpha1.IStreamWithAnnotation[]|null); + } + + /** Represents a VideoStreamInputConfig. */ + class VideoStreamInputConfig implements IVideoStreamInputConfig { + + /** + * Constructs a new VideoStreamInputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IVideoStreamInputConfig); + + /** VideoStreamInputConfig streams. */ + public streams: string[]; + + /** VideoStreamInputConfig streamsWithAnnotation. */ + public streamsWithAnnotation: google.cloud.visionai.v1alpha1.IStreamWithAnnotation[]; + + /** + * Creates a new VideoStreamInputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns VideoStreamInputConfig instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IVideoStreamInputConfig): google.cloud.visionai.v1alpha1.VideoStreamInputConfig; + + /** + * Encodes the specified VideoStreamInputConfig message. Does not implicitly {@link google.cloud.visionai.v1alpha1.VideoStreamInputConfig.verify|verify} messages. + * @param message VideoStreamInputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IVideoStreamInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VideoStreamInputConfig message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.VideoStreamInputConfig.verify|verify} messages. + * @param message VideoStreamInputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IVideoStreamInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VideoStreamInputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VideoStreamInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.VideoStreamInputConfig; + + /** + * Decodes a VideoStreamInputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VideoStreamInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.VideoStreamInputConfig; + + /** + * Verifies a VideoStreamInputConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VideoStreamInputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VideoStreamInputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.VideoStreamInputConfig; + + /** + * Creates a plain object from a VideoStreamInputConfig message. Also converts values to other types if specified. + * @param message VideoStreamInputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.VideoStreamInputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VideoStreamInputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VideoStreamInputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a AIEnabledDevicesInputConfig. */ + interface IAIEnabledDevicesInputConfig { + } + + /** Represents a AIEnabledDevicesInputConfig. */ + class AIEnabledDevicesInputConfig implements IAIEnabledDevicesInputConfig { + + /** + * Constructs a new AIEnabledDevicesInputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IAIEnabledDevicesInputConfig); + + /** + * Creates a new AIEnabledDevicesInputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AIEnabledDevicesInputConfig instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IAIEnabledDevicesInputConfig): google.cloud.visionai.v1alpha1.AIEnabledDevicesInputConfig; + + /** + * Encodes the specified AIEnabledDevicesInputConfig message. Does not implicitly {@link google.cloud.visionai.v1alpha1.AIEnabledDevicesInputConfig.verify|verify} messages. + * @param message AIEnabledDevicesInputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IAIEnabledDevicesInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AIEnabledDevicesInputConfig message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.AIEnabledDevicesInputConfig.verify|verify} messages. + * @param message AIEnabledDevicesInputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IAIEnabledDevicesInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a AIEnabledDevicesInputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AIEnabledDevicesInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.AIEnabledDevicesInputConfig; + + /** + * Decodes a AIEnabledDevicesInputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AIEnabledDevicesInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.AIEnabledDevicesInputConfig; + + /** + * Verifies a AIEnabledDevicesInputConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a AIEnabledDevicesInputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AIEnabledDevicesInputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.AIEnabledDevicesInputConfig; + + /** + * Creates a plain object from a AIEnabledDevicesInputConfig message. Also converts values to other types if specified. + * @param message AIEnabledDevicesInputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.AIEnabledDevicesInputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AIEnabledDevicesInputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AIEnabledDevicesInputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MediaWarehouseConfig. */ + interface IMediaWarehouseConfig { + + /** MediaWarehouseConfig corpus */ + corpus?: (string|null); + + /** MediaWarehouseConfig region */ + region?: (string|null); + + /** MediaWarehouseConfig ttl */ + ttl?: (google.protobuf.IDuration|null); + } + + /** Represents a MediaWarehouseConfig. */ + class MediaWarehouseConfig implements IMediaWarehouseConfig { + + /** + * Constructs a new MediaWarehouseConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IMediaWarehouseConfig); + + /** MediaWarehouseConfig corpus. */ + public corpus: string; + + /** MediaWarehouseConfig region. */ + public region: string; + + /** MediaWarehouseConfig ttl. */ + public ttl?: (google.protobuf.IDuration|null); + + /** + * Creates a new MediaWarehouseConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns MediaWarehouseConfig instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IMediaWarehouseConfig): google.cloud.visionai.v1alpha1.MediaWarehouseConfig; + + /** + * Encodes the specified MediaWarehouseConfig message. Does not implicitly {@link google.cloud.visionai.v1alpha1.MediaWarehouseConfig.verify|verify} messages. + * @param message MediaWarehouseConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IMediaWarehouseConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MediaWarehouseConfig message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.MediaWarehouseConfig.verify|verify} messages. + * @param message MediaWarehouseConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IMediaWarehouseConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MediaWarehouseConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MediaWarehouseConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.MediaWarehouseConfig; + + /** + * Decodes a MediaWarehouseConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MediaWarehouseConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.MediaWarehouseConfig; + + /** + * Verifies a MediaWarehouseConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MediaWarehouseConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MediaWarehouseConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.MediaWarehouseConfig; + + /** + * Creates a plain object from a MediaWarehouseConfig message. Also converts values to other types if specified. + * @param message MediaWarehouseConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.MediaWarehouseConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MediaWarehouseConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MediaWarehouseConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PersonBlurConfig. */ + interface IPersonBlurConfig { + + /** PersonBlurConfig personBlurType */ + personBlurType?: (google.cloud.visionai.v1alpha1.PersonBlurConfig.PersonBlurType|keyof typeof google.cloud.visionai.v1alpha1.PersonBlurConfig.PersonBlurType|null); + + /** PersonBlurConfig facesOnly */ + facesOnly?: (boolean|null); + } + + /** Represents a PersonBlurConfig. */ + class PersonBlurConfig implements IPersonBlurConfig { + + /** + * Constructs a new PersonBlurConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IPersonBlurConfig); + + /** PersonBlurConfig personBlurType. */ + public personBlurType: (google.cloud.visionai.v1alpha1.PersonBlurConfig.PersonBlurType|keyof typeof google.cloud.visionai.v1alpha1.PersonBlurConfig.PersonBlurType); + + /** PersonBlurConfig facesOnly. */ + public facesOnly: boolean; + + /** + * Creates a new PersonBlurConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns PersonBlurConfig instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IPersonBlurConfig): google.cloud.visionai.v1alpha1.PersonBlurConfig; + + /** + * Encodes the specified PersonBlurConfig message. Does not implicitly {@link google.cloud.visionai.v1alpha1.PersonBlurConfig.verify|verify} messages. + * @param message PersonBlurConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IPersonBlurConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PersonBlurConfig message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.PersonBlurConfig.verify|verify} messages. + * @param message PersonBlurConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IPersonBlurConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PersonBlurConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PersonBlurConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.PersonBlurConfig; + + /** + * Decodes a PersonBlurConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PersonBlurConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.PersonBlurConfig; + + /** + * Verifies a PersonBlurConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PersonBlurConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PersonBlurConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.PersonBlurConfig; + + /** + * Creates a plain object from a PersonBlurConfig message. Also converts values to other types if specified. + * @param message PersonBlurConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.PersonBlurConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PersonBlurConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PersonBlurConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PersonBlurConfig { + + /** PersonBlurType enum. */ + enum PersonBlurType { + PERSON_BLUR_TYPE_UNSPECIFIED = 0, + FULL_OCCULUSION = 1, + BLUR_FILTER = 2 + } + } + + /** Properties of an OccupancyCountConfig. */ + interface IOccupancyCountConfig { + + /** OccupancyCountConfig enablePeopleCounting */ + enablePeopleCounting?: (boolean|null); + + /** OccupancyCountConfig enableVehicleCounting */ + enableVehicleCounting?: (boolean|null); + + /** OccupancyCountConfig enableDwellingTimeTracking */ + enableDwellingTimeTracking?: (boolean|null); + } + + /** Represents an OccupancyCountConfig. */ + class OccupancyCountConfig implements IOccupancyCountConfig { + + /** + * Constructs a new OccupancyCountConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IOccupancyCountConfig); + + /** OccupancyCountConfig enablePeopleCounting. */ + public enablePeopleCounting: boolean; + + /** OccupancyCountConfig enableVehicleCounting. */ + public enableVehicleCounting: boolean; + + /** OccupancyCountConfig enableDwellingTimeTracking. */ + public enableDwellingTimeTracking: boolean; + + /** + * Creates a new OccupancyCountConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns OccupancyCountConfig instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IOccupancyCountConfig): google.cloud.visionai.v1alpha1.OccupancyCountConfig; + + /** + * Encodes the specified OccupancyCountConfig message. Does not implicitly {@link google.cloud.visionai.v1alpha1.OccupancyCountConfig.verify|verify} messages. + * @param message OccupancyCountConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IOccupancyCountConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OccupancyCountConfig message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.OccupancyCountConfig.verify|verify} messages. + * @param message OccupancyCountConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IOccupancyCountConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OccupancyCountConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OccupancyCountConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.OccupancyCountConfig; + + /** + * Decodes an OccupancyCountConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OccupancyCountConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.OccupancyCountConfig; + + /** + * Verifies an OccupancyCountConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OccupancyCountConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OccupancyCountConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.OccupancyCountConfig; + + /** + * Creates a plain object from an OccupancyCountConfig message. Also converts values to other types if specified. + * @param message OccupancyCountConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.OccupancyCountConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OccupancyCountConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OccupancyCountConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PersonVehicleDetectionConfig. */ + interface IPersonVehicleDetectionConfig { + + /** PersonVehicleDetectionConfig enablePeopleCounting */ + enablePeopleCounting?: (boolean|null); + + /** PersonVehicleDetectionConfig enableVehicleCounting */ + enableVehicleCounting?: (boolean|null); + } + + /** Represents a PersonVehicleDetectionConfig. */ + class PersonVehicleDetectionConfig implements IPersonVehicleDetectionConfig { + + /** + * Constructs a new PersonVehicleDetectionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IPersonVehicleDetectionConfig); + + /** PersonVehicleDetectionConfig enablePeopleCounting. */ + public enablePeopleCounting: boolean; + + /** PersonVehicleDetectionConfig enableVehicleCounting. */ + public enableVehicleCounting: boolean; + + /** + * Creates a new PersonVehicleDetectionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns PersonVehicleDetectionConfig instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IPersonVehicleDetectionConfig): google.cloud.visionai.v1alpha1.PersonVehicleDetectionConfig; + + /** + * Encodes the specified PersonVehicleDetectionConfig message. Does not implicitly {@link google.cloud.visionai.v1alpha1.PersonVehicleDetectionConfig.verify|verify} messages. + * @param message PersonVehicleDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IPersonVehicleDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PersonVehicleDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.PersonVehicleDetectionConfig.verify|verify} messages. + * @param message PersonVehicleDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IPersonVehicleDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PersonVehicleDetectionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PersonVehicleDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.PersonVehicleDetectionConfig; + + /** + * Decodes a PersonVehicleDetectionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PersonVehicleDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.PersonVehicleDetectionConfig; + + /** + * Verifies a PersonVehicleDetectionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PersonVehicleDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PersonVehicleDetectionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.PersonVehicleDetectionConfig; + + /** + * Creates a plain object from a PersonVehicleDetectionConfig message. Also converts values to other types if specified. + * @param message PersonVehicleDetectionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.PersonVehicleDetectionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PersonVehicleDetectionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PersonVehicleDetectionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PersonalProtectiveEquipmentDetectionConfig. */ + interface IPersonalProtectiveEquipmentDetectionConfig { + + /** PersonalProtectiveEquipmentDetectionConfig enableFaceCoverageDetection */ + enableFaceCoverageDetection?: (boolean|null); + + /** PersonalProtectiveEquipmentDetectionConfig enableHeadCoverageDetection */ + enableHeadCoverageDetection?: (boolean|null); + + /** PersonalProtectiveEquipmentDetectionConfig enableHandsCoverageDetection */ + enableHandsCoverageDetection?: (boolean|null); + } + + /** Represents a PersonalProtectiveEquipmentDetectionConfig. */ + class PersonalProtectiveEquipmentDetectionConfig implements IPersonalProtectiveEquipmentDetectionConfig { + + /** + * Constructs a new PersonalProtectiveEquipmentDetectionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IPersonalProtectiveEquipmentDetectionConfig); + + /** PersonalProtectiveEquipmentDetectionConfig enableFaceCoverageDetection. */ + public enableFaceCoverageDetection: boolean; + + /** PersonalProtectiveEquipmentDetectionConfig enableHeadCoverageDetection. */ + public enableHeadCoverageDetection: boolean; + + /** PersonalProtectiveEquipmentDetectionConfig enableHandsCoverageDetection. */ + public enableHandsCoverageDetection: boolean; + + /** + * Creates a new PersonalProtectiveEquipmentDetectionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns PersonalProtectiveEquipmentDetectionConfig instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IPersonalProtectiveEquipmentDetectionConfig): google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionConfig; + + /** + * Encodes the specified PersonalProtectiveEquipmentDetectionConfig message. Does not implicitly {@link google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionConfig.verify|verify} messages. + * @param message PersonalProtectiveEquipmentDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IPersonalProtectiveEquipmentDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PersonalProtectiveEquipmentDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionConfig.verify|verify} messages. + * @param message PersonalProtectiveEquipmentDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IPersonalProtectiveEquipmentDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PersonalProtectiveEquipmentDetectionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PersonalProtectiveEquipmentDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionConfig; + + /** + * Decodes a PersonalProtectiveEquipmentDetectionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PersonalProtectiveEquipmentDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionConfig; + + /** + * Verifies a PersonalProtectiveEquipmentDetectionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PersonalProtectiveEquipmentDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PersonalProtectiveEquipmentDetectionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionConfig; + + /** + * Creates a plain object from a PersonalProtectiveEquipmentDetectionConfig message. Also converts values to other types if specified. + * @param message PersonalProtectiveEquipmentDetectionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PersonalProtectiveEquipmentDetectionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PersonalProtectiveEquipmentDetectionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GeneralObjectDetectionConfig. */ + interface IGeneralObjectDetectionConfig { + } + + /** Represents a GeneralObjectDetectionConfig. */ + class GeneralObjectDetectionConfig implements IGeneralObjectDetectionConfig { + + /** + * Constructs a new GeneralObjectDetectionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IGeneralObjectDetectionConfig); + + /** + * Creates a new GeneralObjectDetectionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneralObjectDetectionConfig instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IGeneralObjectDetectionConfig): google.cloud.visionai.v1alpha1.GeneralObjectDetectionConfig; + + /** + * Encodes the specified GeneralObjectDetectionConfig message. Does not implicitly {@link google.cloud.visionai.v1alpha1.GeneralObjectDetectionConfig.verify|verify} messages. + * @param message GeneralObjectDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IGeneralObjectDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneralObjectDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.GeneralObjectDetectionConfig.verify|verify} messages. + * @param message GeneralObjectDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IGeneralObjectDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneralObjectDetectionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneralObjectDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.GeneralObjectDetectionConfig; + + /** + * Decodes a GeneralObjectDetectionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneralObjectDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.GeneralObjectDetectionConfig; + + /** + * Verifies a GeneralObjectDetectionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneralObjectDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneralObjectDetectionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.GeneralObjectDetectionConfig; + + /** + * Creates a plain object from a GeneralObjectDetectionConfig message. Also converts values to other types if specified. + * @param message GeneralObjectDetectionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.GeneralObjectDetectionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneralObjectDetectionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneralObjectDetectionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BigQueryConfig. */ + interface IBigQueryConfig { + + /** BigQueryConfig table */ + table?: (string|null); + + /** BigQueryConfig cloudFunctionMapping */ + cloudFunctionMapping?: ({ [k: string]: string }|null); + + /** BigQueryConfig createDefaultTableIfNotExists */ + createDefaultTableIfNotExists?: (boolean|null); + } + + /** Represents a BigQueryConfig. */ + class BigQueryConfig implements IBigQueryConfig { + + /** + * Constructs a new BigQueryConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IBigQueryConfig); + + /** BigQueryConfig table. */ + public table: string; + + /** BigQueryConfig cloudFunctionMapping. */ + public cloudFunctionMapping: { [k: string]: string }; + + /** BigQueryConfig createDefaultTableIfNotExists. */ + public createDefaultTableIfNotExists: boolean; + + /** + * Creates a new BigQueryConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns BigQueryConfig instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IBigQueryConfig): google.cloud.visionai.v1alpha1.BigQueryConfig; + + /** + * Encodes the specified BigQueryConfig message. Does not implicitly {@link google.cloud.visionai.v1alpha1.BigQueryConfig.verify|verify} messages. + * @param message BigQueryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IBigQueryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BigQueryConfig message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.BigQueryConfig.verify|verify} messages. + * @param message BigQueryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IBigQueryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BigQueryConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BigQueryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.BigQueryConfig; + + /** + * Decodes a BigQueryConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BigQueryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.BigQueryConfig; + + /** + * Verifies a BigQueryConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BigQueryConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BigQueryConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.BigQueryConfig; + + /** + * Creates a plain object from a BigQueryConfig message. Also converts values to other types if specified. + * @param message BigQueryConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.BigQueryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BigQueryConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BigQueryConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VertexAutoMLVisionConfig. */ + interface IVertexAutoMLVisionConfig { + + /** VertexAutoMLVisionConfig confidenceThreshold */ + confidenceThreshold?: (number|null); + + /** VertexAutoMLVisionConfig maxPredictions */ + maxPredictions?: (number|null); + } + + /** Represents a VertexAutoMLVisionConfig. */ + class VertexAutoMLVisionConfig implements IVertexAutoMLVisionConfig { + + /** + * Constructs a new VertexAutoMLVisionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IVertexAutoMLVisionConfig); + + /** VertexAutoMLVisionConfig confidenceThreshold. */ + public confidenceThreshold: number; + + /** VertexAutoMLVisionConfig maxPredictions. */ + public maxPredictions: number; + + /** + * Creates a new VertexAutoMLVisionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns VertexAutoMLVisionConfig instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IVertexAutoMLVisionConfig): google.cloud.visionai.v1alpha1.VertexAutoMLVisionConfig; + + /** + * Encodes the specified VertexAutoMLVisionConfig message. Does not implicitly {@link google.cloud.visionai.v1alpha1.VertexAutoMLVisionConfig.verify|verify} messages. + * @param message VertexAutoMLVisionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IVertexAutoMLVisionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VertexAutoMLVisionConfig message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.VertexAutoMLVisionConfig.verify|verify} messages. + * @param message VertexAutoMLVisionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IVertexAutoMLVisionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VertexAutoMLVisionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VertexAutoMLVisionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.VertexAutoMLVisionConfig; + + /** + * Decodes a VertexAutoMLVisionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VertexAutoMLVisionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.VertexAutoMLVisionConfig; + + /** + * Verifies a VertexAutoMLVisionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VertexAutoMLVisionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VertexAutoMLVisionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.VertexAutoMLVisionConfig; + + /** + * Creates a plain object from a VertexAutoMLVisionConfig message. Also converts values to other types if specified. + * @param message VertexAutoMLVisionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.VertexAutoMLVisionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VertexAutoMLVisionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VertexAutoMLVisionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VertexAutoMLVideoConfig. */ + interface IVertexAutoMLVideoConfig { + + /** VertexAutoMLVideoConfig confidenceThreshold */ + confidenceThreshold?: (number|null); + + /** VertexAutoMLVideoConfig blockedLabels */ + blockedLabels?: (string[]|null); + + /** VertexAutoMLVideoConfig maxPredictions */ + maxPredictions?: (number|null); + + /** VertexAutoMLVideoConfig boundingBoxSizeLimit */ + boundingBoxSizeLimit?: (number|null); + } + + /** Represents a VertexAutoMLVideoConfig. */ + class VertexAutoMLVideoConfig implements IVertexAutoMLVideoConfig { + + /** + * Constructs a new VertexAutoMLVideoConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IVertexAutoMLVideoConfig); + + /** VertexAutoMLVideoConfig confidenceThreshold. */ + public confidenceThreshold: number; + + /** VertexAutoMLVideoConfig blockedLabels. */ + public blockedLabels: string[]; + + /** VertexAutoMLVideoConfig maxPredictions. */ + public maxPredictions: number; + + /** VertexAutoMLVideoConfig boundingBoxSizeLimit. */ + public boundingBoxSizeLimit: number; + + /** + * Creates a new VertexAutoMLVideoConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns VertexAutoMLVideoConfig instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IVertexAutoMLVideoConfig): google.cloud.visionai.v1alpha1.VertexAutoMLVideoConfig; + + /** + * Encodes the specified VertexAutoMLVideoConfig message. Does not implicitly {@link google.cloud.visionai.v1alpha1.VertexAutoMLVideoConfig.verify|verify} messages. + * @param message VertexAutoMLVideoConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IVertexAutoMLVideoConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VertexAutoMLVideoConfig message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.VertexAutoMLVideoConfig.verify|verify} messages. + * @param message VertexAutoMLVideoConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IVertexAutoMLVideoConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VertexAutoMLVideoConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VertexAutoMLVideoConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.VertexAutoMLVideoConfig; + + /** + * Decodes a VertexAutoMLVideoConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VertexAutoMLVideoConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.VertexAutoMLVideoConfig; + + /** + * Verifies a VertexAutoMLVideoConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VertexAutoMLVideoConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VertexAutoMLVideoConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.VertexAutoMLVideoConfig; + + /** + * Creates a plain object from a VertexAutoMLVideoConfig message. Also converts values to other types if specified. + * @param message VertexAutoMLVideoConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.VertexAutoMLVideoConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VertexAutoMLVideoConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VertexAutoMLVideoConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VertexCustomConfig. */ + interface IVertexCustomConfig { + + /** VertexCustomConfig maxPredictionFps */ + maxPredictionFps?: (number|null); + + /** VertexCustomConfig dedicatedResources */ + dedicatedResources?: (google.cloud.visionai.v1alpha1.IDedicatedResources|null); + + /** VertexCustomConfig postProcessingCloudFunction */ + postProcessingCloudFunction?: (string|null); + + /** VertexCustomConfig attachApplicationMetadata */ + attachApplicationMetadata?: (boolean|null); + } + + /** Represents a VertexCustomConfig. */ + class VertexCustomConfig implements IVertexCustomConfig { + + /** + * Constructs a new VertexCustomConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IVertexCustomConfig); + + /** VertexCustomConfig maxPredictionFps. */ + public maxPredictionFps: number; + + /** VertexCustomConfig dedicatedResources. */ + public dedicatedResources?: (google.cloud.visionai.v1alpha1.IDedicatedResources|null); + + /** VertexCustomConfig postProcessingCloudFunction. */ + public postProcessingCloudFunction: string; + + /** VertexCustomConfig attachApplicationMetadata. */ + public attachApplicationMetadata: boolean; + + /** + * Creates a new VertexCustomConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns VertexCustomConfig instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IVertexCustomConfig): google.cloud.visionai.v1alpha1.VertexCustomConfig; + + /** + * Encodes the specified VertexCustomConfig message. Does not implicitly {@link google.cloud.visionai.v1alpha1.VertexCustomConfig.verify|verify} messages. + * @param message VertexCustomConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IVertexCustomConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VertexCustomConfig message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.VertexCustomConfig.verify|verify} messages. + * @param message VertexCustomConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IVertexCustomConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VertexCustomConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VertexCustomConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.VertexCustomConfig; + + /** + * Decodes a VertexCustomConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VertexCustomConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.VertexCustomConfig; + + /** + * Verifies a VertexCustomConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VertexCustomConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VertexCustomConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.VertexCustomConfig; + + /** + * Creates a plain object from a VertexCustomConfig message. Also converts values to other types if specified. + * @param message VertexCustomConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.VertexCustomConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VertexCustomConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VertexCustomConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MachineSpec. */ + interface IMachineSpec { + + /** MachineSpec machineType */ + machineType?: (string|null); + + /** MachineSpec acceleratorType */ + acceleratorType?: (google.cloud.visionai.v1alpha1.AcceleratorType|keyof typeof google.cloud.visionai.v1alpha1.AcceleratorType|null); + + /** MachineSpec acceleratorCount */ + acceleratorCount?: (number|null); + } + + /** Represents a MachineSpec. */ + class MachineSpec implements IMachineSpec { + + /** + * Constructs a new MachineSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IMachineSpec); + + /** MachineSpec machineType. */ + public machineType: string; + + /** MachineSpec acceleratorType. */ + public acceleratorType: (google.cloud.visionai.v1alpha1.AcceleratorType|keyof typeof google.cloud.visionai.v1alpha1.AcceleratorType); + + /** MachineSpec acceleratorCount. */ + public acceleratorCount: number; + + /** + * Creates a new MachineSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns MachineSpec instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IMachineSpec): google.cloud.visionai.v1alpha1.MachineSpec; + + /** + * Encodes the specified MachineSpec message. Does not implicitly {@link google.cloud.visionai.v1alpha1.MachineSpec.verify|verify} messages. + * @param message MachineSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IMachineSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MachineSpec message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.MachineSpec.verify|verify} messages. + * @param message MachineSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IMachineSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MachineSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MachineSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.MachineSpec; + + /** + * Decodes a MachineSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MachineSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.MachineSpec; + + /** + * Verifies a MachineSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MachineSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MachineSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.MachineSpec; + + /** + * Creates a plain object from a MachineSpec message. Also converts values to other types if specified. + * @param message MachineSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.MachineSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MachineSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MachineSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AutoscalingMetricSpec. */ + interface IAutoscalingMetricSpec { + + /** AutoscalingMetricSpec metricName */ + metricName?: (string|null); + + /** AutoscalingMetricSpec target */ + target?: (number|null); + } + + /** Represents an AutoscalingMetricSpec. */ + class AutoscalingMetricSpec implements IAutoscalingMetricSpec { + + /** + * Constructs a new AutoscalingMetricSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IAutoscalingMetricSpec); + + /** AutoscalingMetricSpec metricName. */ + public metricName: string; + + /** AutoscalingMetricSpec target. */ + public target: number; + + /** + * Creates a new AutoscalingMetricSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns AutoscalingMetricSpec instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IAutoscalingMetricSpec): google.cloud.visionai.v1alpha1.AutoscalingMetricSpec; + + /** + * Encodes the specified AutoscalingMetricSpec message. Does not implicitly {@link google.cloud.visionai.v1alpha1.AutoscalingMetricSpec.verify|verify} messages. + * @param message AutoscalingMetricSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IAutoscalingMetricSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutoscalingMetricSpec message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.AutoscalingMetricSpec.verify|verify} messages. + * @param message AutoscalingMetricSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IAutoscalingMetricSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutoscalingMetricSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutoscalingMetricSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.AutoscalingMetricSpec; + + /** + * Decodes an AutoscalingMetricSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutoscalingMetricSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.AutoscalingMetricSpec; + + /** + * Verifies an AutoscalingMetricSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AutoscalingMetricSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutoscalingMetricSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.AutoscalingMetricSpec; + + /** + * Creates a plain object from an AutoscalingMetricSpec message. Also converts values to other types if specified. + * @param message AutoscalingMetricSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.AutoscalingMetricSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutoscalingMetricSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AutoscalingMetricSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DedicatedResources. */ + interface IDedicatedResources { + + /** DedicatedResources machineSpec */ + machineSpec?: (google.cloud.visionai.v1alpha1.IMachineSpec|null); + + /** DedicatedResources minReplicaCount */ + minReplicaCount?: (number|null); + + /** DedicatedResources maxReplicaCount */ + maxReplicaCount?: (number|null); + + /** DedicatedResources autoscalingMetricSpecs */ + autoscalingMetricSpecs?: (google.cloud.visionai.v1alpha1.IAutoscalingMetricSpec[]|null); + } + + /** Represents a DedicatedResources. */ + class DedicatedResources implements IDedicatedResources { + + /** + * Constructs a new DedicatedResources. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IDedicatedResources); + + /** DedicatedResources machineSpec. */ + public machineSpec?: (google.cloud.visionai.v1alpha1.IMachineSpec|null); + + /** DedicatedResources minReplicaCount. */ + public minReplicaCount: number; + + /** DedicatedResources maxReplicaCount. */ + public maxReplicaCount: number; + + /** DedicatedResources autoscalingMetricSpecs. */ + public autoscalingMetricSpecs: google.cloud.visionai.v1alpha1.IAutoscalingMetricSpec[]; + + /** + * Creates a new DedicatedResources instance using the specified properties. + * @param [properties] Properties to set + * @returns DedicatedResources instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IDedicatedResources): google.cloud.visionai.v1alpha1.DedicatedResources; + + /** + * Encodes the specified DedicatedResources message. Does not implicitly {@link google.cloud.visionai.v1alpha1.DedicatedResources.verify|verify} messages. + * @param message DedicatedResources message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IDedicatedResources, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DedicatedResources message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.DedicatedResources.verify|verify} messages. + * @param message DedicatedResources message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IDedicatedResources, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DedicatedResources message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DedicatedResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.DedicatedResources; + + /** + * Decodes a DedicatedResources message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DedicatedResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.DedicatedResources; + + /** + * Verifies a DedicatedResources message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DedicatedResources message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DedicatedResources + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.DedicatedResources; + + /** + * Creates a plain object from a DedicatedResources message. Also converts values to other types if specified. + * @param message DedicatedResources + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.DedicatedResources, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DedicatedResources to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DedicatedResources + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GstreamerBufferDescriptor. */ + interface IGstreamerBufferDescriptor { + + /** GstreamerBufferDescriptor capsString */ + capsString?: (string|null); + + /** GstreamerBufferDescriptor isKeyFrame */ + isKeyFrame?: (boolean|null); + + /** GstreamerBufferDescriptor ptsTime */ + ptsTime?: (google.protobuf.ITimestamp|null); + + /** GstreamerBufferDescriptor dtsTime */ + dtsTime?: (google.protobuf.ITimestamp|null); + + /** GstreamerBufferDescriptor duration */ + duration?: (google.protobuf.IDuration|null); + } + + /** Represents a GstreamerBufferDescriptor. */ + class GstreamerBufferDescriptor implements IGstreamerBufferDescriptor { + + /** + * Constructs a new GstreamerBufferDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IGstreamerBufferDescriptor); + + /** GstreamerBufferDescriptor capsString. */ + public capsString: string; + + /** GstreamerBufferDescriptor isKeyFrame. */ + public isKeyFrame: boolean; + + /** GstreamerBufferDescriptor ptsTime. */ + public ptsTime?: (google.protobuf.ITimestamp|null); + + /** GstreamerBufferDescriptor dtsTime. */ + public dtsTime?: (google.protobuf.ITimestamp|null); + + /** GstreamerBufferDescriptor duration. */ + public duration?: (google.protobuf.IDuration|null); + + /** + * Creates a new GstreamerBufferDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns GstreamerBufferDescriptor instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IGstreamerBufferDescriptor): google.cloud.visionai.v1alpha1.GstreamerBufferDescriptor; + + /** + * Encodes the specified GstreamerBufferDescriptor message. Does not implicitly {@link google.cloud.visionai.v1alpha1.GstreamerBufferDescriptor.verify|verify} messages. + * @param message GstreamerBufferDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IGstreamerBufferDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GstreamerBufferDescriptor message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.GstreamerBufferDescriptor.verify|verify} messages. + * @param message GstreamerBufferDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IGstreamerBufferDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GstreamerBufferDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GstreamerBufferDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.GstreamerBufferDescriptor; + + /** + * Decodes a GstreamerBufferDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GstreamerBufferDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.GstreamerBufferDescriptor; + + /** + * Verifies a GstreamerBufferDescriptor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GstreamerBufferDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GstreamerBufferDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.GstreamerBufferDescriptor; + + /** + * Creates a plain object from a GstreamerBufferDescriptor message. Also converts values to other types if specified. + * @param message GstreamerBufferDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.GstreamerBufferDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GstreamerBufferDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GstreamerBufferDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RawImageDescriptor. */ + interface IRawImageDescriptor { + + /** RawImageDescriptor format */ + format?: (string|null); + + /** RawImageDescriptor height */ + height?: (number|null); + + /** RawImageDescriptor width */ + width?: (number|null); + } + + /** Represents a RawImageDescriptor. */ + class RawImageDescriptor implements IRawImageDescriptor { + + /** + * Constructs a new RawImageDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IRawImageDescriptor); + + /** RawImageDescriptor format. */ + public format: string; + + /** RawImageDescriptor height. */ + public height: number; + + /** RawImageDescriptor width. */ + public width: number; + + /** + * Creates a new RawImageDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns RawImageDescriptor instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IRawImageDescriptor): google.cloud.visionai.v1alpha1.RawImageDescriptor; + + /** + * Encodes the specified RawImageDescriptor message. Does not implicitly {@link google.cloud.visionai.v1alpha1.RawImageDescriptor.verify|verify} messages. + * @param message RawImageDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IRawImageDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RawImageDescriptor message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.RawImageDescriptor.verify|verify} messages. + * @param message RawImageDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IRawImageDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RawImageDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RawImageDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.RawImageDescriptor; + + /** + * Decodes a RawImageDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RawImageDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.RawImageDescriptor; + + /** + * Verifies a RawImageDescriptor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RawImageDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RawImageDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.RawImageDescriptor; + + /** + * Creates a plain object from a RawImageDescriptor message. Also converts values to other types if specified. + * @param message RawImageDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.RawImageDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RawImageDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RawImageDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PacketType. */ + interface IPacketType { + + /** PacketType typeClass */ + typeClass?: (string|null); + + /** PacketType typeDescriptor */ + typeDescriptor?: (google.cloud.visionai.v1alpha1.PacketType.ITypeDescriptor|null); + } + + /** Represents a PacketType. */ + class PacketType implements IPacketType { + + /** + * Constructs a new PacketType. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IPacketType); + + /** PacketType typeClass. */ + public typeClass: string; + + /** PacketType typeDescriptor. */ + public typeDescriptor?: (google.cloud.visionai.v1alpha1.PacketType.ITypeDescriptor|null); + + /** + * Creates a new PacketType instance using the specified properties. + * @param [properties] Properties to set + * @returns PacketType instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IPacketType): google.cloud.visionai.v1alpha1.PacketType; + + /** + * Encodes the specified PacketType message. Does not implicitly {@link google.cloud.visionai.v1alpha1.PacketType.verify|verify} messages. + * @param message PacketType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IPacketType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PacketType message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.PacketType.verify|verify} messages. + * @param message PacketType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IPacketType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PacketType message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PacketType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.PacketType; + + /** + * Decodes a PacketType message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PacketType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.PacketType; + + /** + * Verifies a PacketType message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PacketType message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PacketType + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.PacketType; + + /** + * Creates a plain object from a PacketType message. Also converts values to other types if specified. + * @param message PacketType + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.PacketType, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PacketType to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PacketType + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PacketType { + + /** Properties of a TypeDescriptor. */ + interface ITypeDescriptor { + + /** TypeDescriptor gstreamerBufferDescriptor */ + gstreamerBufferDescriptor?: (google.cloud.visionai.v1alpha1.IGstreamerBufferDescriptor|null); + + /** TypeDescriptor rawImageDescriptor */ + rawImageDescriptor?: (google.cloud.visionai.v1alpha1.IRawImageDescriptor|null); + + /** TypeDescriptor type */ + type?: (string|null); + } + + /** Represents a TypeDescriptor. */ + class TypeDescriptor implements ITypeDescriptor { + + /** + * Constructs a new TypeDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.PacketType.ITypeDescriptor); + + /** TypeDescriptor gstreamerBufferDescriptor. */ + public gstreamerBufferDescriptor?: (google.cloud.visionai.v1alpha1.IGstreamerBufferDescriptor|null); + + /** TypeDescriptor rawImageDescriptor. */ + public rawImageDescriptor?: (google.cloud.visionai.v1alpha1.IRawImageDescriptor|null); + + /** TypeDescriptor type. */ + public type: string; + + /** TypeDescriptor typeDetails. */ + public typeDetails?: ("gstreamerBufferDescriptor"|"rawImageDescriptor"); + + /** + * Creates a new TypeDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns TypeDescriptor instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.PacketType.ITypeDescriptor): google.cloud.visionai.v1alpha1.PacketType.TypeDescriptor; + + /** + * Encodes the specified TypeDescriptor message. Does not implicitly {@link google.cloud.visionai.v1alpha1.PacketType.TypeDescriptor.verify|verify} messages. + * @param message TypeDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.PacketType.ITypeDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TypeDescriptor message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.PacketType.TypeDescriptor.verify|verify} messages. + * @param message TypeDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.PacketType.ITypeDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TypeDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TypeDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.PacketType.TypeDescriptor; + + /** + * Decodes a TypeDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TypeDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.PacketType.TypeDescriptor; + + /** + * Verifies a TypeDescriptor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TypeDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TypeDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.PacketType.TypeDescriptor; + + /** + * Creates a plain object from a TypeDescriptor message. Also converts values to other types if specified. + * @param message TypeDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.PacketType.TypeDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TypeDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TypeDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ServerMetadata. */ + interface IServerMetadata { + + /** ServerMetadata offset */ + offset?: (number|Long|string|null); + + /** ServerMetadata ingestTime */ + ingestTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a ServerMetadata. */ + class ServerMetadata implements IServerMetadata { + + /** + * Constructs a new ServerMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IServerMetadata); + + /** ServerMetadata offset. */ + public offset: (number|Long|string); + + /** ServerMetadata ingestTime. */ + public ingestTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new ServerMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ServerMetadata instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IServerMetadata): google.cloud.visionai.v1alpha1.ServerMetadata; + + /** + * Encodes the specified ServerMetadata message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ServerMetadata.verify|verify} messages. + * @param message ServerMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IServerMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServerMetadata message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ServerMetadata.verify|verify} messages. + * @param message ServerMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IServerMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServerMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServerMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ServerMetadata; + + /** + * Decodes a ServerMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServerMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ServerMetadata; + + /** + * Verifies a ServerMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServerMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServerMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ServerMetadata; + + /** + * Creates a plain object from a ServerMetadata message. Also converts values to other types if specified. + * @param message ServerMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ServerMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServerMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServerMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SeriesMetadata. */ + interface ISeriesMetadata { + + /** SeriesMetadata series */ + series?: (string|null); + } + + /** Represents a SeriesMetadata. */ + class SeriesMetadata implements ISeriesMetadata { + + /** + * Constructs a new SeriesMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.ISeriesMetadata); + + /** SeriesMetadata series. */ + public series: string; + + /** + * Creates a new SeriesMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns SeriesMetadata instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.ISeriesMetadata): google.cloud.visionai.v1alpha1.SeriesMetadata; + + /** + * Encodes the specified SeriesMetadata message. Does not implicitly {@link google.cloud.visionai.v1alpha1.SeriesMetadata.verify|verify} messages. + * @param message SeriesMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.ISeriesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SeriesMetadata message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.SeriesMetadata.verify|verify} messages. + * @param message SeriesMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.ISeriesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SeriesMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SeriesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.SeriesMetadata; + + /** + * Decodes a SeriesMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SeriesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.SeriesMetadata; + + /** + * Verifies a SeriesMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SeriesMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SeriesMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.SeriesMetadata; + + /** + * Creates a plain object from a SeriesMetadata message. Also converts values to other types if specified. + * @param message SeriesMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.SeriesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SeriesMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SeriesMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PacketHeader. */ + interface IPacketHeader { + + /** PacketHeader captureTime */ + captureTime?: (google.protobuf.ITimestamp|null); + + /** PacketHeader type */ + type?: (google.cloud.visionai.v1alpha1.IPacketType|null); + + /** PacketHeader metadata */ + metadata?: (google.protobuf.IStruct|null); + + /** PacketHeader serverMetadata */ + serverMetadata?: (google.cloud.visionai.v1alpha1.IServerMetadata|null); + + /** PacketHeader seriesMetadata */ + seriesMetadata?: (google.cloud.visionai.v1alpha1.ISeriesMetadata|null); + + /** PacketHeader flags */ + flags?: (number|null); + + /** PacketHeader traceContext */ + traceContext?: (string|null); + } + + /** Represents a PacketHeader. */ + class PacketHeader implements IPacketHeader { + + /** + * Constructs a new PacketHeader. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IPacketHeader); + + /** PacketHeader captureTime. */ + public captureTime?: (google.protobuf.ITimestamp|null); + + /** PacketHeader type. */ + public type?: (google.cloud.visionai.v1alpha1.IPacketType|null); + + /** PacketHeader metadata. */ + public metadata?: (google.protobuf.IStruct|null); + + /** PacketHeader serverMetadata. */ + public serverMetadata?: (google.cloud.visionai.v1alpha1.IServerMetadata|null); + + /** PacketHeader seriesMetadata. */ + public seriesMetadata?: (google.cloud.visionai.v1alpha1.ISeriesMetadata|null); + + /** PacketHeader flags. */ + public flags: number; + + /** PacketHeader traceContext. */ + public traceContext: string; + + /** + * Creates a new PacketHeader instance using the specified properties. + * @param [properties] Properties to set + * @returns PacketHeader instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IPacketHeader): google.cloud.visionai.v1alpha1.PacketHeader; + + /** + * Encodes the specified PacketHeader message. Does not implicitly {@link google.cloud.visionai.v1alpha1.PacketHeader.verify|verify} messages. + * @param message PacketHeader message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IPacketHeader, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PacketHeader message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.PacketHeader.verify|verify} messages. + * @param message PacketHeader message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IPacketHeader, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PacketHeader message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PacketHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.PacketHeader; + + /** + * Decodes a PacketHeader message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PacketHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.PacketHeader; + + /** + * Verifies a PacketHeader message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PacketHeader message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PacketHeader + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.PacketHeader; + + /** + * Creates a plain object from a PacketHeader message. Also converts values to other types if specified. + * @param message PacketHeader + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.PacketHeader, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PacketHeader to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PacketHeader + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Packet. */ + interface IPacket { + + /** Packet header */ + header?: (google.cloud.visionai.v1alpha1.IPacketHeader|null); + + /** Packet payload */ + payload?: (Uint8Array|Buffer|string|null); + } + + /** Represents a Packet. */ + class Packet implements IPacket { + + /** + * Constructs a new Packet. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IPacket); + + /** Packet header. */ + public header?: (google.cloud.visionai.v1alpha1.IPacketHeader|null); + + /** Packet payload. */ + public payload: (Uint8Array|Buffer|string); + + /** + * Creates a new Packet instance using the specified properties. + * @param [properties] Properties to set + * @returns Packet instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IPacket): google.cloud.visionai.v1alpha1.Packet; + + /** + * Encodes the specified Packet message. Does not implicitly {@link google.cloud.visionai.v1alpha1.Packet.verify|verify} messages. + * @param message Packet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IPacket, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Packet message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.Packet.verify|verify} messages. + * @param message Packet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IPacket, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Packet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Packet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.Packet; + + /** + * Decodes a Packet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Packet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.Packet; + + /** + * Verifies a Packet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Packet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Packet + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.Packet; + + /** + * Creates a plain object from a Packet message. Also converts values to other types if specified. + * @param message Packet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.Packet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Packet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Packet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a StreamingService */ + class StreamingService extends $protobuf.rpc.Service { + + /** + * Constructs a new StreamingService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new StreamingService service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): StreamingService; + + /** + * Calls SendPackets. + * @param request SendPacketsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SendPacketsResponse + */ + public sendPackets(request: google.cloud.visionai.v1alpha1.ISendPacketsRequest, callback: google.cloud.visionai.v1alpha1.StreamingService.SendPacketsCallback): void; + + /** + * Calls SendPackets. + * @param request SendPacketsRequest message or plain object + * @returns Promise + */ + public sendPackets(request: google.cloud.visionai.v1alpha1.ISendPacketsRequest): Promise; + + /** + * Calls ReceivePackets. + * @param request ReceivePacketsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ReceivePacketsResponse + */ + public receivePackets(request: google.cloud.visionai.v1alpha1.IReceivePacketsRequest, callback: google.cloud.visionai.v1alpha1.StreamingService.ReceivePacketsCallback): void; + + /** + * Calls ReceivePackets. + * @param request ReceivePacketsRequest message or plain object + * @returns Promise + */ + public receivePackets(request: google.cloud.visionai.v1alpha1.IReceivePacketsRequest): Promise; + + /** + * Calls ReceiveEvents. + * @param request ReceiveEventsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ReceiveEventsResponse + */ + public receiveEvents(request: google.cloud.visionai.v1alpha1.IReceiveEventsRequest, callback: google.cloud.visionai.v1alpha1.StreamingService.ReceiveEventsCallback): void; + + /** + * Calls ReceiveEvents. + * @param request ReceiveEventsRequest message or plain object + * @returns Promise + */ + public receiveEvents(request: google.cloud.visionai.v1alpha1.IReceiveEventsRequest): Promise; + + /** + * Calls AcquireLease. + * @param request AcquireLeaseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Lease + */ + public acquireLease(request: google.cloud.visionai.v1alpha1.IAcquireLeaseRequest, callback: google.cloud.visionai.v1alpha1.StreamingService.AcquireLeaseCallback): void; + + /** + * Calls AcquireLease. + * @param request AcquireLeaseRequest message or plain object + * @returns Promise + */ + public acquireLease(request: google.cloud.visionai.v1alpha1.IAcquireLeaseRequest): Promise; + + /** + * Calls RenewLease. + * @param request RenewLeaseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Lease + */ + public renewLease(request: google.cloud.visionai.v1alpha1.IRenewLeaseRequest, callback: google.cloud.visionai.v1alpha1.StreamingService.RenewLeaseCallback): void; + + /** + * Calls RenewLease. + * @param request RenewLeaseRequest message or plain object + * @returns Promise + */ + public renewLease(request: google.cloud.visionai.v1alpha1.IRenewLeaseRequest): Promise; + + /** + * Calls ReleaseLease. + * @param request ReleaseLeaseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ReleaseLeaseResponse + */ + public releaseLease(request: google.cloud.visionai.v1alpha1.IReleaseLeaseRequest, callback: google.cloud.visionai.v1alpha1.StreamingService.ReleaseLeaseCallback): void; + + /** + * Calls ReleaseLease. + * @param request ReleaseLeaseRequest message or plain object + * @returns Promise + */ + public releaseLease(request: google.cloud.visionai.v1alpha1.IReleaseLeaseRequest): Promise; + } + + namespace StreamingService { + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.StreamingService|sendPackets}. + * @param error Error, if any + * @param [response] SendPacketsResponse + */ + type SendPacketsCallback = (error: (Error|null), response?: google.cloud.visionai.v1alpha1.SendPacketsResponse) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.StreamingService|receivePackets}. + * @param error Error, if any + * @param [response] ReceivePacketsResponse + */ + type ReceivePacketsCallback = (error: (Error|null), response?: google.cloud.visionai.v1alpha1.ReceivePacketsResponse) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.StreamingService|receiveEvents}. + * @param error Error, if any + * @param [response] ReceiveEventsResponse + */ + type ReceiveEventsCallback = (error: (Error|null), response?: google.cloud.visionai.v1alpha1.ReceiveEventsResponse) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.StreamingService|acquireLease}. + * @param error Error, if any + * @param [response] Lease + */ + type AcquireLeaseCallback = (error: (Error|null), response?: google.cloud.visionai.v1alpha1.Lease) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.StreamingService|renewLease}. + * @param error Error, if any + * @param [response] Lease + */ + type RenewLeaseCallback = (error: (Error|null), response?: google.cloud.visionai.v1alpha1.Lease) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.StreamingService|releaseLease}. + * @param error Error, if any + * @param [response] ReleaseLeaseResponse + */ + type ReleaseLeaseCallback = (error: (Error|null), response?: google.cloud.visionai.v1alpha1.ReleaseLeaseResponse) => void; + } + + /** LeaseType enum. */ + enum LeaseType { + LEASE_TYPE_UNSPECIFIED = 0, + LEASE_TYPE_READER = 1, + LEASE_TYPE_WRITER = 2 + } + + /** Properties of a ReceiveEventsRequest. */ + interface IReceiveEventsRequest { + + /** ReceiveEventsRequest setupRequest */ + setupRequest?: (google.cloud.visionai.v1alpha1.ReceiveEventsRequest.ISetupRequest|null); + + /** ReceiveEventsRequest commitRequest */ + commitRequest?: (google.cloud.visionai.v1alpha1.ICommitRequest|null); + } + + /** Represents a ReceiveEventsRequest. */ + class ReceiveEventsRequest implements IReceiveEventsRequest { + + /** + * Constructs a new ReceiveEventsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IReceiveEventsRequest); + + /** ReceiveEventsRequest setupRequest. */ + public setupRequest?: (google.cloud.visionai.v1alpha1.ReceiveEventsRequest.ISetupRequest|null); + + /** ReceiveEventsRequest commitRequest. */ + public commitRequest?: (google.cloud.visionai.v1alpha1.ICommitRequest|null); + + /** ReceiveEventsRequest request. */ + public request?: ("setupRequest"|"commitRequest"); + + /** + * Creates a new ReceiveEventsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ReceiveEventsRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IReceiveEventsRequest): google.cloud.visionai.v1alpha1.ReceiveEventsRequest; + + /** + * Encodes the specified ReceiveEventsRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ReceiveEventsRequest.verify|verify} messages. + * @param message ReceiveEventsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IReceiveEventsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReceiveEventsRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ReceiveEventsRequest.verify|verify} messages. + * @param message ReceiveEventsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IReceiveEventsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReceiveEventsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReceiveEventsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ReceiveEventsRequest; + + /** + * Decodes a ReceiveEventsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReceiveEventsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ReceiveEventsRequest; + + /** + * Verifies a ReceiveEventsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReceiveEventsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReceiveEventsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ReceiveEventsRequest; + + /** + * Creates a plain object from a ReceiveEventsRequest message. Also converts values to other types if specified. + * @param message ReceiveEventsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ReceiveEventsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReceiveEventsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReceiveEventsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ReceiveEventsRequest { + + /** Properties of a SetupRequest. */ + interface ISetupRequest { + + /** SetupRequest cluster */ + cluster?: (string|null); + + /** SetupRequest stream */ + stream?: (string|null); + + /** SetupRequest receiver */ + receiver?: (string|null); + + /** SetupRequest controlledMode */ + controlledMode?: (google.cloud.visionai.v1alpha1.IControlledMode|null); + + /** SetupRequest heartbeatInterval */ + heartbeatInterval?: (google.protobuf.IDuration|null); + + /** SetupRequest writesDoneGracePeriod */ + writesDoneGracePeriod?: (google.protobuf.IDuration|null); + } + + /** Represents a SetupRequest. */ + class SetupRequest implements ISetupRequest { + + /** + * Constructs a new SetupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.ReceiveEventsRequest.ISetupRequest); + + /** SetupRequest cluster. */ + public cluster: string; + + /** SetupRequest stream. */ + public stream: string; + + /** SetupRequest receiver. */ + public receiver: string; + + /** SetupRequest controlledMode. */ + public controlledMode?: (google.cloud.visionai.v1alpha1.IControlledMode|null); + + /** SetupRequest heartbeatInterval. */ + public heartbeatInterval?: (google.protobuf.IDuration|null); + + /** SetupRequest writesDoneGracePeriod. */ + public writesDoneGracePeriod?: (google.protobuf.IDuration|null); + + /** + * Creates a new SetupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetupRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.ReceiveEventsRequest.ISetupRequest): google.cloud.visionai.v1alpha1.ReceiveEventsRequest.SetupRequest; + + /** + * Encodes the specified SetupRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ReceiveEventsRequest.SetupRequest.verify|verify} messages. + * @param message SetupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.ReceiveEventsRequest.ISetupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetupRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ReceiveEventsRequest.SetupRequest.verify|verify} messages. + * @param message SetupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.ReceiveEventsRequest.ISetupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ReceiveEventsRequest.SetupRequest; + + /** + * Decodes a SetupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ReceiveEventsRequest.SetupRequest; + + /** + * Verifies a SetupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ReceiveEventsRequest.SetupRequest; + + /** + * Creates a plain object from a SetupRequest message. Also converts values to other types if specified. + * @param message SetupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ReceiveEventsRequest.SetupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SetupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an EventUpdate. */ + interface IEventUpdate { + + /** EventUpdate stream */ + stream?: (string|null); + + /** EventUpdate event */ + event?: (string|null); + + /** EventUpdate series */ + series?: (string|null); + + /** EventUpdate updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** EventUpdate offset */ + offset?: (number|Long|string|null); + } + + /** Represents an EventUpdate. */ + class EventUpdate implements IEventUpdate { + + /** + * Constructs a new EventUpdate. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IEventUpdate); + + /** EventUpdate stream. */ + public stream: string; + + /** EventUpdate event. */ + public event: string; + + /** EventUpdate series. */ + public series: string; + + /** EventUpdate updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** EventUpdate offset. */ + public offset: (number|Long|string); + + /** + * Creates a new EventUpdate instance using the specified properties. + * @param [properties] Properties to set + * @returns EventUpdate instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IEventUpdate): google.cloud.visionai.v1alpha1.EventUpdate; + + /** + * Encodes the specified EventUpdate message. Does not implicitly {@link google.cloud.visionai.v1alpha1.EventUpdate.verify|verify} messages. + * @param message EventUpdate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IEventUpdate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EventUpdate message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.EventUpdate.verify|verify} messages. + * @param message EventUpdate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IEventUpdate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EventUpdate message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EventUpdate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.EventUpdate; + + /** + * Decodes an EventUpdate message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EventUpdate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.EventUpdate; + + /** + * Verifies an EventUpdate message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EventUpdate message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EventUpdate + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.EventUpdate; + + /** + * Creates a plain object from an EventUpdate message. Also converts values to other types if specified. + * @param message EventUpdate + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.EventUpdate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EventUpdate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EventUpdate + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReceiveEventsControlResponse. */ + interface IReceiveEventsControlResponse { + + /** ReceiveEventsControlResponse heartbeat */ + heartbeat?: (boolean|null); + + /** ReceiveEventsControlResponse writesDoneRequest */ + writesDoneRequest?: (boolean|null); + } + + /** Represents a ReceiveEventsControlResponse. */ + class ReceiveEventsControlResponse implements IReceiveEventsControlResponse { + + /** + * Constructs a new ReceiveEventsControlResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IReceiveEventsControlResponse); + + /** ReceiveEventsControlResponse heartbeat. */ + public heartbeat?: (boolean|null); + + /** ReceiveEventsControlResponse writesDoneRequest. */ + public writesDoneRequest?: (boolean|null); + + /** ReceiveEventsControlResponse control. */ + public control?: ("heartbeat"|"writesDoneRequest"); + + /** + * Creates a new ReceiveEventsControlResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ReceiveEventsControlResponse instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IReceiveEventsControlResponse): google.cloud.visionai.v1alpha1.ReceiveEventsControlResponse; + + /** + * Encodes the specified ReceiveEventsControlResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ReceiveEventsControlResponse.verify|verify} messages. + * @param message ReceiveEventsControlResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IReceiveEventsControlResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReceiveEventsControlResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ReceiveEventsControlResponse.verify|verify} messages. + * @param message ReceiveEventsControlResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IReceiveEventsControlResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReceiveEventsControlResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReceiveEventsControlResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ReceiveEventsControlResponse; + + /** + * Decodes a ReceiveEventsControlResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReceiveEventsControlResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ReceiveEventsControlResponse; + + /** + * Verifies a ReceiveEventsControlResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReceiveEventsControlResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReceiveEventsControlResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ReceiveEventsControlResponse; + + /** + * Creates a plain object from a ReceiveEventsControlResponse message. Also converts values to other types if specified. + * @param message ReceiveEventsControlResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ReceiveEventsControlResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReceiveEventsControlResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReceiveEventsControlResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReceiveEventsResponse. */ + interface IReceiveEventsResponse { + + /** ReceiveEventsResponse eventUpdate */ + eventUpdate?: (google.cloud.visionai.v1alpha1.IEventUpdate|null); + + /** ReceiveEventsResponse control */ + control?: (google.cloud.visionai.v1alpha1.IReceiveEventsControlResponse|null); + } + + /** Represents a ReceiveEventsResponse. */ + class ReceiveEventsResponse implements IReceiveEventsResponse { + + /** + * Constructs a new ReceiveEventsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IReceiveEventsResponse); + + /** ReceiveEventsResponse eventUpdate. */ + public eventUpdate?: (google.cloud.visionai.v1alpha1.IEventUpdate|null); + + /** ReceiveEventsResponse control. */ + public control?: (google.cloud.visionai.v1alpha1.IReceiveEventsControlResponse|null); + + /** ReceiveEventsResponse response. */ + public response?: ("eventUpdate"|"control"); + + /** + * Creates a new ReceiveEventsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ReceiveEventsResponse instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IReceiveEventsResponse): google.cloud.visionai.v1alpha1.ReceiveEventsResponse; + + /** + * Encodes the specified ReceiveEventsResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ReceiveEventsResponse.verify|verify} messages. + * @param message ReceiveEventsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IReceiveEventsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReceiveEventsResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ReceiveEventsResponse.verify|verify} messages. + * @param message ReceiveEventsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IReceiveEventsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReceiveEventsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReceiveEventsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ReceiveEventsResponse; + + /** + * Decodes a ReceiveEventsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReceiveEventsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ReceiveEventsResponse; + + /** + * Verifies a ReceiveEventsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReceiveEventsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReceiveEventsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ReceiveEventsResponse; + + /** + * Creates a plain object from a ReceiveEventsResponse message. Also converts values to other types if specified. + * @param message ReceiveEventsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ReceiveEventsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReceiveEventsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReceiveEventsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Lease. */ + interface ILease { + + /** Lease id */ + id?: (string|null); + + /** Lease series */ + series?: (string|null); + + /** Lease owner */ + owner?: (string|null); + + /** Lease expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + + /** Lease leaseType */ + leaseType?: (google.cloud.visionai.v1alpha1.LeaseType|keyof typeof google.cloud.visionai.v1alpha1.LeaseType|null); + } + + /** Represents a Lease. */ + class Lease implements ILease { + + /** + * Constructs a new Lease. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.ILease); + + /** Lease id. */ + public id: string; + + /** Lease series. */ + public series: string; + + /** Lease owner. */ + public owner: string; + + /** Lease expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** Lease leaseType. */ + public leaseType: (google.cloud.visionai.v1alpha1.LeaseType|keyof typeof google.cloud.visionai.v1alpha1.LeaseType); + + /** + * Creates a new Lease instance using the specified properties. + * @param [properties] Properties to set + * @returns Lease instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.ILease): google.cloud.visionai.v1alpha1.Lease; + + /** + * Encodes the specified Lease message. Does not implicitly {@link google.cloud.visionai.v1alpha1.Lease.verify|verify} messages. + * @param message Lease message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.ILease, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Lease message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.Lease.verify|verify} messages. + * @param message Lease message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.ILease, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Lease message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Lease + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.Lease; + + /** + * Decodes a Lease message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Lease + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.Lease; + + /** + * Verifies a Lease message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Lease message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Lease + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.Lease; + + /** + * Creates a plain object from a Lease message. Also converts values to other types if specified. + * @param message Lease + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.Lease, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Lease to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Lease + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AcquireLeaseRequest. */ + interface IAcquireLeaseRequest { + + /** AcquireLeaseRequest series */ + series?: (string|null); + + /** AcquireLeaseRequest owner */ + owner?: (string|null); + + /** AcquireLeaseRequest term */ + term?: (google.protobuf.IDuration|null); + + /** AcquireLeaseRequest leaseType */ + leaseType?: (google.cloud.visionai.v1alpha1.LeaseType|keyof typeof google.cloud.visionai.v1alpha1.LeaseType|null); + } + + /** Represents an AcquireLeaseRequest. */ + class AcquireLeaseRequest implements IAcquireLeaseRequest { + + /** + * Constructs a new AcquireLeaseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IAcquireLeaseRequest); + + /** AcquireLeaseRequest series. */ + public series: string; + + /** AcquireLeaseRequest owner. */ + public owner: string; + + /** AcquireLeaseRequest term. */ + public term?: (google.protobuf.IDuration|null); + + /** AcquireLeaseRequest leaseType. */ + public leaseType: (google.cloud.visionai.v1alpha1.LeaseType|keyof typeof google.cloud.visionai.v1alpha1.LeaseType); + + /** + * Creates a new AcquireLeaseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AcquireLeaseRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IAcquireLeaseRequest): google.cloud.visionai.v1alpha1.AcquireLeaseRequest; + + /** + * Encodes the specified AcquireLeaseRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.AcquireLeaseRequest.verify|verify} messages. + * @param message AcquireLeaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IAcquireLeaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AcquireLeaseRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.AcquireLeaseRequest.verify|verify} messages. + * @param message AcquireLeaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IAcquireLeaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AcquireLeaseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AcquireLeaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.AcquireLeaseRequest; + + /** + * Decodes an AcquireLeaseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AcquireLeaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.AcquireLeaseRequest; + + /** + * Verifies an AcquireLeaseRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AcquireLeaseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AcquireLeaseRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.AcquireLeaseRequest; + + /** + * Creates a plain object from an AcquireLeaseRequest message. Also converts values to other types if specified. + * @param message AcquireLeaseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.AcquireLeaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AcquireLeaseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AcquireLeaseRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RenewLeaseRequest. */ + interface IRenewLeaseRequest { + + /** RenewLeaseRequest id */ + id?: (string|null); + + /** RenewLeaseRequest series */ + series?: (string|null); + + /** RenewLeaseRequest owner */ + owner?: (string|null); + + /** RenewLeaseRequest term */ + term?: (google.protobuf.IDuration|null); + } + + /** Represents a RenewLeaseRequest. */ + class RenewLeaseRequest implements IRenewLeaseRequest { + + /** + * Constructs a new RenewLeaseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IRenewLeaseRequest); + + /** RenewLeaseRequest id. */ + public id: string; + + /** RenewLeaseRequest series. */ + public series: string; + + /** RenewLeaseRequest owner. */ + public owner: string; + + /** RenewLeaseRequest term. */ + public term?: (google.protobuf.IDuration|null); + + /** + * Creates a new RenewLeaseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RenewLeaseRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IRenewLeaseRequest): google.cloud.visionai.v1alpha1.RenewLeaseRequest; + + /** + * Encodes the specified RenewLeaseRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.RenewLeaseRequest.verify|verify} messages. + * @param message RenewLeaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IRenewLeaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RenewLeaseRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.RenewLeaseRequest.verify|verify} messages. + * @param message RenewLeaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IRenewLeaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RenewLeaseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RenewLeaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.RenewLeaseRequest; + + /** + * Decodes a RenewLeaseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RenewLeaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.RenewLeaseRequest; + + /** + * Verifies a RenewLeaseRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RenewLeaseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RenewLeaseRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.RenewLeaseRequest; + + /** + * Creates a plain object from a RenewLeaseRequest message. Also converts values to other types if specified. + * @param message RenewLeaseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.RenewLeaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RenewLeaseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RenewLeaseRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReleaseLeaseRequest. */ + interface IReleaseLeaseRequest { + + /** ReleaseLeaseRequest id */ + id?: (string|null); + + /** ReleaseLeaseRequest series */ + series?: (string|null); + + /** ReleaseLeaseRequest owner */ + owner?: (string|null); + } + + /** Represents a ReleaseLeaseRequest. */ + class ReleaseLeaseRequest implements IReleaseLeaseRequest { + + /** + * Constructs a new ReleaseLeaseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IReleaseLeaseRequest); + + /** ReleaseLeaseRequest id. */ + public id: string; + + /** ReleaseLeaseRequest series. */ + public series: string; + + /** ReleaseLeaseRequest owner. */ + public owner: string; + + /** + * Creates a new ReleaseLeaseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ReleaseLeaseRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IReleaseLeaseRequest): google.cloud.visionai.v1alpha1.ReleaseLeaseRequest; + + /** + * Encodes the specified ReleaseLeaseRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ReleaseLeaseRequest.verify|verify} messages. + * @param message ReleaseLeaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IReleaseLeaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReleaseLeaseRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ReleaseLeaseRequest.verify|verify} messages. + * @param message ReleaseLeaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IReleaseLeaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReleaseLeaseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReleaseLeaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ReleaseLeaseRequest; + + /** + * Decodes a ReleaseLeaseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReleaseLeaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ReleaseLeaseRequest; + + /** + * Verifies a ReleaseLeaseRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReleaseLeaseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReleaseLeaseRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ReleaseLeaseRequest; + + /** + * Creates a plain object from a ReleaseLeaseRequest message. Also converts values to other types if specified. + * @param message ReleaseLeaseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ReleaseLeaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReleaseLeaseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReleaseLeaseRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReleaseLeaseResponse. */ + interface IReleaseLeaseResponse { + } + + /** Represents a ReleaseLeaseResponse. */ + class ReleaseLeaseResponse implements IReleaseLeaseResponse { + + /** + * Constructs a new ReleaseLeaseResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IReleaseLeaseResponse); + + /** + * Creates a new ReleaseLeaseResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ReleaseLeaseResponse instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IReleaseLeaseResponse): google.cloud.visionai.v1alpha1.ReleaseLeaseResponse; + + /** + * Encodes the specified ReleaseLeaseResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ReleaseLeaseResponse.verify|verify} messages. + * @param message ReleaseLeaseResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IReleaseLeaseResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReleaseLeaseResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ReleaseLeaseResponse.verify|verify} messages. + * @param message ReleaseLeaseResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IReleaseLeaseResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReleaseLeaseResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReleaseLeaseResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ReleaseLeaseResponse; + + /** + * Decodes a ReleaseLeaseResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReleaseLeaseResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ReleaseLeaseResponse; + + /** + * Verifies a ReleaseLeaseResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReleaseLeaseResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReleaseLeaseResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ReleaseLeaseResponse; + + /** + * Creates a plain object from a ReleaseLeaseResponse message. Also converts values to other types if specified. + * @param message ReleaseLeaseResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ReleaseLeaseResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReleaseLeaseResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReleaseLeaseResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RequestMetadata. */ + interface IRequestMetadata { + + /** RequestMetadata stream */ + stream?: (string|null); + + /** RequestMetadata event */ + event?: (string|null); + + /** RequestMetadata series */ + series?: (string|null); + + /** RequestMetadata leaseId */ + leaseId?: (string|null); + + /** RequestMetadata owner */ + owner?: (string|null); + + /** RequestMetadata leaseTerm */ + leaseTerm?: (google.protobuf.IDuration|null); + } + + /** Represents a RequestMetadata. */ + class RequestMetadata implements IRequestMetadata { + + /** + * Constructs a new RequestMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IRequestMetadata); + + /** RequestMetadata stream. */ + public stream: string; + + /** RequestMetadata event. */ + public event: string; + + /** RequestMetadata series. */ + public series: string; + + /** RequestMetadata leaseId. */ + public leaseId: string; + + /** RequestMetadata owner. */ + public owner: string; + + /** RequestMetadata leaseTerm. */ + public leaseTerm?: (google.protobuf.IDuration|null); + + /** + * Creates a new RequestMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns RequestMetadata instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IRequestMetadata): google.cloud.visionai.v1alpha1.RequestMetadata; + + /** + * Encodes the specified RequestMetadata message. Does not implicitly {@link google.cloud.visionai.v1alpha1.RequestMetadata.verify|verify} messages. + * @param message RequestMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IRequestMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RequestMetadata message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.RequestMetadata.verify|verify} messages. + * @param message RequestMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IRequestMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RequestMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RequestMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.RequestMetadata; + + /** + * Decodes a RequestMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RequestMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.RequestMetadata; + + /** + * Verifies a RequestMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RequestMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RequestMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.RequestMetadata; + + /** + * Creates a plain object from a RequestMetadata message. Also converts values to other types if specified. + * @param message RequestMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.RequestMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RequestMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RequestMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SendPacketsRequest. */ + interface ISendPacketsRequest { + + /** SendPacketsRequest packet */ + packet?: (google.cloud.visionai.v1alpha1.IPacket|null); + + /** SendPacketsRequest metadata */ + metadata?: (google.cloud.visionai.v1alpha1.IRequestMetadata|null); + } + + /** Represents a SendPacketsRequest. */ + class SendPacketsRequest implements ISendPacketsRequest { + + /** + * Constructs a new SendPacketsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.ISendPacketsRequest); + + /** SendPacketsRequest packet. */ + public packet?: (google.cloud.visionai.v1alpha1.IPacket|null); + + /** SendPacketsRequest metadata. */ + public metadata?: (google.cloud.visionai.v1alpha1.IRequestMetadata|null); + + /** SendPacketsRequest request. */ + public request?: ("packet"|"metadata"); + + /** + * Creates a new SendPacketsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SendPacketsRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.ISendPacketsRequest): google.cloud.visionai.v1alpha1.SendPacketsRequest; + + /** + * Encodes the specified SendPacketsRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.SendPacketsRequest.verify|verify} messages. + * @param message SendPacketsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.ISendPacketsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SendPacketsRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.SendPacketsRequest.verify|verify} messages. + * @param message SendPacketsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.ISendPacketsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SendPacketsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SendPacketsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.SendPacketsRequest; + + /** + * Decodes a SendPacketsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SendPacketsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.SendPacketsRequest; + + /** + * Verifies a SendPacketsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SendPacketsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SendPacketsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.SendPacketsRequest; + + /** + * Creates a plain object from a SendPacketsRequest message. Also converts values to other types if specified. + * @param message SendPacketsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.SendPacketsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SendPacketsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SendPacketsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SendPacketsResponse. */ + interface ISendPacketsResponse { + } + + /** Represents a SendPacketsResponse. */ + class SendPacketsResponse implements ISendPacketsResponse { + + /** + * Constructs a new SendPacketsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.ISendPacketsResponse); + + /** + * Creates a new SendPacketsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SendPacketsResponse instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.ISendPacketsResponse): google.cloud.visionai.v1alpha1.SendPacketsResponse; + + /** + * Encodes the specified SendPacketsResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.SendPacketsResponse.verify|verify} messages. + * @param message SendPacketsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.ISendPacketsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SendPacketsResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.SendPacketsResponse.verify|verify} messages. + * @param message SendPacketsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.ISendPacketsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SendPacketsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SendPacketsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.SendPacketsResponse; + + /** + * Decodes a SendPacketsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SendPacketsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.SendPacketsResponse; + + /** + * Verifies a SendPacketsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SendPacketsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SendPacketsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.SendPacketsResponse; + + /** + * Creates a plain object from a SendPacketsResponse message. Also converts values to other types if specified. + * @param message SendPacketsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.SendPacketsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SendPacketsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SendPacketsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReceivePacketsRequest. */ + interface IReceivePacketsRequest { + + /** ReceivePacketsRequest setupRequest */ + setupRequest?: (google.cloud.visionai.v1alpha1.ReceivePacketsRequest.ISetupRequest|null); + + /** ReceivePacketsRequest commitRequest */ + commitRequest?: (google.cloud.visionai.v1alpha1.ICommitRequest|null); + } + + /** Represents a ReceivePacketsRequest. */ + class ReceivePacketsRequest implements IReceivePacketsRequest { + + /** + * Constructs a new ReceivePacketsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IReceivePacketsRequest); + + /** ReceivePacketsRequest setupRequest. */ + public setupRequest?: (google.cloud.visionai.v1alpha1.ReceivePacketsRequest.ISetupRequest|null); + + /** ReceivePacketsRequest commitRequest. */ + public commitRequest?: (google.cloud.visionai.v1alpha1.ICommitRequest|null); + + /** ReceivePacketsRequest request. */ + public request?: ("setupRequest"|"commitRequest"); + + /** + * Creates a new ReceivePacketsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ReceivePacketsRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IReceivePacketsRequest): google.cloud.visionai.v1alpha1.ReceivePacketsRequest; + + /** + * Encodes the specified ReceivePacketsRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ReceivePacketsRequest.verify|verify} messages. + * @param message ReceivePacketsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IReceivePacketsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReceivePacketsRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ReceivePacketsRequest.verify|verify} messages. + * @param message ReceivePacketsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IReceivePacketsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReceivePacketsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReceivePacketsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ReceivePacketsRequest; + + /** + * Decodes a ReceivePacketsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReceivePacketsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ReceivePacketsRequest; + + /** + * Verifies a ReceivePacketsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReceivePacketsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReceivePacketsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ReceivePacketsRequest; + + /** + * Creates a plain object from a ReceivePacketsRequest message. Also converts values to other types if specified. + * @param message ReceivePacketsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ReceivePacketsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReceivePacketsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReceivePacketsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ReceivePacketsRequest { + + /** Properties of a SetupRequest. */ + interface ISetupRequest { + + /** SetupRequest eagerReceiveMode */ + eagerReceiveMode?: (google.cloud.visionai.v1alpha1.IEagerMode|null); + + /** SetupRequest controlledReceiveMode */ + controlledReceiveMode?: (google.cloud.visionai.v1alpha1.IControlledMode|null); + + /** SetupRequest metadata */ + metadata?: (google.cloud.visionai.v1alpha1.IRequestMetadata|null); + + /** SetupRequest receiver */ + receiver?: (string|null); + + /** SetupRequest heartbeatInterval */ + heartbeatInterval?: (google.protobuf.IDuration|null); + + /** SetupRequest writesDoneGracePeriod */ + writesDoneGracePeriod?: (google.protobuf.IDuration|null); + } + + /** Represents a SetupRequest. */ + class SetupRequest implements ISetupRequest { + + /** + * Constructs a new SetupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.ReceivePacketsRequest.ISetupRequest); + + /** SetupRequest eagerReceiveMode. */ + public eagerReceiveMode?: (google.cloud.visionai.v1alpha1.IEagerMode|null); + + /** SetupRequest controlledReceiveMode. */ + public controlledReceiveMode?: (google.cloud.visionai.v1alpha1.IControlledMode|null); + + /** SetupRequest metadata. */ + public metadata?: (google.cloud.visionai.v1alpha1.IRequestMetadata|null); + + /** SetupRequest receiver. */ + public receiver: string; + + /** SetupRequest heartbeatInterval. */ + public heartbeatInterval?: (google.protobuf.IDuration|null); + + /** SetupRequest writesDoneGracePeriod. */ + public writesDoneGracePeriod?: (google.protobuf.IDuration|null); + + /** SetupRequest consumerMode. */ + public consumerMode?: ("eagerReceiveMode"|"controlledReceiveMode"); + + /** + * Creates a new SetupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetupRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.ReceivePacketsRequest.ISetupRequest): google.cloud.visionai.v1alpha1.ReceivePacketsRequest.SetupRequest; + + /** + * Encodes the specified SetupRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ReceivePacketsRequest.SetupRequest.verify|verify} messages. + * @param message SetupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.ReceivePacketsRequest.ISetupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetupRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ReceivePacketsRequest.SetupRequest.verify|verify} messages. + * @param message SetupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.ReceivePacketsRequest.ISetupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ReceivePacketsRequest.SetupRequest; + + /** + * Decodes a SetupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ReceivePacketsRequest.SetupRequest; + + /** + * Verifies a SetupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ReceivePacketsRequest.SetupRequest; + + /** + * Creates a plain object from a SetupRequest message. Also converts values to other types if specified. + * @param message SetupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ReceivePacketsRequest.SetupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SetupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ReceivePacketsControlResponse. */ + interface IReceivePacketsControlResponse { + + /** ReceivePacketsControlResponse heartbeat */ + heartbeat?: (boolean|null); + + /** ReceivePacketsControlResponse writesDoneRequest */ + writesDoneRequest?: (boolean|null); + } + + /** Represents a ReceivePacketsControlResponse. */ + class ReceivePacketsControlResponse implements IReceivePacketsControlResponse { + + /** + * Constructs a new ReceivePacketsControlResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IReceivePacketsControlResponse); + + /** ReceivePacketsControlResponse heartbeat. */ + public heartbeat?: (boolean|null); + + /** ReceivePacketsControlResponse writesDoneRequest. */ + public writesDoneRequest?: (boolean|null); + + /** ReceivePacketsControlResponse control. */ + public control?: ("heartbeat"|"writesDoneRequest"); + + /** + * Creates a new ReceivePacketsControlResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ReceivePacketsControlResponse instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IReceivePacketsControlResponse): google.cloud.visionai.v1alpha1.ReceivePacketsControlResponse; + + /** + * Encodes the specified ReceivePacketsControlResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ReceivePacketsControlResponse.verify|verify} messages. + * @param message ReceivePacketsControlResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IReceivePacketsControlResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReceivePacketsControlResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ReceivePacketsControlResponse.verify|verify} messages. + * @param message ReceivePacketsControlResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IReceivePacketsControlResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReceivePacketsControlResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReceivePacketsControlResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ReceivePacketsControlResponse; + + /** + * Decodes a ReceivePacketsControlResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReceivePacketsControlResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ReceivePacketsControlResponse; + + /** + * Verifies a ReceivePacketsControlResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReceivePacketsControlResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReceivePacketsControlResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ReceivePacketsControlResponse; + + /** + * Creates a plain object from a ReceivePacketsControlResponse message. Also converts values to other types if specified. + * @param message ReceivePacketsControlResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ReceivePacketsControlResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReceivePacketsControlResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReceivePacketsControlResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReceivePacketsResponse. */ + interface IReceivePacketsResponse { + + /** ReceivePacketsResponse packet */ + packet?: (google.cloud.visionai.v1alpha1.IPacket|null); + + /** ReceivePacketsResponse control */ + control?: (google.cloud.visionai.v1alpha1.IReceivePacketsControlResponse|null); + } + + /** Represents a ReceivePacketsResponse. */ + class ReceivePacketsResponse implements IReceivePacketsResponse { + + /** + * Constructs a new ReceivePacketsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IReceivePacketsResponse); + + /** ReceivePacketsResponse packet. */ + public packet?: (google.cloud.visionai.v1alpha1.IPacket|null); + + /** ReceivePacketsResponse control. */ + public control?: (google.cloud.visionai.v1alpha1.IReceivePacketsControlResponse|null); + + /** ReceivePacketsResponse response. */ + public response?: ("packet"|"control"); + + /** + * Creates a new ReceivePacketsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ReceivePacketsResponse instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IReceivePacketsResponse): google.cloud.visionai.v1alpha1.ReceivePacketsResponse; + + /** + * Encodes the specified ReceivePacketsResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ReceivePacketsResponse.verify|verify} messages. + * @param message ReceivePacketsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IReceivePacketsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReceivePacketsResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ReceivePacketsResponse.verify|verify} messages. + * @param message ReceivePacketsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IReceivePacketsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReceivePacketsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReceivePacketsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ReceivePacketsResponse; + + /** + * Decodes a ReceivePacketsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReceivePacketsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ReceivePacketsResponse; + + /** + * Verifies a ReceivePacketsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReceivePacketsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReceivePacketsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ReceivePacketsResponse; + + /** + * Creates a plain object from a ReceivePacketsResponse message. Also converts values to other types if specified. + * @param message ReceivePacketsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ReceivePacketsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReceivePacketsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReceivePacketsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EagerMode. */ + interface IEagerMode { + } + + /** Represents an EagerMode. */ + class EagerMode implements IEagerMode { + + /** + * Constructs a new EagerMode. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IEagerMode); + + /** + * Creates a new EagerMode instance using the specified properties. + * @param [properties] Properties to set + * @returns EagerMode instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IEagerMode): google.cloud.visionai.v1alpha1.EagerMode; + + /** + * Encodes the specified EagerMode message. Does not implicitly {@link google.cloud.visionai.v1alpha1.EagerMode.verify|verify} messages. + * @param message EagerMode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IEagerMode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EagerMode message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.EagerMode.verify|verify} messages. + * @param message EagerMode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IEagerMode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EagerMode message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EagerMode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.EagerMode; + + /** + * Decodes an EagerMode message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EagerMode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.EagerMode; + + /** + * Verifies an EagerMode message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EagerMode message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EagerMode + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.EagerMode; + + /** + * Creates a plain object from an EagerMode message. Also converts values to other types if specified. + * @param message EagerMode + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.EagerMode, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EagerMode to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EagerMode + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ControlledMode. */ + interface IControlledMode { + + /** ControlledMode startingLogicalOffset */ + startingLogicalOffset?: (string|null); + + /** ControlledMode fallbackStartingOffset */ + fallbackStartingOffset?: (string|null); + } + + /** Represents a ControlledMode. */ + class ControlledMode implements IControlledMode { + + /** + * Constructs a new ControlledMode. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IControlledMode); + + /** ControlledMode startingLogicalOffset. */ + public startingLogicalOffset?: (string|null); + + /** ControlledMode fallbackStartingOffset. */ + public fallbackStartingOffset: string; + + /** ControlledMode startingOffset. */ + public startingOffset?: "startingLogicalOffset"; + + /** + * Creates a new ControlledMode instance using the specified properties. + * @param [properties] Properties to set + * @returns ControlledMode instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IControlledMode): google.cloud.visionai.v1alpha1.ControlledMode; + + /** + * Encodes the specified ControlledMode message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ControlledMode.verify|verify} messages. + * @param message ControlledMode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IControlledMode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ControlledMode message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ControlledMode.verify|verify} messages. + * @param message ControlledMode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IControlledMode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ControlledMode message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ControlledMode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ControlledMode; + + /** + * Decodes a ControlledMode message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ControlledMode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ControlledMode; + + /** + * Verifies a ControlledMode message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ControlledMode message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ControlledMode + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ControlledMode; + + /** + * Creates a plain object from a ControlledMode message. Also converts values to other types if specified. + * @param message ControlledMode + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ControlledMode, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ControlledMode to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ControlledMode + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CommitRequest. */ + interface ICommitRequest { + + /** CommitRequest offset */ + offset?: (number|Long|string|null); + } + + /** Represents a CommitRequest. */ + class CommitRequest implements ICommitRequest { + + /** + * Constructs a new CommitRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.ICommitRequest); + + /** CommitRequest offset. */ + public offset: (number|Long|string); + + /** + * Creates a new CommitRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CommitRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.ICommitRequest): google.cloud.visionai.v1alpha1.CommitRequest; + + /** + * Encodes the specified CommitRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.CommitRequest.verify|verify} messages. + * @param message CommitRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.ICommitRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommitRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.CommitRequest.verify|verify} messages. + * @param message CommitRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.ICommitRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommitRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommitRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.CommitRequest; + + /** + * Decodes a CommitRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommitRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.CommitRequest; + + /** + * Verifies a CommitRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CommitRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommitRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.CommitRequest; + + /** + * Creates a plain object from a CommitRequest message. Also converts values to other types if specified. + * @param message CommitRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.CommitRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommitRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CommitRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Stream. */ + interface IStream { + + /** Stream name */ + name?: (string|null); + + /** Stream createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Stream updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Stream labels */ + labels?: ({ [k: string]: string }|null); + + /** Stream annotations */ + annotations?: ({ [k: string]: string }|null); + + /** Stream displayName */ + displayName?: (string|null); + + /** Stream enableHlsPlayback */ + enableHlsPlayback?: (boolean|null); + + /** Stream mediaWarehouseAsset */ + mediaWarehouseAsset?: (string|null); + } + + /** Represents a Stream. */ + class Stream implements IStream { + + /** + * Constructs a new Stream. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IStream); + + /** Stream name. */ + public name: string; + + /** Stream createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Stream updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Stream labels. */ + public labels: { [k: string]: string }; + + /** Stream annotations. */ + public annotations: { [k: string]: string }; + + /** Stream displayName. */ + public displayName: string; + + /** Stream enableHlsPlayback. */ + public enableHlsPlayback: boolean; + + /** Stream mediaWarehouseAsset. */ + public mediaWarehouseAsset: string; + + /** + * Creates a new Stream instance using the specified properties. + * @param [properties] Properties to set + * @returns Stream instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IStream): google.cloud.visionai.v1alpha1.Stream; + + /** + * Encodes the specified Stream message. Does not implicitly {@link google.cloud.visionai.v1alpha1.Stream.verify|verify} messages. + * @param message Stream message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IStream, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Stream message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.Stream.verify|verify} messages. + * @param message Stream message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IStream, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Stream message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Stream + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.Stream; + + /** + * Decodes a Stream message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Stream + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.Stream; + + /** + * Verifies a Stream message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Stream message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Stream + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.Stream; + + /** + * Creates a plain object from a Stream message. Also converts values to other types if specified. + * @param message Stream + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.Stream, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Stream to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Stream + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Event. */ + interface IEvent { + + /** Event name */ + name?: (string|null); + + /** Event createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Event updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Event labels */ + labels?: ({ [k: string]: string }|null); + + /** Event annotations */ + annotations?: ({ [k: string]: string }|null); + + /** Event alignmentClock */ + alignmentClock?: (google.cloud.visionai.v1alpha1.Event.Clock|keyof typeof google.cloud.visionai.v1alpha1.Event.Clock|null); + + /** Event gracePeriod */ + gracePeriod?: (google.protobuf.IDuration|null); + } + + /** Represents an Event. */ + class Event implements IEvent { + + /** + * Constructs a new Event. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IEvent); + + /** Event name. */ + public name: string; + + /** Event createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Event updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Event labels. */ + public labels: { [k: string]: string }; + + /** Event annotations. */ + public annotations: { [k: string]: string }; + + /** Event alignmentClock. */ + public alignmentClock: (google.cloud.visionai.v1alpha1.Event.Clock|keyof typeof google.cloud.visionai.v1alpha1.Event.Clock); + + /** Event gracePeriod. */ + public gracePeriod?: (google.protobuf.IDuration|null); + + /** + * Creates a new Event instance using the specified properties. + * @param [properties] Properties to set + * @returns Event instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IEvent): google.cloud.visionai.v1alpha1.Event; + + /** + * Encodes the specified Event message. Does not implicitly {@link google.cloud.visionai.v1alpha1.Event.verify|verify} messages. + * @param message Event message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Event message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.Event.verify|verify} messages. + * @param message Event message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Event message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Event + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.Event; + + /** + * Decodes an Event message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Event + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.Event; + + /** + * Verifies an Event message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Event message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Event + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.Event; + + /** + * Creates a plain object from an Event message. Also converts values to other types if specified. + * @param message Event + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.Event, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Event to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Event + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Event { + + /** Clock enum. */ + enum Clock { + CLOCK_UNSPECIFIED = 0, + CAPTURE = 1, + INGEST = 2 + } + } + + /** Properties of a Series. */ + interface ISeries { + + /** Series name */ + name?: (string|null); + + /** Series createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Series updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Series labels */ + labels?: ({ [k: string]: string }|null); + + /** Series annotations */ + annotations?: ({ [k: string]: string }|null); + + /** Series stream */ + stream?: (string|null); + + /** Series event */ + event?: (string|null); + } + + /** Represents a Series. */ + class Series implements ISeries { + + /** + * Constructs a new Series. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.ISeries); + + /** Series name. */ + public name: string; + + /** Series createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Series updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Series labels. */ + public labels: { [k: string]: string }; + + /** Series annotations. */ + public annotations: { [k: string]: string }; + + /** Series stream. */ + public stream: string; + + /** Series event. */ + public event: string; + + /** + * Creates a new Series instance using the specified properties. + * @param [properties] Properties to set + * @returns Series instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.ISeries): google.cloud.visionai.v1alpha1.Series; + + /** + * Encodes the specified Series message. Does not implicitly {@link google.cloud.visionai.v1alpha1.Series.verify|verify} messages. + * @param message Series message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.ISeries, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Series message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.Series.verify|verify} messages. + * @param message Series message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.ISeries, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Series message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Series + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.Series; + + /** + * Decodes a Series message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Series + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.Series; + + /** + * Verifies a Series message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Series message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Series + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.Series; + + /** + * Creates a plain object from a Series message. Also converts values to other types if specified. + * @param message Series + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.Series, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Series to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Series + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Channel. */ + interface IChannel { + + /** Channel name */ + name?: (string|null); + + /** Channel createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Channel updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Channel labels */ + labels?: ({ [k: string]: string }|null); + + /** Channel annotations */ + annotations?: ({ [k: string]: string }|null); + + /** Channel stream */ + stream?: (string|null); + + /** Channel event */ + event?: (string|null); + } + + /** Represents a Channel. */ + class Channel implements IChannel { + + /** + * Constructs a new Channel. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IChannel); + + /** Channel name. */ + public name: string; + + /** Channel createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Channel updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Channel labels. */ + public labels: { [k: string]: string }; + + /** Channel annotations. */ + public annotations: { [k: string]: string }; + + /** Channel stream. */ + public stream: string; + + /** Channel event. */ + public event: string; + + /** + * Creates a new Channel instance using the specified properties. + * @param [properties] Properties to set + * @returns Channel instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IChannel): google.cloud.visionai.v1alpha1.Channel; + + /** + * Encodes the specified Channel message. Does not implicitly {@link google.cloud.visionai.v1alpha1.Channel.verify|verify} messages. + * @param message Channel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IChannel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Channel message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.Channel.verify|verify} messages. + * @param message Channel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IChannel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Channel message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Channel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.Channel; + + /** + * Decodes a Channel message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Channel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.Channel; + + /** + * Verifies a Channel message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Channel message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Channel + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.Channel; + + /** + * Creates a plain object from a Channel message. Also converts values to other types if specified. + * @param message Channel + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.Channel, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Channel to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Channel + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a StreamsService */ + class StreamsService extends $protobuf.rpc.Service { + + /** + * Constructs a new StreamsService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new StreamsService service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): StreamsService; + + /** + * Calls ListClusters. + * @param request ListClustersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListClustersResponse + */ + public listClusters(request: google.cloud.visionai.v1alpha1.IListClustersRequest, callback: google.cloud.visionai.v1alpha1.StreamsService.ListClustersCallback): void; + + /** + * Calls ListClusters. + * @param request ListClustersRequest message or plain object + * @returns Promise + */ + public listClusters(request: google.cloud.visionai.v1alpha1.IListClustersRequest): Promise; + + /** + * Calls GetCluster. + * @param request GetClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Cluster + */ + public getCluster(request: google.cloud.visionai.v1alpha1.IGetClusterRequest, callback: google.cloud.visionai.v1alpha1.StreamsService.GetClusterCallback): void; + + /** + * Calls GetCluster. + * @param request GetClusterRequest message or plain object + * @returns Promise + */ + public getCluster(request: google.cloud.visionai.v1alpha1.IGetClusterRequest): Promise; + + /** + * Calls CreateCluster. + * @param request CreateClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createCluster(request: google.cloud.visionai.v1alpha1.ICreateClusterRequest, callback: google.cloud.visionai.v1alpha1.StreamsService.CreateClusterCallback): void; + + /** + * Calls CreateCluster. + * @param request CreateClusterRequest message or plain object + * @returns Promise + */ + public createCluster(request: google.cloud.visionai.v1alpha1.ICreateClusterRequest): Promise; + + /** + * Calls UpdateCluster. + * @param request UpdateClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateCluster(request: google.cloud.visionai.v1alpha1.IUpdateClusterRequest, callback: google.cloud.visionai.v1alpha1.StreamsService.UpdateClusterCallback): void; + + /** + * Calls UpdateCluster. + * @param request UpdateClusterRequest message or plain object + * @returns Promise + */ + public updateCluster(request: google.cloud.visionai.v1alpha1.IUpdateClusterRequest): Promise; + + /** + * Calls DeleteCluster. + * @param request DeleteClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteCluster(request: google.cloud.visionai.v1alpha1.IDeleteClusterRequest, callback: google.cloud.visionai.v1alpha1.StreamsService.DeleteClusterCallback): void; + + /** + * Calls DeleteCluster. + * @param request DeleteClusterRequest message or plain object + * @returns Promise + */ + public deleteCluster(request: google.cloud.visionai.v1alpha1.IDeleteClusterRequest): Promise; + + /** + * Calls ListStreams. + * @param request ListStreamsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListStreamsResponse + */ + public listStreams(request: google.cloud.visionai.v1alpha1.IListStreamsRequest, callback: google.cloud.visionai.v1alpha1.StreamsService.ListStreamsCallback): void; + + /** + * Calls ListStreams. + * @param request ListStreamsRequest message or plain object + * @returns Promise + */ + public listStreams(request: google.cloud.visionai.v1alpha1.IListStreamsRequest): Promise; + + /** + * Calls GetStream. + * @param request GetStreamRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Stream + */ + public getStream(request: google.cloud.visionai.v1alpha1.IGetStreamRequest, callback: google.cloud.visionai.v1alpha1.StreamsService.GetStreamCallback): void; + + /** + * Calls GetStream. + * @param request GetStreamRequest message or plain object + * @returns Promise + */ + public getStream(request: google.cloud.visionai.v1alpha1.IGetStreamRequest): Promise; + + /** + * Calls CreateStream. + * @param request CreateStreamRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createStream(request: google.cloud.visionai.v1alpha1.ICreateStreamRequest, callback: google.cloud.visionai.v1alpha1.StreamsService.CreateStreamCallback): void; + + /** + * Calls CreateStream. + * @param request CreateStreamRequest message or plain object + * @returns Promise + */ + public createStream(request: google.cloud.visionai.v1alpha1.ICreateStreamRequest): Promise; + + /** + * Calls UpdateStream. + * @param request UpdateStreamRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateStream(request: google.cloud.visionai.v1alpha1.IUpdateStreamRequest, callback: google.cloud.visionai.v1alpha1.StreamsService.UpdateStreamCallback): void; + + /** + * Calls UpdateStream. + * @param request UpdateStreamRequest message or plain object + * @returns Promise + */ + public updateStream(request: google.cloud.visionai.v1alpha1.IUpdateStreamRequest): Promise; + + /** + * Calls DeleteStream. + * @param request DeleteStreamRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteStream(request: google.cloud.visionai.v1alpha1.IDeleteStreamRequest, callback: google.cloud.visionai.v1alpha1.StreamsService.DeleteStreamCallback): void; + + /** + * Calls DeleteStream. + * @param request DeleteStreamRequest message or plain object + * @returns Promise + */ + public deleteStream(request: google.cloud.visionai.v1alpha1.IDeleteStreamRequest): Promise; + + /** + * Calls GenerateStreamHlsToken. + * @param request GenerateStreamHlsTokenRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GenerateStreamHlsTokenResponse + */ + public generateStreamHlsToken(request: google.cloud.visionai.v1alpha1.IGenerateStreamHlsTokenRequest, callback: google.cloud.visionai.v1alpha1.StreamsService.GenerateStreamHlsTokenCallback): void; + + /** + * Calls GenerateStreamHlsToken. + * @param request GenerateStreamHlsTokenRequest message or plain object + * @returns Promise + */ + public generateStreamHlsToken(request: google.cloud.visionai.v1alpha1.IGenerateStreamHlsTokenRequest): Promise; + + /** + * Calls ListEvents. + * @param request ListEventsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListEventsResponse + */ + public listEvents(request: google.cloud.visionai.v1alpha1.IListEventsRequest, callback: google.cloud.visionai.v1alpha1.StreamsService.ListEventsCallback): void; + + /** + * Calls ListEvents. + * @param request ListEventsRequest message or plain object + * @returns Promise + */ + public listEvents(request: google.cloud.visionai.v1alpha1.IListEventsRequest): Promise; + + /** + * Calls GetEvent. + * @param request GetEventRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Event + */ + public getEvent(request: google.cloud.visionai.v1alpha1.IGetEventRequest, callback: google.cloud.visionai.v1alpha1.StreamsService.GetEventCallback): void; + + /** + * Calls GetEvent. + * @param request GetEventRequest message or plain object + * @returns Promise + */ + public getEvent(request: google.cloud.visionai.v1alpha1.IGetEventRequest): Promise; + + /** + * Calls CreateEvent. + * @param request CreateEventRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createEvent(request: google.cloud.visionai.v1alpha1.ICreateEventRequest, callback: google.cloud.visionai.v1alpha1.StreamsService.CreateEventCallback): void; + + /** + * Calls CreateEvent. + * @param request CreateEventRequest message or plain object + * @returns Promise + */ + public createEvent(request: google.cloud.visionai.v1alpha1.ICreateEventRequest): Promise; + + /** + * Calls UpdateEvent. + * @param request UpdateEventRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateEvent(request: google.cloud.visionai.v1alpha1.IUpdateEventRequest, callback: google.cloud.visionai.v1alpha1.StreamsService.UpdateEventCallback): void; + + /** + * Calls UpdateEvent. + * @param request UpdateEventRequest message or plain object + * @returns Promise + */ + public updateEvent(request: google.cloud.visionai.v1alpha1.IUpdateEventRequest): Promise; + + /** + * Calls DeleteEvent. + * @param request DeleteEventRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteEvent(request: google.cloud.visionai.v1alpha1.IDeleteEventRequest, callback: google.cloud.visionai.v1alpha1.StreamsService.DeleteEventCallback): void; + + /** + * Calls DeleteEvent. + * @param request DeleteEventRequest message or plain object + * @returns Promise + */ + public deleteEvent(request: google.cloud.visionai.v1alpha1.IDeleteEventRequest): Promise; + + /** + * Calls ListSeries. + * @param request ListSeriesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSeriesResponse + */ + public listSeries(request: google.cloud.visionai.v1alpha1.IListSeriesRequest, callback: google.cloud.visionai.v1alpha1.StreamsService.ListSeriesCallback): void; + + /** + * Calls ListSeries. + * @param request ListSeriesRequest message or plain object + * @returns Promise + */ + public listSeries(request: google.cloud.visionai.v1alpha1.IListSeriesRequest): Promise; + + /** + * Calls GetSeries. + * @param request GetSeriesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Series + */ + public getSeries(request: google.cloud.visionai.v1alpha1.IGetSeriesRequest, callback: google.cloud.visionai.v1alpha1.StreamsService.GetSeriesCallback): void; + + /** + * Calls GetSeries. + * @param request GetSeriesRequest message or plain object + * @returns Promise + */ + public getSeries(request: google.cloud.visionai.v1alpha1.IGetSeriesRequest): Promise; + + /** + * Calls CreateSeries. + * @param request CreateSeriesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createSeries(request: google.cloud.visionai.v1alpha1.ICreateSeriesRequest, callback: google.cloud.visionai.v1alpha1.StreamsService.CreateSeriesCallback): void; + + /** + * Calls CreateSeries. + * @param request CreateSeriesRequest message or plain object + * @returns Promise + */ + public createSeries(request: google.cloud.visionai.v1alpha1.ICreateSeriesRequest): Promise; + + /** + * Calls UpdateSeries. + * @param request UpdateSeriesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateSeries(request: google.cloud.visionai.v1alpha1.IUpdateSeriesRequest, callback: google.cloud.visionai.v1alpha1.StreamsService.UpdateSeriesCallback): void; + + /** + * Calls UpdateSeries. + * @param request UpdateSeriesRequest message or plain object + * @returns Promise + */ + public updateSeries(request: google.cloud.visionai.v1alpha1.IUpdateSeriesRequest): Promise; + + /** + * Calls DeleteSeries. + * @param request DeleteSeriesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteSeries(request: google.cloud.visionai.v1alpha1.IDeleteSeriesRequest, callback: google.cloud.visionai.v1alpha1.StreamsService.DeleteSeriesCallback): void; + + /** + * Calls DeleteSeries. + * @param request DeleteSeriesRequest message or plain object + * @returns Promise + */ + public deleteSeries(request: google.cloud.visionai.v1alpha1.IDeleteSeriesRequest): Promise; + + /** + * Calls MaterializeChannel. + * @param request MaterializeChannelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public materializeChannel(request: google.cloud.visionai.v1alpha1.IMaterializeChannelRequest, callback: google.cloud.visionai.v1alpha1.StreamsService.MaterializeChannelCallback): void; + + /** + * Calls MaterializeChannel. + * @param request MaterializeChannelRequest message or plain object + * @returns Promise + */ + public materializeChannel(request: google.cloud.visionai.v1alpha1.IMaterializeChannelRequest): Promise; + } + + namespace StreamsService { + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.StreamsService|listClusters}. + * @param error Error, if any + * @param [response] ListClustersResponse + */ + type ListClustersCallback = (error: (Error|null), response?: google.cloud.visionai.v1alpha1.ListClustersResponse) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.StreamsService|getCluster}. + * @param error Error, if any + * @param [response] Cluster + */ + type GetClusterCallback = (error: (Error|null), response?: google.cloud.visionai.v1alpha1.Cluster) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.StreamsService|createCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.StreamsService|updateCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.StreamsService|deleteCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.StreamsService|listStreams}. + * @param error Error, if any + * @param [response] ListStreamsResponse + */ + type ListStreamsCallback = (error: (Error|null), response?: google.cloud.visionai.v1alpha1.ListStreamsResponse) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.StreamsService|getStream}. + * @param error Error, if any + * @param [response] Stream + */ + type GetStreamCallback = (error: (Error|null), response?: google.cloud.visionai.v1alpha1.Stream) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.StreamsService|createStream}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateStreamCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.StreamsService|updateStream}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateStreamCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.StreamsService|deleteStream}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteStreamCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.StreamsService|generateStreamHlsToken}. + * @param error Error, if any + * @param [response] GenerateStreamHlsTokenResponse + */ + type GenerateStreamHlsTokenCallback = (error: (Error|null), response?: google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenResponse) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.StreamsService|listEvents}. + * @param error Error, if any + * @param [response] ListEventsResponse + */ + type ListEventsCallback = (error: (Error|null), response?: google.cloud.visionai.v1alpha1.ListEventsResponse) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.StreamsService|getEvent}. + * @param error Error, if any + * @param [response] Event + */ + type GetEventCallback = (error: (Error|null), response?: google.cloud.visionai.v1alpha1.Event) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.StreamsService|createEvent}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateEventCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.StreamsService|updateEvent}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateEventCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.StreamsService|deleteEvent}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteEventCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.StreamsService|listSeries}. + * @param error Error, if any + * @param [response] ListSeriesResponse + */ + type ListSeriesCallback = (error: (Error|null), response?: google.cloud.visionai.v1alpha1.ListSeriesResponse) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.StreamsService|getSeries}. + * @param error Error, if any + * @param [response] Series + */ + type GetSeriesCallback = (error: (Error|null), response?: google.cloud.visionai.v1alpha1.Series) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.StreamsService|createSeries}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateSeriesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.StreamsService|updateSeries}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateSeriesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.StreamsService|deleteSeries}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteSeriesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.StreamsService|materializeChannel}. + * @param error Error, if any + * @param [response] Operation + */ + type MaterializeChannelCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a ListClustersRequest. */ + interface IListClustersRequest { + + /** ListClustersRequest parent */ + parent?: (string|null); + + /** ListClustersRequest pageSize */ + pageSize?: (number|null); + + /** ListClustersRequest pageToken */ + pageToken?: (string|null); + + /** ListClustersRequest filter */ + filter?: (string|null); + + /** ListClustersRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListClustersRequest. */ + class ListClustersRequest implements IListClustersRequest { + + /** + * Constructs a new ListClustersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IListClustersRequest); + + /** ListClustersRequest parent. */ + public parent: string; + + /** ListClustersRequest pageSize. */ + public pageSize: number; + + /** ListClustersRequest pageToken. */ + public pageToken: string; + + /** ListClustersRequest filter. */ + public filter: string; + + /** ListClustersRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListClustersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListClustersRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IListClustersRequest): google.cloud.visionai.v1alpha1.ListClustersRequest; + + /** + * Encodes the specified ListClustersRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListClustersRequest.verify|verify} messages. + * @param message ListClustersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IListClustersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListClustersRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListClustersRequest.verify|verify} messages. + * @param message ListClustersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IListClustersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListClustersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListClustersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ListClustersRequest; + + /** + * Decodes a ListClustersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListClustersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ListClustersRequest; + + /** + * Verifies a ListClustersRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListClustersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListClustersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ListClustersRequest; + + /** + * Creates a plain object from a ListClustersRequest message. Also converts values to other types if specified. + * @param message ListClustersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ListClustersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListClustersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListClustersRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListClustersResponse. */ + interface IListClustersResponse { + + /** ListClustersResponse clusters */ + clusters?: (google.cloud.visionai.v1alpha1.ICluster[]|null); + + /** ListClustersResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListClustersResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListClustersResponse. */ + class ListClustersResponse implements IListClustersResponse { + + /** + * Constructs a new ListClustersResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IListClustersResponse); + + /** ListClustersResponse clusters. */ + public clusters: google.cloud.visionai.v1alpha1.ICluster[]; + + /** ListClustersResponse nextPageToken. */ + public nextPageToken: string; + + /** ListClustersResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListClustersResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListClustersResponse instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IListClustersResponse): google.cloud.visionai.v1alpha1.ListClustersResponse; + + /** + * Encodes the specified ListClustersResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListClustersResponse.verify|verify} messages. + * @param message ListClustersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IListClustersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListClustersResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListClustersResponse.verify|verify} messages. + * @param message ListClustersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IListClustersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListClustersResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListClustersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ListClustersResponse; + + /** + * Decodes a ListClustersResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListClustersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ListClustersResponse; + + /** + * Verifies a ListClustersResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListClustersResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListClustersResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ListClustersResponse; + + /** + * Creates a plain object from a ListClustersResponse message. Also converts values to other types if specified. + * @param message ListClustersResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ListClustersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListClustersResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListClustersResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetClusterRequest. */ + interface IGetClusterRequest { + + /** GetClusterRequest name */ + name?: (string|null); + } + + /** Represents a GetClusterRequest. */ + class GetClusterRequest implements IGetClusterRequest { + + /** + * Constructs a new GetClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IGetClusterRequest); + + /** GetClusterRequest name. */ + public name: string; + + /** + * Creates a new GetClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetClusterRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IGetClusterRequest): google.cloud.visionai.v1alpha1.GetClusterRequest; + + /** + * Encodes the specified GetClusterRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetClusterRequest.verify|verify} messages. + * @param message GetClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IGetClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetClusterRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetClusterRequest.verify|verify} messages. + * @param message GetClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IGetClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.GetClusterRequest; + + /** + * Decodes a GetClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.GetClusterRequest; + + /** + * Verifies a GetClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.GetClusterRequest; + + /** + * Creates a plain object from a GetClusterRequest message. Also converts values to other types if specified. + * @param message GetClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.GetClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateClusterRequest. */ + interface ICreateClusterRequest { + + /** CreateClusterRequest parent */ + parent?: (string|null); + + /** CreateClusterRequest clusterId */ + clusterId?: (string|null); + + /** CreateClusterRequest cluster */ + cluster?: (google.cloud.visionai.v1alpha1.ICluster|null); + + /** CreateClusterRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateClusterRequest. */ + class CreateClusterRequest implements ICreateClusterRequest { + + /** + * Constructs a new CreateClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.ICreateClusterRequest); + + /** CreateClusterRequest parent. */ + public parent: string; + + /** CreateClusterRequest clusterId. */ + public clusterId: string; + + /** CreateClusterRequest cluster. */ + public cluster?: (google.cloud.visionai.v1alpha1.ICluster|null); + + /** CreateClusterRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateClusterRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.ICreateClusterRequest): google.cloud.visionai.v1alpha1.CreateClusterRequest; + + /** + * Encodes the specified CreateClusterRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateClusterRequest.verify|verify} messages. + * @param message CreateClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.ICreateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateClusterRequest.verify|verify} messages. + * @param message CreateClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.ICreateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.CreateClusterRequest; + + /** + * Decodes a CreateClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.CreateClusterRequest; + + /** + * Verifies a CreateClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.CreateClusterRequest; + + /** + * Creates a plain object from a CreateClusterRequest message. Also converts values to other types if specified. + * @param message CreateClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.CreateClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateClusterRequest. */ + interface IUpdateClusterRequest { + + /** UpdateClusterRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateClusterRequest cluster */ + cluster?: (google.cloud.visionai.v1alpha1.ICluster|null); + + /** UpdateClusterRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateClusterRequest. */ + class UpdateClusterRequest implements IUpdateClusterRequest { + + /** + * Constructs a new UpdateClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IUpdateClusterRequest); + + /** UpdateClusterRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateClusterRequest cluster. */ + public cluster?: (google.cloud.visionai.v1alpha1.ICluster|null); + + /** UpdateClusterRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpdateClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateClusterRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IUpdateClusterRequest): google.cloud.visionai.v1alpha1.UpdateClusterRequest; + + /** + * Encodes the specified UpdateClusterRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateClusterRequest.verify|verify} messages. + * @param message UpdateClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IUpdateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateClusterRequest.verify|verify} messages. + * @param message UpdateClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IUpdateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.UpdateClusterRequest; + + /** + * Decodes an UpdateClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.UpdateClusterRequest; + + /** + * Verifies an UpdateClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.UpdateClusterRequest; + + /** + * Creates a plain object from an UpdateClusterRequest message. Also converts values to other types if specified. + * @param message UpdateClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.UpdateClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteClusterRequest. */ + interface IDeleteClusterRequest { + + /** DeleteClusterRequest name */ + name?: (string|null); + + /** DeleteClusterRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteClusterRequest. */ + class DeleteClusterRequest implements IDeleteClusterRequest { + + /** + * Constructs a new DeleteClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IDeleteClusterRequest); + + /** DeleteClusterRequest name. */ + public name: string; + + /** DeleteClusterRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteClusterRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IDeleteClusterRequest): google.cloud.visionai.v1alpha1.DeleteClusterRequest; + + /** + * Encodes the specified DeleteClusterRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteClusterRequest.verify|verify} messages. + * @param message DeleteClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IDeleteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteClusterRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteClusterRequest.verify|verify} messages. + * @param message DeleteClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IDeleteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.DeleteClusterRequest; + + /** + * Decodes a DeleteClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.DeleteClusterRequest; + + /** + * Verifies a DeleteClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.DeleteClusterRequest; + + /** + * Creates a plain object from a DeleteClusterRequest message. Also converts values to other types if specified. + * @param message DeleteClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.DeleteClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListStreamsRequest. */ + interface IListStreamsRequest { + + /** ListStreamsRequest parent */ + parent?: (string|null); + + /** ListStreamsRequest pageSize */ + pageSize?: (number|null); + + /** ListStreamsRequest pageToken */ + pageToken?: (string|null); + + /** ListStreamsRequest filter */ + filter?: (string|null); + + /** ListStreamsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListStreamsRequest. */ + class ListStreamsRequest implements IListStreamsRequest { + + /** + * Constructs a new ListStreamsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IListStreamsRequest); + + /** ListStreamsRequest parent. */ + public parent: string; + + /** ListStreamsRequest pageSize. */ + public pageSize: number; + + /** ListStreamsRequest pageToken. */ + public pageToken: string; + + /** ListStreamsRequest filter. */ + public filter: string; + + /** ListStreamsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListStreamsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListStreamsRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IListStreamsRequest): google.cloud.visionai.v1alpha1.ListStreamsRequest; + + /** + * Encodes the specified ListStreamsRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListStreamsRequest.verify|verify} messages. + * @param message ListStreamsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IListStreamsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListStreamsRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListStreamsRequest.verify|verify} messages. + * @param message ListStreamsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IListStreamsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListStreamsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListStreamsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ListStreamsRequest; + + /** + * Decodes a ListStreamsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListStreamsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ListStreamsRequest; + + /** + * Verifies a ListStreamsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListStreamsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListStreamsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ListStreamsRequest; + + /** + * Creates a plain object from a ListStreamsRequest message. Also converts values to other types if specified. + * @param message ListStreamsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ListStreamsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListStreamsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListStreamsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListStreamsResponse. */ + interface IListStreamsResponse { + + /** ListStreamsResponse streams */ + streams?: (google.cloud.visionai.v1alpha1.IStream[]|null); + + /** ListStreamsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListStreamsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListStreamsResponse. */ + class ListStreamsResponse implements IListStreamsResponse { + + /** + * Constructs a new ListStreamsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IListStreamsResponse); + + /** ListStreamsResponse streams. */ + public streams: google.cloud.visionai.v1alpha1.IStream[]; + + /** ListStreamsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListStreamsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListStreamsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListStreamsResponse instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IListStreamsResponse): google.cloud.visionai.v1alpha1.ListStreamsResponse; + + /** + * Encodes the specified ListStreamsResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListStreamsResponse.verify|verify} messages. + * @param message ListStreamsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IListStreamsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListStreamsResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListStreamsResponse.verify|verify} messages. + * @param message ListStreamsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IListStreamsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListStreamsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListStreamsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ListStreamsResponse; + + /** + * Decodes a ListStreamsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListStreamsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ListStreamsResponse; + + /** + * Verifies a ListStreamsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListStreamsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListStreamsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ListStreamsResponse; + + /** + * Creates a plain object from a ListStreamsResponse message. Also converts values to other types if specified. + * @param message ListStreamsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ListStreamsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListStreamsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListStreamsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetStreamRequest. */ + interface IGetStreamRequest { + + /** GetStreamRequest name */ + name?: (string|null); + } + + /** Represents a GetStreamRequest. */ + class GetStreamRequest implements IGetStreamRequest { + + /** + * Constructs a new GetStreamRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IGetStreamRequest); + + /** GetStreamRequest name. */ + public name: string; + + /** + * Creates a new GetStreamRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetStreamRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IGetStreamRequest): google.cloud.visionai.v1alpha1.GetStreamRequest; + + /** + * Encodes the specified GetStreamRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetStreamRequest.verify|verify} messages. + * @param message GetStreamRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IGetStreamRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetStreamRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetStreamRequest.verify|verify} messages. + * @param message GetStreamRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IGetStreamRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetStreamRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetStreamRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.GetStreamRequest; + + /** + * Decodes a GetStreamRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetStreamRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.GetStreamRequest; + + /** + * Verifies a GetStreamRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetStreamRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetStreamRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.GetStreamRequest; + + /** + * Creates a plain object from a GetStreamRequest message. Also converts values to other types if specified. + * @param message GetStreamRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.GetStreamRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetStreamRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetStreamRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateStreamRequest. */ + interface ICreateStreamRequest { + + /** CreateStreamRequest parent */ + parent?: (string|null); + + /** CreateStreamRequest streamId */ + streamId?: (string|null); + + /** CreateStreamRequest stream */ + stream?: (google.cloud.visionai.v1alpha1.IStream|null); + + /** CreateStreamRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateStreamRequest. */ + class CreateStreamRequest implements ICreateStreamRequest { + + /** + * Constructs a new CreateStreamRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.ICreateStreamRequest); + + /** CreateStreamRequest parent. */ + public parent: string; + + /** CreateStreamRequest streamId. */ + public streamId: string; + + /** CreateStreamRequest stream. */ + public stream?: (google.cloud.visionai.v1alpha1.IStream|null); + + /** CreateStreamRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateStreamRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateStreamRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.ICreateStreamRequest): google.cloud.visionai.v1alpha1.CreateStreamRequest; + + /** + * Encodes the specified CreateStreamRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateStreamRequest.verify|verify} messages. + * @param message CreateStreamRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.ICreateStreamRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateStreamRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateStreamRequest.verify|verify} messages. + * @param message CreateStreamRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.ICreateStreamRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateStreamRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateStreamRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.CreateStreamRequest; + + /** + * Decodes a CreateStreamRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateStreamRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.CreateStreamRequest; + + /** + * Verifies a CreateStreamRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateStreamRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateStreamRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.CreateStreamRequest; + + /** + * Creates a plain object from a CreateStreamRequest message. Also converts values to other types if specified. + * @param message CreateStreamRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.CreateStreamRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateStreamRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateStreamRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateStreamRequest. */ + interface IUpdateStreamRequest { + + /** UpdateStreamRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateStreamRequest stream */ + stream?: (google.cloud.visionai.v1alpha1.IStream|null); + + /** UpdateStreamRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateStreamRequest. */ + class UpdateStreamRequest implements IUpdateStreamRequest { + + /** + * Constructs a new UpdateStreamRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IUpdateStreamRequest); + + /** UpdateStreamRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateStreamRequest stream. */ + public stream?: (google.cloud.visionai.v1alpha1.IStream|null); + + /** UpdateStreamRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpdateStreamRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateStreamRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IUpdateStreamRequest): google.cloud.visionai.v1alpha1.UpdateStreamRequest; + + /** + * Encodes the specified UpdateStreamRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateStreamRequest.verify|verify} messages. + * @param message UpdateStreamRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IUpdateStreamRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateStreamRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateStreamRequest.verify|verify} messages. + * @param message UpdateStreamRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IUpdateStreamRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateStreamRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateStreamRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.UpdateStreamRequest; + + /** + * Decodes an UpdateStreamRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateStreamRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.UpdateStreamRequest; + + /** + * Verifies an UpdateStreamRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateStreamRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateStreamRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.UpdateStreamRequest; + + /** + * Creates a plain object from an UpdateStreamRequest message. Also converts values to other types if specified. + * @param message UpdateStreamRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.UpdateStreamRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateStreamRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateStreamRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteStreamRequest. */ + interface IDeleteStreamRequest { + + /** DeleteStreamRequest name */ + name?: (string|null); + + /** DeleteStreamRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteStreamRequest. */ + class DeleteStreamRequest implements IDeleteStreamRequest { + + /** + * Constructs a new DeleteStreamRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IDeleteStreamRequest); + + /** DeleteStreamRequest name. */ + public name: string; + + /** DeleteStreamRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteStreamRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteStreamRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IDeleteStreamRequest): google.cloud.visionai.v1alpha1.DeleteStreamRequest; + + /** + * Encodes the specified DeleteStreamRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteStreamRequest.verify|verify} messages. + * @param message DeleteStreamRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IDeleteStreamRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteStreamRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteStreamRequest.verify|verify} messages. + * @param message DeleteStreamRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IDeleteStreamRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteStreamRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteStreamRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.DeleteStreamRequest; + + /** + * Decodes a DeleteStreamRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteStreamRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.DeleteStreamRequest; + + /** + * Verifies a DeleteStreamRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteStreamRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteStreamRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.DeleteStreamRequest; + + /** + * Creates a plain object from a DeleteStreamRequest message. Also converts values to other types if specified. + * @param message DeleteStreamRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.DeleteStreamRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteStreamRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteStreamRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetStreamThumbnailResponse. */ + interface IGetStreamThumbnailResponse { + } + + /** Represents a GetStreamThumbnailResponse. */ + class GetStreamThumbnailResponse implements IGetStreamThumbnailResponse { + + /** + * Constructs a new GetStreamThumbnailResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IGetStreamThumbnailResponse); + + /** + * Creates a new GetStreamThumbnailResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GetStreamThumbnailResponse instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IGetStreamThumbnailResponse): google.cloud.visionai.v1alpha1.GetStreamThumbnailResponse; + + /** + * Encodes the specified GetStreamThumbnailResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetStreamThumbnailResponse.verify|verify} messages. + * @param message GetStreamThumbnailResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IGetStreamThumbnailResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetStreamThumbnailResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetStreamThumbnailResponse.verify|verify} messages. + * @param message GetStreamThumbnailResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IGetStreamThumbnailResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetStreamThumbnailResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetStreamThumbnailResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.GetStreamThumbnailResponse; + + /** + * Decodes a GetStreamThumbnailResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetStreamThumbnailResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.GetStreamThumbnailResponse; + + /** + * Verifies a GetStreamThumbnailResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetStreamThumbnailResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetStreamThumbnailResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.GetStreamThumbnailResponse; + + /** + * Creates a plain object from a GetStreamThumbnailResponse message. Also converts values to other types if specified. + * @param message GetStreamThumbnailResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.GetStreamThumbnailResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetStreamThumbnailResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetStreamThumbnailResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GenerateStreamHlsTokenRequest. */ + interface IGenerateStreamHlsTokenRequest { + + /** GenerateStreamHlsTokenRequest stream */ + stream?: (string|null); + } + + /** Represents a GenerateStreamHlsTokenRequest. */ + class GenerateStreamHlsTokenRequest implements IGenerateStreamHlsTokenRequest { + + /** + * Constructs a new GenerateStreamHlsTokenRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IGenerateStreamHlsTokenRequest); + + /** GenerateStreamHlsTokenRequest stream. */ + public stream: string; + + /** + * Creates a new GenerateStreamHlsTokenRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateStreamHlsTokenRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IGenerateStreamHlsTokenRequest): google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenRequest; + + /** + * Encodes the specified GenerateStreamHlsTokenRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenRequest.verify|verify} messages. + * @param message GenerateStreamHlsTokenRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IGenerateStreamHlsTokenRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateStreamHlsTokenRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenRequest.verify|verify} messages. + * @param message GenerateStreamHlsTokenRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IGenerateStreamHlsTokenRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateStreamHlsTokenRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateStreamHlsTokenRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenRequest; + + /** + * Decodes a GenerateStreamHlsTokenRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateStreamHlsTokenRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenRequest; + + /** + * Verifies a GenerateStreamHlsTokenRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateStreamHlsTokenRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateStreamHlsTokenRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenRequest; + + /** + * Creates a plain object from a GenerateStreamHlsTokenRequest message. Also converts values to other types if specified. + * @param message GenerateStreamHlsTokenRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateStreamHlsTokenRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateStreamHlsTokenRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GenerateStreamHlsTokenResponse. */ + interface IGenerateStreamHlsTokenResponse { + + /** GenerateStreamHlsTokenResponse token */ + token?: (string|null); + + /** GenerateStreamHlsTokenResponse expirationTime */ + expirationTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a GenerateStreamHlsTokenResponse. */ + class GenerateStreamHlsTokenResponse implements IGenerateStreamHlsTokenResponse { + + /** + * Constructs a new GenerateStreamHlsTokenResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IGenerateStreamHlsTokenResponse); + + /** GenerateStreamHlsTokenResponse token. */ + public token: string; + + /** GenerateStreamHlsTokenResponse expirationTime. */ + public expirationTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new GenerateStreamHlsTokenResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateStreamHlsTokenResponse instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IGenerateStreamHlsTokenResponse): google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenResponse; + + /** + * Encodes the specified GenerateStreamHlsTokenResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenResponse.verify|verify} messages. + * @param message GenerateStreamHlsTokenResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IGenerateStreamHlsTokenResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateStreamHlsTokenResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenResponse.verify|verify} messages. + * @param message GenerateStreamHlsTokenResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IGenerateStreamHlsTokenResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateStreamHlsTokenResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateStreamHlsTokenResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenResponse; + + /** + * Decodes a GenerateStreamHlsTokenResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateStreamHlsTokenResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenResponse; + + /** + * Verifies a GenerateStreamHlsTokenResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateStreamHlsTokenResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateStreamHlsTokenResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenResponse; + + /** + * Creates a plain object from a GenerateStreamHlsTokenResponse message. Also converts values to other types if specified. + * @param message GenerateStreamHlsTokenResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateStreamHlsTokenResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateStreamHlsTokenResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListEventsRequest. */ + interface IListEventsRequest { + + /** ListEventsRequest parent */ + parent?: (string|null); + + /** ListEventsRequest pageSize */ + pageSize?: (number|null); + + /** ListEventsRequest pageToken */ + pageToken?: (string|null); + + /** ListEventsRequest filter */ + filter?: (string|null); + + /** ListEventsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListEventsRequest. */ + class ListEventsRequest implements IListEventsRequest { + + /** + * Constructs a new ListEventsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IListEventsRequest); + + /** ListEventsRequest parent. */ + public parent: string; + + /** ListEventsRequest pageSize. */ + public pageSize: number; + + /** ListEventsRequest pageToken. */ + public pageToken: string; + + /** ListEventsRequest filter. */ + public filter: string; + + /** ListEventsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListEventsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEventsRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IListEventsRequest): google.cloud.visionai.v1alpha1.ListEventsRequest; + + /** + * Encodes the specified ListEventsRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListEventsRequest.verify|verify} messages. + * @param message ListEventsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IListEventsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEventsRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListEventsRequest.verify|verify} messages. + * @param message ListEventsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IListEventsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEventsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEventsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ListEventsRequest; + + /** + * Decodes a ListEventsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEventsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ListEventsRequest; + + /** + * Verifies a ListEventsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListEventsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEventsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ListEventsRequest; + + /** + * Creates a plain object from a ListEventsRequest message. Also converts values to other types if specified. + * @param message ListEventsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ListEventsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEventsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListEventsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListEventsResponse. */ + interface IListEventsResponse { + + /** ListEventsResponse events */ + events?: (google.cloud.visionai.v1alpha1.IEvent[]|null); + + /** ListEventsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListEventsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListEventsResponse. */ + class ListEventsResponse implements IListEventsResponse { + + /** + * Constructs a new ListEventsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IListEventsResponse); + + /** ListEventsResponse events. */ + public events: google.cloud.visionai.v1alpha1.IEvent[]; + + /** ListEventsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListEventsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListEventsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEventsResponse instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IListEventsResponse): google.cloud.visionai.v1alpha1.ListEventsResponse; + + /** + * Encodes the specified ListEventsResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListEventsResponse.verify|verify} messages. + * @param message ListEventsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IListEventsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEventsResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListEventsResponse.verify|verify} messages. + * @param message ListEventsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IListEventsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEventsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEventsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ListEventsResponse; + + /** + * Decodes a ListEventsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEventsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ListEventsResponse; + + /** + * Verifies a ListEventsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListEventsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEventsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ListEventsResponse; + + /** + * Creates a plain object from a ListEventsResponse message. Also converts values to other types if specified. + * @param message ListEventsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ListEventsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEventsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListEventsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetEventRequest. */ + interface IGetEventRequest { + + /** GetEventRequest name */ + name?: (string|null); + } + + /** Represents a GetEventRequest. */ + class GetEventRequest implements IGetEventRequest { + + /** + * Constructs a new GetEventRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IGetEventRequest); + + /** GetEventRequest name. */ + public name: string; + + /** + * Creates a new GetEventRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetEventRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IGetEventRequest): google.cloud.visionai.v1alpha1.GetEventRequest; + + /** + * Encodes the specified GetEventRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetEventRequest.verify|verify} messages. + * @param message GetEventRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IGetEventRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetEventRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetEventRequest.verify|verify} messages. + * @param message GetEventRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IGetEventRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetEventRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.GetEventRequest; + + /** + * Decodes a GetEventRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.GetEventRequest; + + /** + * Verifies a GetEventRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetEventRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetEventRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.GetEventRequest; + + /** + * Creates a plain object from a GetEventRequest message. Also converts values to other types if specified. + * @param message GetEventRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.GetEventRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetEventRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetEventRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateEventRequest. */ + interface ICreateEventRequest { + + /** CreateEventRequest parent */ + parent?: (string|null); + + /** CreateEventRequest eventId */ + eventId?: (string|null); + + /** CreateEventRequest event */ + event?: (google.cloud.visionai.v1alpha1.IEvent|null); + + /** CreateEventRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateEventRequest. */ + class CreateEventRequest implements ICreateEventRequest { + + /** + * Constructs a new CreateEventRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.ICreateEventRequest); + + /** CreateEventRequest parent. */ + public parent: string; + + /** CreateEventRequest eventId. */ + public eventId: string; + + /** CreateEventRequest event. */ + public event?: (google.cloud.visionai.v1alpha1.IEvent|null); + + /** CreateEventRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateEventRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateEventRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.ICreateEventRequest): google.cloud.visionai.v1alpha1.CreateEventRequest; + + /** + * Encodes the specified CreateEventRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateEventRequest.verify|verify} messages. + * @param message CreateEventRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.ICreateEventRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateEventRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateEventRequest.verify|verify} messages. + * @param message CreateEventRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.ICreateEventRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateEventRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.CreateEventRequest; + + /** + * Decodes a CreateEventRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.CreateEventRequest; + + /** + * Verifies a CreateEventRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateEventRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateEventRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.CreateEventRequest; + + /** + * Creates a plain object from a CreateEventRequest message. Also converts values to other types if specified. + * @param message CreateEventRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.CreateEventRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateEventRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateEventRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateEventRequest. */ + interface IUpdateEventRequest { + + /** UpdateEventRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateEventRequest event */ + event?: (google.cloud.visionai.v1alpha1.IEvent|null); + + /** UpdateEventRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateEventRequest. */ + class UpdateEventRequest implements IUpdateEventRequest { + + /** + * Constructs a new UpdateEventRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IUpdateEventRequest); + + /** UpdateEventRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateEventRequest event. */ + public event?: (google.cloud.visionai.v1alpha1.IEvent|null); + + /** UpdateEventRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpdateEventRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateEventRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IUpdateEventRequest): google.cloud.visionai.v1alpha1.UpdateEventRequest; + + /** + * Encodes the specified UpdateEventRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateEventRequest.verify|verify} messages. + * @param message UpdateEventRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IUpdateEventRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateEventRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateEventRequest.verify|verify} messages. + * @param message UpdateEventRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IUpdateEventRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateEventRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.UpdateEventRequest; + + /** + * Decodes an UpdateEventRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.UpdateEventRequest; + + /** + * Verifies an UpdateEventRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateEventRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateEventRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.UpdateEventRequest; + + /** + * Creates a plain object from an UpdateEventRequest message. Also converts values to other types if specified. + * @param message UpdateEventRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.UpdateEventRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateEventRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateEventRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteEventRequest. */ + interface IDeleteEventRequest { + + /** DeleteEventRequest name */ + name?: (string|null); + + /** DeleteEventRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteEventRequest. */ + class DeleteEventRequest implements IDeleteEventRequest { + + /** + * Constructs a new DeleteEventRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IDeleteEventRequest); + + /** DeleteEventRequest name. */ + public name: string; + + /** DeleteEventRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteEventRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteEventRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IDeleteEventRequest): google.cloud.visionai.v1alpha1.DeleteEventRequest; + + /** + * Encodes the specified DeleteEventRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteEventRequest.verify|verify} messages. + * @param message DeleteEventRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IDeleteEventRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteEventRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteEventRequest.verify|verify} messages. + * @param message DeleteEventRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IDeleteEventRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteEventRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.DeleteEventRequest; + + /** + * Decodes a DeleteEventRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.DeleteEventRequest; + + /** + * Verifies a DeleteEventRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteEventRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteEventRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.DeleteEventRequest; + + /** + * Creates a plain object from a DeleteEventRequest message. Also converts values to other types if specified. + * @param message DeleteEventRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.DeleteEventRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteEventRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteEventRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSeriesRequest. */ + interface IListSeriesRequest { + + /** ListSeriesRequest parent */ + parent?: (string|null); + + /** ListSeriesRequest pageSize */ + pageSize?: (number|null); + + /** ListSeriesRequest pageToken */ + pageToken?: (string|null); + + /** ListSeriesRequest filter */ + filter?: (string|null); + + /** ListSeriesRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListSeriesRequest. */ + class ListSeriesRequest implements IListSeriesRequest { + + /** + * Constructs a new ListSeriesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IListSeriesRequest); + + /** ListSeriesRequest parent. */ + public parent: string; + + /** ListSeriesRequest pageSize. */ + public pageSize: number; + + /** ListSeriesRequest pageToken. */ + public pageToken: string; + + /** ListSeriesRequest filter. */ + public filter: string; + + /** ListSeriesRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListSeriesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSeriesRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IListSeriesRequest): google.cloud.visionai.v1alpha1.ListSeriesRequest; + + /** + * Encodes the specified ListSeriesRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListSeriesRequest.verify|verify} messages. + * @param message ListSeriesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IListSeriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSeriesRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListSeriesRequest.verify|verify} messages. + * @param message ListSeriesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IListSeriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSeriesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSeriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ListSeriesRequest; + + /** + * Decodes a ListSeriesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSeriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ListSeriesRequest; + + /** + * Verifies a ListSeriesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSeriesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSeriesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ListSeriesRequest; + + /** + * Creates a plain object from a ListSeriesRequest message. Also converts values to other types if specified. + * @param message ListSeriesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ListSeriesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSeriesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSeriesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSeriesResponse. */ + interface IListSeriesResponse { + + /** ListSeriesResponse series */ + series?: (google.cloud.visionai.v1alpha1.ISeries[]|null); + + /** ListSeriesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListSeriesResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListSeriesResponse. */ + class ListSeriesResponse implements IListSeriesResponse { + + /** + * Constructs a new ListSeriesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IListSeriesResponse); + + /** ListSeriesResponse series. */ + public series: google.cloud.visionai.v1alpha1.ISeries[]; + + /** ListSeriesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListSeriesResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListSeriesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSeriesResponse instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IListSeriesResponse): google.cloud.visionai.v1alpha1.ListSeriesResponse; + + /** + * Encodes the specified ListSeriesResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListSeriesResponse.verify|verify} messages. + * @param message ListSeriesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IListSeriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSeriesResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListSeriesResponse.verify|verify} messages. + * @param message ListSeriesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IListSeriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSeriesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSeriesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ListSeriesResponse; + + /** + * Decodes a ListSeriesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSeriesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ListSeriesResponse; + + /** + * Verifies a ListSeriesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSeriesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSeriesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ListSeriesResponse; + + /** + * Creates a plain object from a ListSeriesResponse message. Also converts values to other types if specified. + * @param message ListSeriesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ListSeriesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSeriesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSeriesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetSeriesRequest. */ + interface IGetSeriesRequest { + + /** GetSeriesRequest name */ + name?: (string|null); + } + + /** Represents a GetSeriesRequest. */ + class GetSeriesRequest implements IGetSeriesRequest { + + /** + * Constructs a new GetSeriesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IGetSeriesRequest); + + /** GetSeriesRequest name. */ + public name: string; + + /** + * Creates a new GetSeriesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSeriesRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IGetSeriesRequest): google.cloud.visionai.v1alpha1.GetSeriesRequest; + + /** + * Encodes the specified GetSeriesRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetSeriesRequest.verify|verify} messages. + * @param message GetSeriesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IGetSeriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSeriesRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetSeriesRequest.verify|verify} messages. + * @param message GetSeriesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IGetSeriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSeriesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSeriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.GetSeriesRequest; + + /** + * Decodes a GetSeriesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSeriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.GetSeriesRequest; + + /** + * Verifies a GetSeriesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetSeriesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSeriesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.GetSeriesRequest; + + /** + * Creates a plain object from a GetSeriesRequest message. Also converts values to other types if specified. + * @param message GetSeriesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.GetSeriesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSeriesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetSeriesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateSeriesRequest. */ + interface ICreateSeriesRequest { + + /** CreateSeriesRequest parent */ + parent?: (string|null); + + /** CreateSeriesRequest seriesId */ + seriesId?: (string|null); + + /** CreateSeriesRequest series */ + series?: (google.cloud.visionai.v1alpha1.ISeries|null); + + /** CreateSeriesRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateSeriesRequest. */ + class CreateSeriesRequest implements ICreateSeriesRequest { + + /** + * Constructs a new CreateSeriesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.ICreateSeriesRequest); + + /** CreateSeriesRequest parent. */ + public parent: string; + + /** CreateSeriesRequest seriesId. */ + public seriesId: string; + + /** CreateSeriesRequest series. */ + public series?: (google.cloud.visionai.v1alpha1.ISeries|null); + + /** CreateSeriesRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateSeriesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateSeriesRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.ICreateSeriesRequest): google.cloud.visionai.v1alpha1.CreateSeriesRequest; + + /** + * Encodes the specified CreateSeriesRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateSeriesRequest.verify|verify} messages. + * @param message CreateSeriesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.ICreateSeriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateSeriesRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateSeriesRequest.verify|verify} messages. + * @param message CreateSeriesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.ICreateSeriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateSeriesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateSeriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.CreateSeriesRequest; + + /** + * Decodes a CreateSeriesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateSeriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.CreateSeriesRequest; + + /** + * Verifies a CreateSeriesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateSeriesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateSeriesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.CreateSeriesRequest; + + /** + * Creates a plain object from a CreateSeriesRequest message. Also converts values to other types if specified. + * @param message CreateSeriesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.CreateSeriesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateSeriesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateSeriesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateSeriesRequest. */ + interface IUpdateSeriesRequest { + + /** UpdateSeriesRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateSeriesRequest series */ + series?: (google.cloud.visionai.v1alpha1.ISeries|null); + + /** UpdateSeriesRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateSeriesRequest. */ + class UpdateSeriesRequest implements IUpdateSeriesRequest { + + /** + * Constructs a new UpdateSeriesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IUpdateSeriesRequest); + + /** UpdateSeriesRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateSeriesRequest series. */ + public series?: (google.cloud.visionai.v1alpha1.ISeries|null); + + /** UpdateSeriesRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpdateSeriesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateSeriesRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IUpdateSeriesRequest): google.cloud.visionai.v1alpha1.UpdateSeriesRequest; + + /** + * Encodes the specified UpdateSeriesRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateSeriesRequest.verify|verify} messages. + * @param message UpdateSeriesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IUpdateSeriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateSeriesRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateSeriesRequest.verify|verify} messages. + * @param message UpdateSeriesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IUpdateSeriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateSeriesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateSeriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.UpdateSeriesRequest; + + /** + * Decodes an UpdateSeriesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateSeriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.UpdateSeriesRequest; + + /** + * Verifies an UpdateSeriesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateSeriesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateSeriesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.UpdateSeriesRequest; + + /** + * Creates a plain object from an UpdateSeriesRequest message. Also converts values to other types if specified. + * @param message UpdateSeriesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.UpdateSeriesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateSeriesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateSeriesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteSeriesRequest. */ + interface IDeleteSeriesRequest { + + /** DeleteSeriesRequest name */ + name?: (string|null); + + /** DeleteSeriesRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteSeriesRequest. */ + class DeleteSeriesRequest implements IDeleteSeriesRequest { + + /** + * Constructs a new DeleteSeriesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IDeleteSeriesRequest); + + /** DeleteSeriesRequest name. */ + public name: string; + + /** DeleteSeriesRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteSeriesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteSeriesRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IDeleteSeriesRequest): google.cloud.visionai.v1alpha1.DeleteSeriesRequest; + + /** + * Encodes the specified DeleteSeriesRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteSeriesRequest.verify|verify} messages. + * @param message DeleteSeriesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IDeleteSeriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteSeriesRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteSeriesRequest.verify|verify} messages. + * @param message DeleteSeriesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IDeleteSeriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteSeriesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteSeriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.DeleteSeriesRequest; + + /** + * Decodes a DeleteSeriesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteSeriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.DeleteSeriesRequest; + + /** + * Verifies a DeleteSeriesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteSeriesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteSeriesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.DeleteSeriesRequest; + + /** + * Creates a plain object from a DeleteSeriesRequest message. Also converts values to other types if specified. + * @param message DeleteSeriesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.DeleteSeriesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteSeriesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteSeriesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MaterializeChannelRequest. */ + interface IMaterializeChannelRequest { + + /** MaterializeChannelRequest parent */ + parent?: (string|null); + + /** MaterializeChannelRequest channelId */ + channelId?: (string|null); + + /** MaterializeChannelRequest channel */ + channel?: (google.cloud.visionai.v1alpha1.IChannel|null); + + /** MaterializeChannelRequest requestId */ + requestId?: (string|null); + } + + /** Represents a MaterializeChannelRequest. */ + class MaterializeChannelRequest implements IMaterializeChannelRequest { + + /** + * Constructs a new MaterializeChannelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IMaterializeChannelRequest); + + /** MaterializeChannelRequest parent. */ + public parent: string; + + /** MaterializeChannelRequest channelId. */ + public channelId: string; + + /** MaterializeChannelRequest channel. */ + public channel?: (google.cloud.visionai.v1alpha1.IChannel|null); + + /** MaterializeChannelRequest requestId. */ + public requestId: string; + + /** + * Creates a new MaterializeChannelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns MaterializeChannelRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IMaterializeChannelRequest): google.cloud.visionai.v1alpha1.MaterializeChannelRequest; + + /** + * Encodes the specified MaterializeChannelRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.MaterializeChannelRequest.verify|verify} messages. + * @param message MaterializeChannelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IMaterializeChannelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MaterializeChannelRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.MaterializeChannelRequest.verify|verify} messages. + * @param message MaterializeChannelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IMaterializeChannelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MaterializeChannelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MaterializeChannelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.MaterializeChannelRequest; + + /** + * Decodes a MaterializeChannelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MaterializeChannelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.MaterializeChannelRequest; + + /** + * Verifies a MaterializeChannelRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MaterializeChannelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MaterializeChannelRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.MaterializeChannelRequest; + + /** + * Creates a plain object from a MaterializeChannelRequest message. Also converts values to other types if specified. + * @param message MaterializeChannelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.MaterializeChannelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MaterializeChannelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MaterializeChannelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a Warehouse */ + class Warehouse extends $protobuf.rpc.Service { + + /** + * Constructs a new Warehouse service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Warehouse service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Warehouse; + + /** + * Calls CreateAsset. + * @param request CreateAssetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Asset + */ + public createAsset(request: google.cloud.visionai.v1alpha1.ICreateAssetRequest, callback: google.cloud.visionai.v1alpha1.Warehouse.CreateAssetCallback): void; + + /** + * Calls CreateAsset. + * @param request CreateAssetRequest message or plain object + * @returns Promise + */ + public createAsset(request: google.cloud.visionai.v1alpha1.ICreateAssetRequest): Promise; + + /** + * Calls UpdateAsset. + * @param request UpdateAssetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Asset + */ + public updateAsset(request: google.cloud.visionai.v1alpha1.IUpdateAssetRequest, callback: google.cloud.visionai.v1alpha1.Warehouse.UpdateAssetCallback): void; + + /** + * Calls UpdateAsset. + * @param request UpdateAssetRequest message or plain object + * @returns Promise + */ + public updateAsset(request: google.cloud.visionai.v1alpha1.IUpdateAssetRequest): Promise; + + /** + * Calls GetAsset. + * @param request GetAssetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Asset + */ + public getAsset(request: google.cloud.visionai.v1alpha1.IGetAssetRequest, callback: google.cloud.visionai.v1alpha1.Warehouse.GetAssetCallback): void; + + /** + * Calls GetAsset. + * @param request GetAssetRequest message or plain object + * @returns Promise + */ + public getAsset(request: google.cloud.visionai.v1alpha1.IGetAssetRequest): Promise; + + /** + * Calls ListAssets. + * @param request ListAssetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAssetsResponse + */ + public listAssets(request: google.cloud.visionai.v1alpha1.IListAssetsRequest, callback: google.cloud.visionai.v1alpha1.Warehouse.ListAssetsCallback): void; + + /** + * Calls ListAssets. + * @param request ListAssetsRequest message or plain object + * @returns Promise + */ + public listAssets(request: google.cloud.visionai.v1alpha1.IListAssetsRequest): Promise; + + /** + * Calls DeleteAsset. + * @param request DeleteAssetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteAsset(request: google.cloud.visionai.v1alpha1.IDeleteAssetRequest, callback: google.cloud.visionai.v1alpha1.Warehouse.DeleteAssetCallback): void; + + /** + * Calls DeleteAsset. + * @param request DeleteAssetRequest message or plain object + * @returns Promise + */ + public deleteAsset(request: google.cloud.visionai.v1alpha1.IDeleteAssetRequest): Promise; + + /** + * Calls CreateCorpus. + * @param request CreateCorpusRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createCorpus(request: google.cloud.visionai.v1alpha1.ICreateCorpusRequest, callback: google.cloud.visionai.v1alpha1.Warehouse.CreateCorpusCallback): void; + + /** + * Calls CreateCorpus. + * @param request CreateCorpusRequest message or plain object + * @returns Promise + */ + public createCorpus(request: google.cloud.visionai.v1alpha1.ICreateCorpusRequest): Promise; + + /** + * Calls GetCorpus. + * @param request GetCorpusRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Corpus + */ + public getCorpus(request: google.cloud.visionai.v1alpha1.IGetCorpusRequest, callback: google.cloud.visionai.v1alpha1.Warehouse.GetCorpusCallback): void; + + /** + * Calls GetCorpus. + * @param request GetCorpusRequest message or plain object + * @returns Promise + */ + public getCorpus(request: google.cloud.visionai.v1alpha1.IGetCorpusRequest): Promise; + + /** + * Calls UpdateCorpus. + * @param request UpdateCorpusRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Corpus + */ + public updateCorpus(request: google.cloud.visionai.v1alpha1.IUpdateCorpusRequest, callback: google.cloud.visionai.v1alpha1.Warehouse.UpdateCorpusCallback): void; + + /** + * Calls UpdateCorpus. + * @param request UpdateCorpusRequest message or plain object + * @returns Promise + */ + public updateCorpus(request: google.cloud.visionai.v1alpha1.IUpdateCorpusRequest): Promise; + + /** + * Calls ListCorpora. + * @param request ListCorporaRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListCorporaResponse + */ + public listCorpora(request: google.cloud.visionai.v1alpha1.IListCorporaRequest, callback: google.cloud.visionai.v1alpha1.Warehouse.ListCorporaCallback): void; + + /** + * Calls ListCorpora. + * @param request ListCorporaRequest message or plain object + * @returns Promise + */ + public listCorpora(request: google.cloud.visionai.v1alpha1.IListCorporaRequest): Promise; + + /** + * Calls DeleteCorpus. + * @param request DeleteCorpusRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteCorpus(request: google.cloud.visionai.v1alpha1.IDeleteCorpusRequest, callback: google.cloud.visionai.v1alpha1.Warehouse.DeleteCorpusCallback): void; + + /** + * Calls DeleteCorpus. + * @param request DeleteCorpusRequest message or plain object + * @returns Promise + */ + public deleteCorpus(request: google.cloud.visionai.v1alpha1.IDeleteCorpusRequest): Promise; + + /** + * Calls CreateDataSchema. + * @param request CreateDataSchemaRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DataSchema + */ + public createDataSchema(request: google.cloud.visionai.v1alpha1.ICreateDataSchemaRequest, callback: google.cloud.visionai.v1alpha1.Warehouse.CreateDataSchemaCallback): void; + + /** + * Calls CreateDataSchema. + * @param request CreateDataSchemaRequest message or plain object + * @returns Promise + */ + public createDataSchema(request: google.cloud.visionai.v1alpha1.ICreateDataSchemaRequest): Promise; + + /** + * Calls UpdateDataSchema. + * @param request UpdateDataSchemaRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DataSchema + */ + public updateDataSchema(request: google.cloud.visionai.v1alpha1.IUpdateDataSchemaRequest, callback: google.cloud.visionai.v1alpha1.Warehouse.UpdateDataSchemaCallback): void; + + /** + * Calls UpdateDataSchema. + * @param request UpdateDataSchemaRequest message or plain object + * @returns Promise + */ + public updateDataSchema(request: google.cloud.visionai.v1alpha1.IUpdateDataSchemaRequest): Promise; + + /** + * Calls GetDataSchema. + * @param request GetDataSchemaRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DataSchema + */ + public getDataSchema(request: google.cloud.visionai.v1alpha1.IGetDataSchemaRequest, callback: google.cloud.visionai.v1alpha1.Warehouse.GetDataSchemaCallback): void; + + /** + * Calls GetDataSchema. + * @param request GetDataSchemaRequest message or plain object + * @returns Promise + */ + public getDataSchema(request: google.cloud.visionai.v1alpha1.IGetDataSchemaRequest): Promise; + + /** + * Calls DeleteDataSchema. + * @param request DeleteDataSchemaRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteDataSchema(request: google.cloud.visionai.v1alpha1.IDeleteDataSchemaRequest, callback: google.cloud.visionai.v1alpha1.Warehouse.DeleteDataSchemaCallback): void; + + /** + * Calls DeleteDataSchema. + * @param request DeleteDataSchemaRequest message or plain object + * @returns Promise + */ + public deleteDataSchema(request: google.cloud.visionai.v1alpha1.IDeleteDataSchemaRequest): Promise; + + /** + * Calls ListDataSchemas. + * @param request ListDataSchemasRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListDataSchemasResponse + */ + public listDataSchemas(request: google.cloud.visionai.v1alpha1.IListDataSchemasRequest, callback: google.cloud.visionai.v1alpha1.Warehouse.ListDataSchemasCallback): void; + + /** + * Calls ListDataSchemas. + * @param request ListDataSchemasRequest message or plain object + * @returns Promise + */ + public listDataSchemas(request: google.cloud.visionai.v1alpha1.IListDataSchemasRequest): Promise; + + /** + * Calls CreateAnnotation. + * @param request CreateAnnotationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Annotation + */ + public createAnnotation(request: google.cloud.visionai.v1alpha1.ICreateAnnotationRequest, callback: google.cloud.visionai.v1alpha1.Warehouse.CreateAnnotationCallback): void; + + /** + * Calls CreateAnnotation. + * @param request CreateAnnotationRequest message or plain object + * @returns Promise + */ + public createAnnotation(request: google.cloud.visionai.v1alpha1.ICreateAnnotationRequest): Promise; + + /** + * Calls GetAnnotation. + * @param request GetAnnotationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Annotation + */ + public getAnnotation(request: google.cloud.visionai.v1alpha1.IGetAnnotationRequest, callback: google.cloud.visionai.v1alpha1.Warehouse.GetAnnotationCallback): void; + + /** + * Calls GetAnnotation. + * @param request GetAnnotationRequest message or plain object + * @returns Promise + */ + public getAnnotation(request: google.cloud.visionai.v1alpha1.IGetAnnotationRequest): Promise; + + /** + * Calls ListAnnotations. + * @param request ListAnnotationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAnnotationsResponse + */ + public listAnnotations(request: google.cloud.visionai.v1alpha1.IListAnnotationsRequest, callback: google.cloud.visionai.v1alpha1.Warehouse.ListAnnotationsCallback): void; + + /** + * Calls ListAnnotations. + * @param request ListAnnotationsRequest message or plain object + * @returns Promise + */ + public listAnnotations(request: google.cloud.visionai.v1alpha1.IListAnnotationsRequest): Promise; + + /** + * Calls UpdateAnnotation. + * @param request UpdateAnnotationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Annotation + */ + public updateAnnotation(request: google.cloud.visionai.v1alpha1.IUpdateAnnotationRequest, callback: google.cloud.visionai.v1alpha1.Warehouse.UpdateAnnotationCallback): void; + + /** + * Calls UpdateAnnotation. + * @param request UpdateAnnotationRequest message or plain object + * @returns Promise + */ + public updateAnnotation(request: google.cloud.visionai.v1alpha1.IUpdateAnnotationRequest): Promise; + + /** + * Calls DeleteAnnotation. + * @param request DeleteAnnotationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteAnnotation(request: google.cloud.visionai.v1alpha1.IDeleteAnnotationRequest, callback: google.cloud.visionai.v1alpha1.Warehouse.DeleteAnnotationCallback): void; + + /** + * Calls DeleteAnnotation. + * @param request DeleteAnnotationRequest message or plain object + * @returns Promise + */ + public deleteAnnotation(request: google.cloud.visionai.v1alpha1.IDeleteAnnotationRequest): Promise; + + /** + * Calls IngestAsset. + * @param request IngestAssetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and IngestAssetResponse + */ + public ingestAsset(request: google.cloud.visionai.v1alpha1.IIngestAssetRequest, callback: google.cloud.visionai.v1alpha1.Warehouse.IngestAssetCallback): void; + + /** + * Calls IngestAsset. + * @param request IngestAssetRequest message or plain object + * @returns Promise + */ + public ingestAsset(request: google.cloud.visionai.v1alpha1.IIngestAssetRequest): Promise; + + /** + * Calls ClipAsset. + * @param request ClipAssetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ClipAssetResponse + */ + public clipAsset(request: google.cloud.visionai.v1alpha1.IClipAssetRequest, callback: google.cloud.visionai.v1alpha1.Warehouse.ClipAssetCallback): void; + + /** + * Calls ClipAsset. + * @param request ClipAssetRequest message or plain object + * @returns Promise + */ + public clipAsset(request: google.cloud.visionai.v1alpha1.IClipAssetRequest): Promise; + + /** + * Calls GenerateHlsUri. + * @param request GenerateHlsUriRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GenerateHlsUriResponse + */ + public generateHlsUri(request: google.cloud.visionai.v1alpha1.IGenerateHlsUriRequest, callback: google.cloud.visionai.v1alpha1.Warehouse.GenerateHlsUriCallback): void; + + /** + * Calls GenerateHlsUri. + * @param request GenerateHlsUriRequest message or plain object + * @returns Promise + */ + public generateHlsUri(request: google.cloud.visionai.v1alpha1.IGenerateHlsUriRequest): Promise; + + /** + * Calls CreateSearchConfig. + * @param request CreateSearchConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SearchConfig + */ + public createSearchConfig(request: google.cloud.visionai.v1alpha1.ICreateSearchConfigRequest, callback: google.cloud.visionai.v1alpha1.Warehouse.CreateSearchConfigCallback): void; + + /** + * Calls CreateSearchConfig. + * @param request CreateSearchConfigRequest message or plain object + * @returns Promise + */ + public createSearchConfig(request: google.cloud.visionai.v1alpha1.ICreateSearchConfigRequest): Promise; + + /** + * Calls UpdateSearchConfig. + * @param request UpdateSearchConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SearchConfig + */ + public updateSearchConfig(request: google.cloud.visionai.v1alpha1.IUpdateSearchConfigRequest, callback: google.cloud.visionai.v1alpha1.Warehouse.UpdateSearchConfigCallback): void; + + /** + * Calls UpdateSearchConfig. + * @param request UpdateSearchConfigRequest message or plain object + * @returns Promise + */ + public updateSearchConfig(request: google.cloud.visionai.v1alpha1.IUpdateSearchConfigRequest): Promise; + + /** + * Calls GetSearchConfig. + * @param request GetSearchConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SearchConfig + */ + public getSearchConfig(request: google.cloud.visionai.v1alpha1.IGetSearchConfigRequest, callback: google.cloud.visionai.v1alpha1.Warehouse.GetSearchConfigCallback): void; + + /** + * Calls GetSearchConfig. + * @param request GetSearchConfigRequest message or plain object + * @returns Promise + */ + public getSearchConfig(request: google.cloud.visionai.v1alpha1.IGetSearchConfigRequest): Promise; + + /** + * Calls DeleteSearchConfig. + * @param request DeleteSearchConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteSearchConfig(request: google.cloud.visionai.v1alpha1.IDeleteSearchConfigRequest, callback: google.cloud.visionai.v1alpha1.Warehouse.DeleteSearchConfigCallback): void; + + /** + * Calls DeleteSearchConfig. + * @param request DeleteSearchConfigRequest message or plain object + * @returns Promise + */ + public deleteSearchConfig(request: google.cloud.visionai.v1alpha1.IDeleteSearchConfigRequest): Promise; + + /** + * Calls ListSearchConfigs. + * @param request ListSearchConfigsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSearchConfigsResponse + */ + public listSearchConfigs(request: google.cloud.visionai.v1alpha1.IListSearchConfigsRequest, callback: google.cloud.visionai.v1alpha1.Warehouse.ListSearchConfigsCallback): void; + + /** + * Calls ListSearchConfigs. + * @param request ListSearchConfigsRequest message or plain object + * @returns Promise + */ + public listSearchConfigs(request: google.cloud.visionai.v1alpha1.IListSearchConfigsRequest): Promise; + + /** + * Calls SearchAssets. + * @param request SearchAssetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SearchAssetsResponse + */ + public searchAssets(request: google.cloud.visionai.v1alpha1.ISearchAssetsRequest, callback: google.cloud.visionai.v1alpha1.Warehouse.SearchAssetsCallback): void; + + /** + * Calls SearchAssets. + * @param request SearchAssetsRequest message or plain object + * @returns Promise + */ + public searchAssets(request: google.cloud.visionai.v1alpha1.ISearchAssetsRequest): Promise; + } + + namespace Warehouse { + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|createAsset}. + * @param error Error, if any + * @param [response] Asset + */ + type CreateAssetCallback = (error: (Error|null), response?: google.cloud.visionai.v1alpha1.Asset) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|updateAsset}. + * @param error Error, if any + * @param [response] Asset + */ + type UpdateAssetCallback = (error: (Error|null), response?: google.cloud.visionai.v1alpha1.Asset) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|getAsset}. + * @param error Error, if any + * @param [response] Asset + */ + type GetAssetCallback = (error: (Error|null), response?: google.cloud.visionai.v1alpha1.Asset) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|listAssets}. + * @param error Error, if any + * @param [response] ListAssetsResponse + */ + type ListAssetsCallback = (error: (Error|null), response?: google.cloud.visionai.v1alpha1.ListAssetsResponse) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|deleteAsset}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteAssetCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|createCorpus}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateCorpusCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|getCorpus}. + * @param error Error, if any + * @param [response] Corpus + */ + type GetCorpusCallback = (error: (Error|null), response?: google.cloud.visionai.v1alpha1.Corpus) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|updateCorpus}. + * @param error Error, if any + * @param [response] Corpus + */ + type UpdateCorpusCallback = (error: (Error|null), response?: google.cloud.visionai.v1alpha1.Corpus) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|listCorpora}. + * @param error Error, if any + * @param [response] ListCorporaResponse + */ + type ListCorporaCallback = (error: (Error|null), response?: google.cloud.visionai.v1alpha1.ListCorporaResponse) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|deleteCorpus}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteCorpusCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|createDataSchema}. + * @param error Error, if any + * @param [response] DataSchema + */ + type CreateDataSchemaCallback = (error: (Error|null), response?: google.cloud.visionai.v1alpha1.DataSchema) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|updateDataSchema}. + * @param error Error, if any + * @param [response] DataSchema + */ + type UpdateDataSchemaCallback = (error: (Error|null), response?: google.cloud.visionai.v1alpha1.DataSchema) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|getDataSchema}. + * @param error Error, if any + * @param [response] DataSchema + */ + type GetDataSchemaCallback = (error: (Error|null), response?: google.cloud.visionai.v1alpha1.DataSchema) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|deleteDataSchema}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteDataSchemaCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|listDataSchemas}. + * @param error Error, if any + * @param [response] ListDataSchemasResponse + */ + type ListDataSchemasCallback = (error: (Error|null), response?: google.cloud.visionai.v1alpha1.ListDataSchemasResponse) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|createAnnotation}. + * @param error Error, if any + * @param [response] Annotation + */ + type CreateAnnotationCallback = (error: (Error|null), response?: google.cloud.visionai.v1alpha1.Annotation) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|getAnnotation}. + * @param error Error, if any + * @param [response] Annotation + */ + type GetAnnotationCallback = (error: (Error|null), response?: google.cloud.visionai.v1alpha1.Annotation) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|listAnnotations}. + * @param error Error, if any + * @param [response] ListAnnotationsResponse + */ + type ListAnnotationsCallback = (error: (Error|null), response?: google.cloud.visionai.v1alpha1.ListAnnotationsResponse) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|updateAnnotation}. + * @param error Error, if any + * @param [response] Annotation + */ + type UpdateAnnotationCallback = (error: (Error|null), response?: google.cloud.visionai.v1alpha1.Annotation) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|deleteAnnotation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteAnnotationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|ingestAsset}. + * @param error Error, if any + * @param [response] IngestAssetResponse + */ + type IngestAssetCallback = (error: (Error|null), response?: google.cloud.visionai.v1alpha1.IngestAssetResponse) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|clipAsset}. + * @param error Error, if any + * @param [response] ClipAssetResponse + */ + type ClipAssetCallback = (error: (Error|null), response?: google.cloud.visionai.v1alpha1.ClipAssetResponse) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|generateHlsUri}. + * @param error Error, if any + * @param [response] GenerateHlsUriResponse + */ + type GenerateHlsUriCallback = (error: (Error|null), response?: google.cloud.visionai.v1alpha1.GenerateHlsUriResponse) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|createSearchConfig}. + * @param error Error, if any + * @param [response] SearchConfig + */ + type CreateSearchConfigCallback = (error: (Error|null), response?: google.cloud.visionai.v1alpha1.SearchConfig) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|updateSearchConfig}. + * @param error Error, if any + * @param [response] SearchConfig + */ + type UpdateSearchConfigCallback = (error: (Error|null), response?: google.cloud.visionai.v1alpha1.SearchConfig) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|getSearchConfig}. + * @param error Error, if any + * @param [response] SearchConfig + */ + type GetSearchConfigCallback = (error: (Error|null), response?: google.cloud.visionai.v1alpha1.SearchConfig) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|deleteSearchConfig}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteSearchConfigCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|listSearchConfigs}. + * @param error Error, if any + * @param [response] ListSearchConfigsResponse + */ + type ListSearchConfigsCallback = (error: (Error|null), response?: google.cloud.visionai.v1alpha1.ListSearchConfigsResponse) => void; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|searchAssets}. + * @param error Error, if any + * @param [response] SearchAssetsResponse + */ + type SearchAssetsCallback = (error: (Error|null), response?: google.cloud.visionai.v1alpha1.SearchAssetsResponse) => void; + } + + /** FacetBucketType enum. */ + enum FacetBucketType { + FACET_BUCKET_TYPE_UNSPECIFIED = 0, + FACET_BUCKET_TYPE_VALUE = 1, + FACET_BUCKET_TYPE_DATETIME = 2, + FACET_BUCKET_TYPE_FIXED_RANGE = 3, + FACET_BUCKET_TYPE_CUSTOM_RANGE = 4 + } + + /** Properties of a CreateAssetRequest. */ + interface ICreateAssetRequest { + + /** CreateAssetRequest parent */ + parent?: (string|null); + + /** CreateAssetRequest asset */ + asset?: (google.cloud.visionai.v1alpha1.IAsset|null); + + /** CreateAssetRequest assetId */ + assetId?: (string|null); + } + + /** Represents a CreateAssetRequest. */ + class CreateAssetRequest implements ICreateAssetRequest { + + /** + * Constructs a new CreateAssetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.ICreateAssetRequest); + + /** CreateAssetRequest parent. */ + public parent: string; + + /** CreateAssetRequest asset. */ + public asset?: (google.cloud.visionai.v1alpha1.IAsset|null); + + /** CreateAssetRequest assetId. */ + public assetId?: (string|null); + + /** + * Creates a new CreateAssetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateAssetRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.ICreateAssetRequest): google.cloud.visionai.v1alpha1.CreateAssetRequest; + + /** + * Encodes the specified CreateAssetRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateAssetRequest.verify|verify} messages. + * @param message CreateAssetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.ICreateAssetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateAssetRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateAssetRequest.verify|verify} messages. + * @param message CreateAssetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.ICreateAssetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateAssetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateAssetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.CreateAssetRequest; + + /** + * Decodes a CreateAssetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateAssetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.CreateAssetRequest; + + /** + * Verifies a CreateAssetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateAssetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateAssetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.CreateAssetRequest; + + /** + * Creates a plain object from a CreateAssetRequest message. Also converts values to other types if specified. + * @param message CreateAssetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.CreateAssetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateAssetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateAssetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetAssetRequest. */ + interface IGetAssetRequest { + + /** GetAssetRequest name */ + name?: (string|null); + } + + /** Represents a GetAssetRequest. */ + class GetAssetRequest implements IGetAssetRequest { + + /** + * Constructs a new GetAssetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IGetAssetRequest); + + /** GetAssetRequest name. */ + public name: string; + + /** + * Creates a new GetAssetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetAssetRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IGetAssetRequest): google.cloud.visionai.v1alpha1.GetAssetRequest; + + /** + * Encodes the specified GetAssetRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetAssetRequest.verify|verify} messages. + * @param message GetAssetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IGetAssetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetAssetRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetAssetRequest.verify|verify} messages. + * @param message GetAssetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IGetAssetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetAssetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetAssetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.GetAssetRequest; + + /** + * Decodes a GetAssetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetAssetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.GetAssetRequest; + + /** + * Verifies a GetAssetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetAssetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetAssetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.GetAssetRequest; + + /** + * Creates a plain object from a GetAssetRequest message. Also converts values to other types if specified. + * @param message GetAssetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.GetAssetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetAssetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetAssetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAssetsRequest. */ + interface IListAssetsRequest { + + /** ListAssetsRequest parent */ + parent?: (string|null); + + /** ListAssetsRequest pageSize */ + pageSize?: (number|null); + + /** ListAssetsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListAssetsRequest. */ + class ListAssetsRequest implements IListAssetsRequest { + + /** + * Constructs a new ListAssetsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IListAssetsRequest); + + /** ListAssetsRequest parent. */ + public parent: string; + + /** ListAssetsRequest pageSize. */ + public pageSize: number; + + /** ListAssetsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListAssetsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAssetsRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IListAssetsRequest): google.cloud.visionai.v1alpha1.ListAssetsRequest; + + /** + * Encodes the specified ListAssetsRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListAssetsRequest.verify|verify} messages. + * @param message ListAssetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IListAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListAssetsRequest.verify|verify} messages. + * @param message ListAssetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IListAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAssetsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ListAssetsRequest; + + /** + * Decodes a ListAssetsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ListAssetsRequest; + + /** + * Verifies a ListAssetsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAssetsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAssetsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ListAssetsRequest; + + /** + * Creates a plain object from a ListAssetsRequest message. Also converts values to other types if specified. + * @param message ListAssetsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ListAssetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAssetsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAssetsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAssetsResponse. */ + interface IListAssetsResponse { + + /** ListAssetsResponse assets */ + assets?: (google.cloud.visionai.v1alpha1.IAsset[]|null); + + /** ListAssetsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListAssetsResponse. */ + class ListAssetsResponse implements IListAssetsResponse { + + /** + * Constructs a new ListAssetsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IListAssetsResponse); + + /** ListAssetsResponse assets. */ + public assets: google.cloud.visionai.v1alpha1.IAsset[]; + + /** ListAssetsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListAssetsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAssetsResponse instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IListAssetsResponse): google.cloud.visionai.v1alpha1.ListAssetsResponse; + + /** + * Encodes the specified ListAssetsResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListAssetsResponse.verify|verify} messages. + * @param message ListAssetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IListAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListAssetsResponse.verify|verify} messages. + * @param message ListAssetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IListAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAssetsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ListAssetsResponse; + + /** + * Decodes a ListAssetsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ListAssetsResponse; + + /** + * Verifies a ListAssetsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAssetsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ListAssetsResponse; + + /** + * Creates a plain object from a ListAssetsResponse message. Also converts values to other types if specified. + * @param message ListAssetsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ListAssetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAssetsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAssetsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateAssetRequest. */ + interface IUpdateAssetRequest { + + /** UpdateAssetRequest asset */ + asset?: (google.cloud.visionai.v1alpha1.IAsset|null); + + /** UpdateAssetRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateAssetRequest. */ + class UpdateAssetRequest implements IUpdateAssetRequest { + + /** + * Constructs a new UpdateAssetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IUpdateAssetRequest); + + /** UpdateAssetRequest asset. */ + public asset?: (google.cloud.visionai.v1alpha1.IAsset|null); + + /** UpdateAssetRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateAssetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateAssetRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IUpdateAssetRequest): google.cloud.visionai.v1alpha1.UpdateAssetRequest; + + /** + * Encodes the specified UpdateAssetRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateAssetRequest.verify|verify} messages. + * @param message UpdateAssetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IUpdateAssetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateAssetRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateAssetRequest.verify|verify} messages. + * @param message UpdateAssetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IUpdateAssetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateAssetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateAssetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.UpdateAssetRequest; + + /** + * Decodes an UpdateAssetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateAssetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.UpdateAssetRequest; + + /** + * Verifies an UpdateAssetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateAssetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateAssetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.UpdateAssetRequest; + + /** + * Creates a plain object from an UpdateAssetRequest message. Also converts values to other types if specified. + * @param message UpdateAssetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.UpdateAssetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateAssetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateAssetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteAssetRequest. */ + interface IDeleteAssetRequest { + + /** DeleteAssetRequest name */ + name?: (string|null); + } + + /** Represents a DeleteAssetRequest. */ + class DeleteAssetRequest implements IDeleteAssetRequest { + + /** + * Constructs a new DeleteAssetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IDeleteAssetRequest); + + /** DeleteAssetRequest name. */ + public name: string; + + /** + * Creates a new DeleteAssetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteAssetRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IDeleteAssetRequest): google.cloud.visionai.v1alpha1.DeleteAssetRequest; + + /** + * Encodes the specified DeleteAssetRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteAssetRequest.verify|verify} messages. + * @param message DeleteAssetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IDeleteAssetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteAssetRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteAssetRequest.verify|verify} messages. + * @param message DeleteAssetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IDeleteAssetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteAssetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteAssetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.DeleteAssetRequest; + + /** + * Decodes a DeleteAssetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteAssetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.DeleteAssetRequest; + + /** + * Verifies a DeleteAssetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteAssetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteAssetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.DeleteAssetRequest; + + /** + * Creates a plain object from a DeleteAssetRequest message. Also converts values to other types if specified. + * @param message DeleteAssetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.DeleteAssetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteAssetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteAssetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Asset. */ + interface IAsset { + + /** Asset name */ + name?: (string|null); + + /** Asset ttl */ + ttl?: (google.protobuf.IDuration|null); + } + + /** Represents an Asset. */ + class Asset implements IAsset { + + /** + * Constructs a new Asset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IAsset); + + /** Asset name. */ + public name: string; + + /** Asset ttl. */ + public ttl?: (google.protobuf.IDuration|null); + + /** + * Creates a new Asset instance using the specified properties. + * @param [properties] Properties to set + * @returns Asset instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IAsset): google.cloud.visionai.v1alpha1.Asset; + + /** + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.visionai.v1alpha1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Asset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.Asset; + + /** + * Decodes an Asset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.Asset; + + /** + * Verifies an Asset message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Asset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Asset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.Asset; + + /** + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @param message Asset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Asset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Asset + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateCorpusRequest. */ + interface ICreateCorpusRequest { + + /** CreateCorpusRequest parent */ + parent?: (string|null); + + /** CreateCorpusRequest corpus */ + corpus?: (google.cloud.visionai.v1alpha1.ICorpus|null); + } + + /** Represents a CreateCorpusRequest. */ + class CreateCorpusRequest implements ICreateCorpusRequest { + + /** + * Constructs a new CreateCorpusRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.ICreateCorpusRequest); + + /** CreateCorpusRequest parent. */ + public parent: string; + + /** CreateCorpusRequest corpus. */ + public corpus?: (google.cloud.visionai.v1alpha1.ICorpus|null); + + /** + * Creates a new CreateCorpusRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateCorpusRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.ICreateCorpusRequest): google.cloud.visionai.v1alpha1.CreateCorpusRequest; + + /** + * Encodes the specified CreateCorpusRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateCorpusRequest.verify|verify} messages. + * @param message CreateCorpusRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.ICreateCorpusRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateCorpusRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateCorpusRequest.verify|verify} messages. + * @param message CreateCorpusRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.ICreateCorpusRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateCorpusRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateCorpusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.CreateCorpusRequest; + + /** + * Decodes a CreateCorpusRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateCorpusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.CreateCorpusRequest; + + /** + * Verifies a CreateCorpusRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateCorpusRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateCorpusRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.CreateCorpusRequest; + + /** + * Creates a plain object from a CreateCorpusRequest message. Also converts values to other types if specified. + * @param message CreateCorpusRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.CreateCorpusRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateCorpusRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateCorpusRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateCorpusMetadata. */ + interface ICreateCorpusMetadata { + } + + /** Represents a CreateCorpusMetadata. */ + class CreateCorpusMetadata implements ICreateCorpusMetadata { + + /** + * Constructs a new CreateCorpusMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.ICreateCorpusMetadata); + + /** + * Creates a new CreateCorpusMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateCorpusMetadata instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.ICreateCorpusMetadata): google.cloud.visionai.v1alpha1.CreateCorpusMetadata; + + /** + * Encodes the specified CreateCorpusMetadata message. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateCorpusMetadata.verify|verify} messages. + * @param message CreateCorpusMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.ICreateCorpusMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateCorpusMetadata message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateCorpusMetadata.verify|verify} messages. + * @param message CreateCorpusMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.ICreateCorpusMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateCorpusMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateCorpusMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.CreateCorpusMetadata; + + /** + * Decodes a CreateCorpusMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateCorpusMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.CreateCorpusMetadata; + + /** + * Verifies a CreateCorpusMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateCorpusMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateCorpusMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.CreateCorpusMetadata; + + /** + * Creates a plain object from a CreateCorpusMetadata message. Also converts values to other types if specified. + * @param message CreateCorpusMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.CreateCorpusMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateCorpusMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateCorpusMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Corpus. */ + interface ICorpus { + + /** Corpus name */ + name?: (string|null); + + /** Corpus displayName */ + displayName?: (string|null); + + /** Corpus description */ + description?: (string|null); + + /** Corpus defaultTtl */ + defaultTtl?: (google.protobuf.IDuration|null); + } + + /** Represents a Corpus. */ + class Corpus implements ICorpus { + + /** + * Constructs a new Corpus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.ICorpus); + + /** Corpus name. */ + public name: string; + + /** Corpus displayName. */ + public displayName: string; + + /** Corpus description. */ + public description: string; + + /** Corpus defaultTtl. */ + public defaultTtl?: (google.protobuf.IDuration|null); + + /** + * Creates a new Corpus instance using the specified properties. + * @param [properties] Properties to set + * @returns Corpus instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.ICorpus): google.cloud.visionai.v1alpha1.Corpus; + + /** + * Encodes the specified Corpus message. Does not implicitly {@link google.cloud.visionai.v1alpha1.Corpus.verify|verify} messages. + * @param message Corpus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.ICorpus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Corpus message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.Corpus.verify|verify} messages. + * @param message Corpus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.ICorpus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Corpus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Corpus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.Corpus; + + /** + * Decodes a Corpus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Corpus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.Corpus; + + /** + * Verifies a Corpus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Corpus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Corpus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.Corpus; + + /** + * Creates a plain object from a Corpus message. Also converts values to other types if specified. + * @param message Corpus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.Corpus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Corpus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Corpus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetCorpusRequest. */ + interface IGetCorpusRequest { + + /** GetCorpusRequest name */ + name?: (string|null); + } + + /** Represents a GetCorpusRequest. */ + class GetCorpusRequest implements IGetCorpusRequest { + + /** + * Constructs a new GetCorpusRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IGetCorpusRequest); + + /** GetCorpusRequest name. */ + public name: string; + + /** + * Creates a new GetCorpusRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetCorpusRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IGetCorpusRequest): google.cloud.visionai.v1alpha1.GetCorpusRequest; + + /** + * Encodes the specified GetCorpusRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetCorpusRequest.verify|verify} messages. + * @param message GetCorpusRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IGetCorpusRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetCorpusRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetCorpusRequest.verify|verify} messages. + * @param message GetCorpusRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IGetCorpusRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetCorpusRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetCorpusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.GetCorpusRequest; + + /** + * Decodes a GetCorpusRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetCorpusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.GetCorpusRequest; + + /** + * Verifies a GetCorpusRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetCorpusRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetCorpusRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.GetCorpusRequest; + + /** + * Creates a plain object from a GetCorpusRequest message. Also converts values to other types if specified. + * @param message GetCorpusRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.GetCorpusRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetCorpusRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetCorpusRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateCorpusRequest. */ + interface IUpdateCorpusRequest { + + /** UpdateCorpusRequest corpus */ + corpus?: (google.cloud.visionai.v1alpha1.ICorpus|null); + + /** UpdateCorpusRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateCorpusRequest. */ + class UpdateCorpusRequest implements IUpdateCorpusRequest { + + /** + * Constructs a new UpdateCorpusRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IUpdateCorpusRequest); + + /** UpdateCorpusRequest corpus. */ + public corpus?: (google.cloud.visionai.v1alpha1.ICorpus|null); + + /** UpdateCorpusRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateCorpusRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateCorpusRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IUpdateCorpusRequest): google.cloud.visionai.v1alpha1.UpdateCorpusRequest; + + /** + * Encodes the specified UpdateCorpusRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateCorpusRequest.verify|verify} messages. + * @param message UpdateCorpusRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IUpdateCorpusRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateCorpusRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateCorpusRequest.verify|verify} messages. + * @param message UpdateCorpusRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IUpdateCorpusRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateCorpusRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateCorpusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.UpdateCorpusRequest; + + /** + * Decodes an UpdateCorpusRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateCorpusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.UpdateCorpusRequest; + + /** + * Verifies an UpdateCorpusRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateCorpusRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateCorpusRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.UpdateCorpusRequest; + + /** + * Creates a plain object from an UpdateCorpusRequest message. Also converts values to other types if specified. + * @param message UpdateCorpusRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.UpdateCorpusRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateCorpusRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateCorpusRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCorporaRequest. */ + interface IListCorporaRequest { + + /** ListCorporaRequest parent */ + parent?: (string|null); + + /** ListCorporaRequest pageSize */ + pageSize?: (number|null); + + /** ListCorporaRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListCorporaRequest. */ + class ListCorporaRequest implements IListCorporaRequest { + + /** + * Constructs a new ListCorporaRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IListCorporaRequest); + + /** ListCorporaRequest parent. */ + public parent: string; + + /** ListCorporaRequest pageSize. */ + public pageSize: number; + + /** ListCorporaRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListCorporaRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCorporaRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IListCorporaRequest): google.cloud.visionai.v1alpha1.ListCorporaRequest; + + /** + * Encodes the specified ListCorporaRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListCorporaRequest.verify|verify} messages. + * @param message ListCorporaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IListCorporaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCorporaRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListCorporaRequest.verify|verify} messages. + * @param message ListCorporaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IListCorporaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCorporaRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCorporaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ListCorporaRequest; + + /** + * Decodes a ListCorporaRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCorporaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ListCorporaRequest; + + /** + * Verifies a ListCorporaRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCorporaRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCorporaRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ListCorporaRequest; + + /** + * Creates a plain object from a ListCorporaRequest message. Also converts values to other types if specified. + * @param message ListCorporaRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ListCorporaRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCorporaRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCorporaRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCorporaResponse. */ + interface IListCorporaResponse { + + /** ListCorporaResponse corpora */ + corpora?: (google.cloud.visionai.v1alpha1.ICorpus[]|null); + + /** ListCorporaResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListCorporaResponse. */ + class ListCorporaResponse implements IListCorporaResponse { + + /** + * Constructs a new ListCorporaResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IListCorporaResponse); + + /** ListCorporaResponse corpora. */ + public corpora: google.cloud.visionai.v1alpha1.ICorpus[]; + + /** ListCorporaResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListCorporaResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCorporaResponse instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IListCorporaResponse): google.cloud.visionai.v1alpha1.ListCorporaResponse; + + /** + * Encodes the specified ListCorporaResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListCorporaResponse.verify|verify} messages. + * @param message ListCorporaResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IListCorporaResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCorporaResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListCorporaResponse.verify|verify} messages. + * @param message ListCorporaResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IListCorporaResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCorporaResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCorporaResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ListCorporaResponse; + + /** + * Decodes a ListCorporaResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCorporaResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ListCorporaResponse; + + /** + * Verifies a ListCorporaResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCorporaResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCorporaResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ListCorporaResponse; + + /** + * Creates a plain object from a ListCorporaResponse message. Also converts values to other types if specified. + * @param message ListCorporaResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ListCorporaResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCorporaResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCorporaResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteCorpusRequest. */ + interface IDeleteCorpusRequest { + + /** DeleteCorpusRequest name */ + name?: (string|null); + } + + /** Represents a DeleteCorpusRequest. */ + class DeleteCorpusRequest implements IDeleteCorpusRequest { + + /** + * Constructs a new DeleteCorpusRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IDeleteCorpusRequest); + + /** DeleteCorpusRequest name. */ + public name: string; + + /** + * Creates a new DeleteCorpusRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteCorpusRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IDeleteCorpusRequest): google.cloud.visionai.v1alpha1.DeleteCorpusRequest; + + /** + * Encodes the specified DeleteCorpusRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteCorpusRequest.verify|verify} messages. + * @param message DeleteCorpusRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IDeleteCorpusRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteCorpusRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteCorpusRequest.verify|verify} messages. + * @param message DeleteCorpusRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IDeleteCorpusRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteCorpusRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteCorpusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.DeleteCorpusRequest; + + /** + * Decodes a DeleteCorpusRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteCorpusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.DeleteCorpusRequest; + + /** + * Verifies a DeleteCorpusRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteCorpusRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteCorpusRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.DeleteCorpusRequest; + + /** + * Creates a plain object from a DeleteCorpusRequest message. Also converts values to other types if specified. + * @param message DeleteCorpusRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.DeleteCorpusRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteCorpusRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteCorpusRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateDataSchemaRequest. */ + interface ICreateDataSchemaRequest { + + /** CreateDataSchemaRequest parent */ + parent?: (string|null); + + /** CreateDataSchemaRequest dataSchema */ + dataSchema?: (google.cloud.visionai.v1alpha1.IDataSchema|null); + } + + /** Represents a CreateDataSchemaRequest. */ + class CreateDataSchemaRequest implements ICreateDataSchemaRequest { + + /** + * Constructs a new CreateDataSchemaRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.ICreateDataSchemaRequest); + + /** CreateDataSchemaRequest parent. */ + public parent: string; + + /** CreateDataSchemaRequest dataSchema. */ + public dataSchema?: (google.cloud.visionai.v1alpha1.IDataSchema|null); + + /** + * Creates a new CreateDataSchemaRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateDataSchemaRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.ICreateDataSchemaRequest): google.cloud.visionai.v1alpha1.CreateDataSchemaRequest; + + /** + * Encodes the specified CreateDataSchemaRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateDataSchemaRequest.verify|verify} messages. + * @param message CreateDataSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.ICreateDataSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateDataSchemaRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateDataSchemaRequest.verify|verify} messages. + * @param message CreateDataSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.ICreateDataSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateDataSchemaRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateDataSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.CreateDataSchemaRequest; + + /** + * Decodes a CreateDataSchemaRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateDataSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.CreateDataSchemaRequest; + + /** + * Verifies a CreateDataSchemaRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateDataSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateDataSchemaRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.CreateDataSchemaRequest; + + /** + * Creates a plain object from a CreateDataSchemaRequest message. Also converts values to other types if specified. + * @param message CreateDataSchemaRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.CreateDataSchemaRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateDataSchemaRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateDataSchemaRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DataSchema. */ + interface IDataSchema { + + /** DataSchema name */ + name?: (string|null); + + /** DataSchema key */ + key?: (string|null); + + /** DataSchema schemaDetails */ + schemaDetails?: (google.cloud.visionai.v1alpha1.IDataSchemaDetails|null); + } + + /** Represents a DataSchema. */ + class DataSchema implements IDataSchema { + + /** + * Constructs a new DataSchema. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IDataSchema); + + /** DataSchema name. */ + public name: string; + + /** DataSchema key. */ + public key: string; + + /** DataSchema schemaDetails. */ + public schemaDetails?: (google.cloud.visionai.v1alpha1.IDataSchemaDetails|null); + + /** + * Creates a new DataSchema instance using the specified properties. + * @param [properties] Properties to set + * @returns DataSchema instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IDataSchema): google.cloud.visionai.v1alpha1.DataSchema; + + /** + * Encodes the specified DataSchema message. Does not implicitly {@link google.cloud.visionai.v1alpha1.DataSchema.verify|verify} messages. + * @param message DataSchema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IDataSchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataSchema message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.DataSchema.verify|verify} messages. + * @param message DataSchema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IDataSchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataSchema message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.DataSchema; + + /** + * Decodes a DataSchema message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.DataSchema; + + /** + * Verifies a DataSchema message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataSchema message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataSchema + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.DataSchema; + + /** + * Creates a plain object from a DataSchema message. Also converts values to other types if specified. + * @param message DataSchema + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.DataSchema, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataSchema to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataSchema + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DataSchemaDetails. */ + interface IDataSchemaDetails { + + /** DataSchemaDetails type */ + type?: (google.cloud.visionai.v1alpha1.DataSchemaDetails.DataType|keyof typeof google.cloud.visionai.v1alpha1.DataSchemaDetails.DataType|null); + + /** DataSchemaDetails protoAnyConfig */ + protoAnyConfig?: (google.cloud.visionai.v1alpha1.DataSchemaDetails.IProtoAnyConfig|null); + + /** DataSchemaDetails granularity */ + granularity?: (google.cloud.visionai.v1alpha1.DataSchemaDetails.Granularity|keyof typeof google.cloud.visionai.v1alpha1.DataSchemaDetails.Granularity|null); + + /** DataSchemaDetails searchStrategy */ + searchStrategy?: (google.cloud.visionai.v1alpha1.DataSchemaDetails.ISearchStrategy|null); + } + + /** Represents a DataSchemaDetails. */ + class DataSchemaDetails implements IDataSchemaDetails { + + /** + * Constructs a new DataSchemaDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IDataSchemaDetails); + + /** DataSchemaDetails type. */ + public type: (google.cloud.visionai.v1alpha1.DataSchemaDetails.DataType|keyof typeof google.cloud.visionai.v1alpha1.DataSchemaDetails.DataType); + + /** DataSchemaDetails protoAnyConfig. */ + public protoAnyConfig?: (google.cloud.visionai.v1alpha1.DataSchemaDetails.IProtoAnyConfig|null); + + /** DataSchemaDetails granularity. */ + public granularity: (google.cloud.visionai.v1alpha1.DataSchemaDetails.Granularity|keyof typeof google.cloud.visionai.v1alpha1.DataSchemaDetails.Granularity); + + /** DataSchemaDetails searchStrategy. */ + public searchStrategy?: (google.cloud.visionai.v1alpha1.DataSchemaDetails.ISearchStrategy|null); + + /** + * Creates a new DataSchemaDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns DataSchemaDetails instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IDataSchemaDetails): google.cloud.visionai.v1alpha1.DataSchemaDetails; + + /** + * Encodes the specified DataSchemaDetails message. Does not implicitly {@link google.cloud.visionai.v1alpha1.DataSchemaDetails.verify|verify} messages. + * @param message DataSchemaDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IDataSchemaDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataSchemaDetails message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.DataSchemaDetails.verify|verify} messages. + * @param message DataSchemaDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IDataSchemaDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataSchemaDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataSchemaDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.DataSchemaDetails; + + /** + * Decodes a DataSchemaDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataSchemaDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.DataSchemaDetails; + + /** + * Verifies a DataSchemaDetails message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataSchemaDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataSchemaDetails + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.DataSchemaDetails; + + /** + * Creates a plain object from a DataSchemaDetails message. Also converts values to other types if specified. + * @param message DataSchemaDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.DataSchemaDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataSchemaDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataSchemaDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DataSchemaDetails { + + /** Properties of a ProtoAnyConfig. */ + interface IProtoAnyConfig { + + /** ProtoAnyConfig typeUri */ + typeUri?: (string|null); + } + + /** Represents a ProtoAnyConfig. */ + class ProtoAnyConfig implements IProtoAnyConfig { + + /** + * Constructs a new ProtoAnyConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.DataSchemaDetails.IProtoAnyConfig); + + /** ProtoAnyConfig typeUri. */ + public typeUri: string; + + /** + * Creates a new ProtoAnyConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ProtoAnyConfig instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.DataSchemaDetails.IProtoAnyConfig): google.cloud.visionai.v1alpha1.DataSchemaDetails.ProtoAnyConfig; + + /** + * Encodes the specified ProtoAnyConfig message. Does not implicitly {@link google.cloud.visionai.v1alpha1.DataSchemaDetails.ProtoAnyConfig.verify|verify} messages. + * @param message ProtoAnyConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.DataSchemaDetails.IProtoAnyConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProtoAnyConfig message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.DataSchemaDetails.ProtoAnyConfig.verify|verify} messages. + * @param message ProtoAnyConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.DataSchemaDetails.IProtoAnyConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProtoAnyConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProtoAnyConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.DataSchemaDetails.ProtoAnyConfig; + + /** + * Decodes a ProtoAnyConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProtoAnyConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.DataSchemaDetails.ProtoAnyConfig; + + /** + * Verifies a ProtoAnyConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProtoAnyConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProtoAnyConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.DataSchemaDetails.ProtoAnyConfig; + + /** + * Creates a plain object from a ProtoAnyConfig message. Also converts values to other types if specified. + * @param message ProtoAnyConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.DataSchemaDetails.ProtoAnyConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProtoAnyConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ProtoAnyConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchStrategy. */ + interface ISearchStrategy { + + /** SearchStrategy searchStrategyType */ + searchStrategyType?: (google.cloud.visionai.v1alpha1.DataSchemaDetails.SearchStrategy.SearchStrategyType|keyof typeof google.cloud.visionai.v1alpha1.DataSchemaDetails.SearchStrategy.SearchStrategyType|null); + } + + /** Represents a SearchStrategy. */ + class SearchStrategy implements ISearchStrategy { + + /** + * Constructs a new SearchStrategy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.DataSchemaDetails.ISearchStrategy); + + /** SearchStrategy searchStrategyType. */ + public searchStrategyType: (google.cloud.visionai.v1alpha1.DataSchemaDetails.SearchStrategy.SearchStrategyType|keyof typeof google.cloud.visionai.v1alpha1.DataSchemaDetails.SearchStrategy.SearchStrategyType); + + /** + * Creates a new SearchStrategy instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchStrategy instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.DataSchemaDetails.ISearchStrategy): google.cloud.visionai.v1alpha1.DataSchemaDetails.SearchStrategy; + + /** + * Encodes the specified SearchStrategy message. Does not implicitly {@link google.cloud.visionai.v1alpha1.DataSchemaDetails.SearchStrategy.verify|verify} messages. + * @param message SearchStrategy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.DataSchemaDetails.ISearchStrategy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchStrategy message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.DataSchemaDetails.SearchStrategy.verify|verify} messages. + * @param message SearchStrategy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.DataSchemaDetails.ISearchStrategy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchStrategy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchStrategy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.DataSchemaDetails.SearchStrategy; + + /** + * Decodes a SearchStrategy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchStrategy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.DataSchemaDetails.SearchStrategy; + + /** + * Verifies a SearchStrategy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchStrategy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchStrategy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.DataSchemaDetails.SearchStrategy; + + /** + * Creates a plain object from a SearchStrategy message. Also converts values to other types if specified. + * @param message SearchStrategy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.DataSchemaDetails.SearchStrategy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchStrategy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchStrategy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SearchStrategy { + + /** SearchStrategyType enum. */ + enum SearchStrategyType { + NO_SEARCH = 0, + EXACT_SEARCH = 1, + SMART_SEARCH = 2 + } + } + + /** DataType enum. */ + enum DataType { + DATA_TYPE_UNSPECIFIED = 0, + INTEGER = 1, + FLOAT = 2, + STRING = 3, + DATETIME = 5, + GEO_COORDINATE = 7, + PROTO_ANY = 8, + BOOLEAN = 9 + } + + /** Granularity enum. */ + enum Granularity { + GRANULARITY_UNSPECIFIED = 0, + GRANULARITY_ASSET_LEVEL = 1, + GRANULARITY_PARTITION_LEVEL = 2 + } + } + + /** Properties of an UpdateDataSchemaRequest. */ + interface IUpdateDataSchemaRequest { + + /** UpdateDataSchemaRequest dataSchema */ + dataSchema?: (google.cloud.visionai.v1alpha1.IDataSchema|null); + + /** UpdateDataSchemaRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateDataSchemaRequest. */ + class UpdateDataSchemaRequest implements IUpdateDataSchemaRequest { + + /** + * Constructs a new UpdateDataSchemaRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IUpdateDataSchemaRequest); + + /** UpdateDataSchemaRequest dataSchema. */ + public dataSchema?: (google.cloud.visionai.v1alpha1.IDataSchema|null); + + /** UpdateDataSchemaRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateDataSchemaRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateDataSchemaRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IUpdateDataSchemaRequest): google.cloud.visionai.v1alpha1.UpdateDataSchemaRequest; + + /** + * Encodes the specified UpdateDataSchemaRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateDataSchemaRequest.verify|verify} messages. + * @param message UpdateDataSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IUpdateDataSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateDataSchemaRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateDataSchemaRequest.verify|verify} messages. + * @param message UpdateDataSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IUpdateDataSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateDataSchemaRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateDataSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.UpdateDataSchemaRequest; + + /** + * Decodes an UpdateDataSchemaRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateDataSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.UpdateDataSchemaRequest; + + /** + * Verifies an UpdateDataSchemaRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateDataSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateDataSchemaRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.UpdateDataSchemaRequest; + + /** + * Creates a plain object from an UpdateDataSchemaRequest message. Also converts values to other types if specified. + * @param message UpdateDataSchemaRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.UpdateDataSchemaRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateDataSchemaRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateDataSchemaRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetDataSchemaRequest. */ + interface IGetDataSchemaRequest { + + /** GetDataSchemaRequest name */ + name?: (string|null); + } + + /** Represents a GetDataSchemaRequest. */ + class GetDataSchemaRequest implements IGetDataSchemaRequest { + + /** + * Constructs a new GetDataSchemaRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IGetDataSchemaRequest); + + /** GetDataSchemaRequest name. */ + public name: string; + + /** + * Creates a new GetDataSchemaRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDataSchemaRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IGetDataSchemaRequest): google.cloud.visionai.v1alpha1.GetDataSchemaRequest; + + /** + * Encodes the specified GetDataSchemaRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetDataSchemaRequest.verify|verify} messages. + * @param message GetDataSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IGetDataSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDataSchemaRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetDataSchemaRequest.verify|verify} messages. + * @param message GetDataSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IGetDataSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDataSchemaRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDataSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.GetDataSchemaRequest; + + /** + * Decodes a GetDataSchemaRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDataSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.GetDataSchemaRequest; + + /** + * Verifies a GetDataSchemaRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetDataSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetDataSchemaRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.GetDataSchemaRequest; + + /** + * Creates a plain object from a GetDataSchemaRequest message. Also converts values to other types if specified. + * @param message GetDataSchemaRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.GetDataSchemaRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetDataSchemaRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetDataSchemaRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteDataSchemaRequest. */ + interface IDeleteDataSchemaRequest { + + /** DeleteDataSchemaRequest name */ + name?: (string|null); + } + + /** Represents a DeleteDataSchemaRequest. */ + class DeleteDataSchemaRequest implements IDeleteDataSchemaRequest { + + /** + * Constructs a new DeleteDataSchemaRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IDeleteDataSchemaRequest); + + /** DeleteDataSchemaRequest name. */ + public name: string; + + /** + * Creates a new DeleteDataSchemaRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteDataSchemaRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IDeleteDataSchemaRequest): google.cloud.visionai.v1alpha1.DeleteDataSchemaRequest; + + /** + * Encodes the specified DeleteDataSchemaRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteDataSchemaRequest.verify|verify} messages. + * @param message DeleteDataSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IDeleteDataSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteDataSchemaRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteDataSchemaRequest.verify|verify} messages. + * @param message DeleteDataSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IDeleteDataSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteDataSchemaRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteDataSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.DeleteDataSchemaRequest; + + /** + * Decodes a DeleteDataSchemaRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteDataSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.DeleteDataSchemaRequest; + + /** + * Verifies a DeleteDataSchemaRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteDataSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteDataSchemaRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.DeleteDataSchemaRequest; + + /** + * Creates a plain object from a DeleteDataSchemaRequest message. Also converts values to other types if specified. + * @param message DeleteDataSchemaRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.DeleteDataSchemaRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteDataSchemaRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteDataSchemaRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDataSchemasRequest. */ + interface IListDataSchemasRequest { + + /** ListDataSchemasRequest parent */ + parent?: (string|null); + + /** ListDataSchemasRequest pageSize */ + pageSize?: (number|null); + + /** ListDataSchemasRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListDataSchemasRequest. */ + class ListDataSchemasRequest implements IListDataSchemasRequest { + + /** + * Constructs a new ListDataSchemasRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IListDataSchemasRequest); + + /** ListDataSchemasRequest parent. */ + public parent: string; + + /** ListDataSchemasRequest pageSize. */ + public pageSize: number; + + /** ListDataSchemasRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListDataSchemasRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDataSchemasRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IListDataSchemasRequest): google.cloud.visionai.v1alpha1.ListDataSchemasRequest; + + /** + * Encodes the specified ListDataSchemasRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListDataSchemasRequest.verify|verify} messages. + * @param message ListDataSchemasRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IListDataSchemasRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDataSchemasRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListDataSchemasRequest.verify|verify} messages. + * @param message ListDataSchemasRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IListDataSchemasRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDataSchemasRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDataSchemasRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ListDataSchemasRequest; + + /** + * Decodes a ListDataSchemasRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDataSchemasRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ListDataSchemasRequest; + + /** + * Verifies a ListDataSchemasRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDataSchemasRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDataSchemasRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ListDataSchemasRequest; + + /** + * Creates a plain object from a ListDataSchemasRequest message. Also converts values to other types if specified. + * @param message ListDataSchemasRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ListDataSchemasRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDataSchemasRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDataSchemasRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDataSchemasResponse. */ + interface IListDataSchemasResponse { + + /** ListDataSchemasResponse dataSchemas */ + dataSchemas?: (google.cloud.visionai.v1alpha1.IDataSchema[]|null); + + /** ListDataSchemasResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListDataSchemasResponse. */ + class ListDataSchemasResponse implements IListDataSchemasResponse { + + /** + * Constructs a new ListDataSchemasResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IListDataSchemasResponse); + + /** ListDataSchemasResponse dataSchemas. */ + public dataSchemas: google.cloud.visionai.v1alpha1.IDataSchema[]; + + /** ListDataSchemasResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListDataSchemasResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDataSchemasResponse instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IListDataSchemasResponse): google.cloud.visionai.v1alpha1.ListDataSchemasResponse; + + /** + * Encodes the specified ListDataSchemasResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListDataSchemasResponse.verify|verify} messages. + * @param message ListDataSchemasResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IListDataSchemasResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDataSchemasResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListDataSchemasResponse.verify|verify} messages. + * @param message ListDataSchemasResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IListDataSchemasResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDataSchemasResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDataSchemasResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ListDataSchemasResponse; + + /** + * Decodes a ListDataSchemasResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDataSchemasResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ListDataSchemasResponse; + + /** + * Verifies a ListDataSchemasResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDataSchemasResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDataSchemasResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ListDataSchemasResponse; + + /** + * Creates a plain object from a ListDataSchemasResponse message. Also converts values to other types if specified. + * @param message ListDataSchemasResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ListDataSchemasResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDataSchemasResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDataSchemasResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateAnnotationRequest. */ + interface ICreateAnnotationRequest { + + /** CreateAnnotationRequest parent */ + parent?: (string|null); + + /** CreateAnnotationRequest annotation */ + annotation?: (google.cloud.visionai.v1alpha1.IAnnotation|null); + + /** CreateAnnotationRequest annotationId */ + annotationId?: (string|null); + } + + /** Represents a CreateAnnotationRequest. */ + class CreateAnnotationRequest implements ICreateAnnotationRequest { + + /** + * Constructs a new CreateAnnotationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.ICreateAnnotationRequest); + + /** CreateAnnotationRequest parent. */ + public parent: string; + + /** CreateAnnotationRequest annotation. */ + public annotation?: (google.cloud.visionai.v1alpha1.IAnnotation|null); + + /** CreateAnnotationRequest annotationId. */ + public annotationId?: (string|null); + + /** + * Creates a new CreateAnnotationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateAnnotationRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.ICreateAnnotationRequest): google.cloud.visionai.v1alpha1.CreateAnnotationRequest; + + /** + * Encodes the specified CreateAnnotationRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateAnnotationRequest.verify|verify} messages. + * @param message CreateAnnotationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.ICreateAnnotationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateAnnotationRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateAnnotationRequest.verify|verify} messages. + * @param message CreateAnnotationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.ICreateAnnotationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateAnnotationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateAnnotationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.CreateAnnotationRequest; + + /** + * Decodes a CreateAnnotationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateAnnotationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.CreateAnnotationRequest; + + /** + * Verifies a CreateAnnotationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateAnnotationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateAnnotationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.CreateAnnotationRequest; + + /** + * Creates a plain object from a CreateAnnotationRequest message. Also converts values to other types if specified. + * @param message CreateAnnotationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.CreateAnnotationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateAnnotationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateAnnotationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation name */ + name?: (string|null); + + /** Annotation userSpecifiedAnnotation */ + userSpecifiedAnnotation?: (google.cloud.visionai.v1alpha1.IUserSpecifiedAnnotation|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IAnnotation); + + /** Annotation name. */ + public name: string; + + /** Annotation userSpecifiedAnnotation. */ + public userSpecifiedAnnotation?: (google.cloud.visionai.v1alpha1.IUserSpecifiedAnnotation|null); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IAnnotation): google.cloud.visionai.v1alpha1.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.cloud.visionai.v1alpha1.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UserSpecifiedAnnotation. */ + interface IUserSpecifiedAnnotation { + + /** UserSpecifiedAnnotation key */ + key?: (string|null); + + /** UserSpecifiedAnnotation value */ + value?: (google.cloud.visionai.v1alpha1.IAnnotationValue|null); + + /** UserSpecifiedAnnotation partition */ + partition?: (google.cloud.visionai.v1alpha1.IPartition|null); + } + + /** Represents a UserSpecifiedAnnotation. */ + class UserSpecifiedAnnotation implements IUserSpecifiedAnnotation { + + /** + * Constructs a new UserSpecifiedAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IUserSpecifiedAnnotation); + + /** UserSpecifiedAnnotation key. */ + public key: string; + + /** UserSpecifiedAnnotation value. */ + public value?: (google.cloud.visionai.v1alpha1.IAnnotationValue|null); + + /** UserSpecifiedAnnotation partition. */ + public partition?: (google.cloud.visionai.v1alpha1.IPartition|null); + + /** + * Creates a new UserSpecifiedAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns UserSpecifiedAnnotation instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IUserSpecifiedAnnotation): google.cloud.visionai.v1alpha1.UserSpecifiedAnnotation; + + /** + * Encodes the specified UserSpecifiedAnnotation message. Does not implicitly {@link google.cloud.visionai.v1alpha1.UserSpecifiedAnnotation.verify|verify} messages. + * @param message UserSpecifiedAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IUserSpecifiedAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UserSpecifiedAnnotation message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.UserSpecifiedAnnotation.verify|verify} messages. + * @param message UserSpecifiedAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IUserSpecifiedAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UserSpecifiedAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UserSpecifiedAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.UserSpecifiedAnnotation; + + /** + * Decodes a UserSpecifiedAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UserSpecifiedAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.UserSpecifiedAnnotation; + + /** + * Verifies a UserSpecifiedAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UserSpecifiedAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UserSpecifiedAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.UserSpecifiedAnnotation; + + /** + * Creates a plain object from a UserSpecifiedAnnotation message. Also converts values to other types if specified. + * @param message UserSpecifiedAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.UserSpecifiedAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UserSpecifiedAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UserSpecifiedAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GeoCoordinate. */ + interface IGeoCoordinate { + + /** GeoCoordinate latitude */ + latitude?: (number|null); + + /** GeoCoordinate longitude */ + longitude?: (number|null); + } + + /** Represents a GeoCoordinate. */ + class GeoCoordinate implements IGeoCoordinate { + + /** + * Constructs a new GeoCoordinate. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IGeoCoordinate); + + /** GeoCoordinate latitude. */ + public latitude: number; + + /** GeoCoordinate longitude. */ + public longitude: number; + + /** + * Creates a new GeoCoordinate instance using the specified properties. + * @param [properties] Properties to set + * @returns GeoCoordinate instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IGeoCoordinate): google.cloud.visionai.v1alpha1.GeoCoordinate; + + /** + * Encodes the specified GeoCoordinate message. Does not implicitly {@link google.cloud.visionai.v1alpha1.GeoCoordinate.verify|verify} messages. + * @param message GeoCoordinate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IGeoCoordinate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeoCoordinate message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.GeoCoordinate.verify|verify} messages. + * @param message GeoCoordinate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IGeoCoordinate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeoCoordinate message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeoCoordinate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.GeoCoordinate; + + /** + * Decodes a GeoCoordinate message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeoCoordinate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.GeoCoordinate; + + /** + * Verifies a GeoCoordinate message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeoCoordinate message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeoCoordinate + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.GeoCoordinate; + + /** + * Creates a plain object from a GeoCoordinate message. Also converts values to other types if specified. + * @param message GeoCoordinate + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.GeoCoordinate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeoCoordinate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeoCoordinate + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AnnotationValue. */ + interface IAnnotationValue { + + /** AnnotationValue intValue */ + intValue?: (number|Long|string|null); + + /** AnnotationValue floatValue */ + floatValue?: (number|null); + + /** AnnotationValue strValue */ + strValue?: (string|null); + + /** AnnotationValue datetimeValue */ + datetimeValue?: (string|null); + + /** AnnotationValue geoCoordinate */ + geoCoordinate?: (google.cloud.visionai.v1alpha1.IGeoCoordinate|null); + + /** AnnotationValue protoAnyValue */ + protoAnyValue?: (google.protobuf.IAny|null); + + /** AnnotationValue boolValue */ + boolValue?: (boolean|null); + + /** AnnotationValue customizedStructDataValue */ + customizedStructDataValue?: (google.protobuf.IStruct|null); + } + + /** Represents an AnnotationValue. */ + class AnnotationValue implements IAnnotationValue { + + /** + * Constructs a new AnnotationValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IAnnotationValue); + + /** AnnotationValue intValue. */ + public intValue?: (number|Long|string|null); + + /** AnnotationValue floatValue. */ + public floatValue?: (number|null); + + /** AnnotationValue strValue. */ + public strValue?: (string|null); + + /** AnnotationValue datetimeValue. */ + public datetimeValue?: (string|null); + + /** AnnotationValue geoCoordinate. */ + public geoCoordinate?: (google.cloud.visionai.v1alpha1.IGeoCoordinate|null); + + /** AnnotationValue protoAnyValue. */ + public protoAnyValue?: (google.protobuf.IAny|null); + + /** AnnotationValue boolValue. */ + public boolValue?: (boolean|null); + + /** AnnotationValue customizedStructDataValue. */ + public customizedStructDataValue?: (google.protobuf.IStruct|null); + + /** AnnotationValue value. */ + public value?: ("intValue"|"floatValue"|"strValue"|"datetimeValue"|"geoCoordinate"|"protoAnyValue"|"boolValue"|"customizedStructDataValue"); + + /** + * Creates a new AnnotationValue instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotationValue instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IAnnotationValue): google.cloud.visionai.v1alpha1.AnnotationValue; + + /** + * Encodes the specified AnnotationValue message. Does not implicitly {@link google.cloud.visionai.v1alpha1.AnnotationValue.verify|verify} messages. + * @param message AnnotationValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IAnnotationValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotationValue message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.AnnotationValue.verify|verify} messages. + * @param message AnnotationValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IAnnotationValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotationValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotationValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.AnnotationValue; + + /** + * Decodes an AnnotationValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotationValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.AnnotationValue; + + /** + * Verifies an AnnotationValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AnnotationValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotationValue + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.AnnotationValue; + + /** + * Creates a plain object from an AnnotationValue message. Also converts values to other types if specified. + * @param message AnnotationValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.AnnotationValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotationValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnnotationValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAnnotationsRequest. */ + interface IListAnnotationsRequest { + + /** ListAnnotationsRequest parent */ + parent?: (string|null); + + /** ListAnnotationsRequest pageSize */ + pageSize?: (number|null); + + /** ListAnnotationsRequest pageToken */ + pageToken?: (string|null); + + /** ListAnnotationsRequest filter */ + filter?: (string|null); + } + + /** Represents a ListAnnotationsRequest. */ + class ListAnnotationsRequest implements IListAnnotationsRequest { + + /** + * Constructs a new ListAnnotationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IListAnnotationsRequest); + + /** ListAnnotationsRequest parent. */ + public parent: string; + + /** ListAnnotationsRequest pageSize. */ + public pageSize: number; + + /** ListAnnotationsRequest pageToken. */ + public pageToken: string; + + /** ListAnnotationsRequest filter. */ + public filter: string; + + /** + * Creates a new ListAnnotationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAnnotationsRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IListAnnotationsRequest): google.cloud.visionai.v1alpha1.ListAnnotationsRequest; + + /** + * Encodes the specified ListAnnotationsRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListAnnotationsRequest.verify|verify} messages. + * @param message ListAnnotationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IListAnnotationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAnnotationsRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListAnnotationsRequest.verify|verify} messages. + * @param message ListAnnotationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IListAnnotationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAnnotationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAnnotationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ListAnnotationsRequest; + + /** + * Decodes a ListAnnotationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAnnotationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ListAnnotationsRequest; + + /** + * Verifies a ListAnnotationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAnnotationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAnnotationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ListAnnotationsRequest; + + /** + * Creates a plain object from a ListAnnotationsRequest message. Also converts values to other types if specified. + * @param message ListAnnotationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ListAnnotationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAnnotationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAnnotationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAnnotationsResponse. */ + interface IListAnnotationsResponse { + + /** ListAnnotationsResponse annotations */ + annotations?: (google.cloud.visionai.v1alpha1.IAnnotation[]|null); + + /** ListAnnotationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListAnnotationsResponse. */ + class ListAnnotationsResponse implements IListAnnotationsResponse { + + /** + * Constructs a new ListAnnotationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IListAnnotationsResponse); + + /** ListAnnotationsResponse annotations. */ + public annotations: google.cloud.visionai.v1alpha1.IAnnotation[]; + + /** ListAnnotationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListAnnotationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAnnotationsResponse instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IListAnnotationsResponse): google.cloud.visionai.v1alpha1.ListAnnotationsResponse; + + /** + * Encodes the specified ListAnnotationsResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListAnnotationsResponse.verify|verify} messages. + * @param message ListAnnotationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IListAnnotationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAnnotationsResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListAnnotationsResponse.verify|verify} messages. + * @param message ListAnnotationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IListAnnotationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAnnotationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAnnotationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ListAnnotationsResponse; + + /** + * Decodes a ListAnnotationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAnnotationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ListAnnotationsResponse; + + /** + * Verifies a ListAnnotationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAnnotationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAnnotationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ListAnnotationsResponse; + + /** + * Creates a plain object from a ListAnnotationsResponse message. Also converts values to other types if specified. + * @param message ListAnnotationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ListAnnotationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAnnotationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAnnotationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetAnnotationRequest. */ + interface IGetAnnotationRequest { + + /** GetAnnotationRequest name */ + name?: (string|null); + } + + /** Represents a GetAnnotationRequest. */ + class GetAnnotationRequest implements IGetAnnotationRequest { + + /** + * Constructs a new GetAnnotationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IGetAnnotationRequest); + + /** GetAnnotationRequest name. */ + public name: string; + + /** + * Creates a new GetAnnotationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetAnnotationRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IGetAnnotationRequest): google.cloud.visionai.v1alpha1.GetAnnotationRequest; + + /** + * Encodes the specified GetAnnotationRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetAnnotationRequest.verify|verify} messages. + * @param message GetAnnotationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IGetAnnotationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetAnnotationRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetAnnotationRequest.verify|verify} messages. + * @param message GetAnnotationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IGetAnnotationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetAnnotationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetAnnotationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.GetAnnotationRequest; + + /** + * Decodes a GetAnnotationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetAnnotationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.GetAnnotationRequest; + + /** + * Verifies a GetAnnotationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetAnnotationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetAnnotationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.GetAnnotationRequest; + + /** + * Creates a plain object from a GetAnnotationRequest message. Also converts values to other types if specified. + * @param message GetAnnotationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.GetAnnotationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetAnnotationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetAnnotationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateAnnotationRequest. */ + interface IUpdateAnnotationRequest { + + /** UpdateAnnotationRequest annotation */ + annotation?: (google.cloud.visionai.v1alpha1.IAnnotation|null); + + /** UpdateAnnotationRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateAnnotationRequest. */ + class UpdateAnnotationRequest implements IUpdateAnnotationRequest { + + /** + * Constructs a new UpdateAnnotationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IUpdateAnnotationRequest); + + /** UpdateAnnotationRequest annotation. */ + public annotation?: (google.cloud.visionai.v1alpha1.IAnnotation|null); + + /** UpdateAnnotationRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateAnnotationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateAnnotationRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IUpdateAnnotationRequest): google.cloud.visionai.v1alpha1.UpdateAnnotationRequest; + + /** + * Encodes the specified UpdateAnnotationRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateAnnotationRequest.verify|verify} messages. + * @param message UpdateAnnotationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IUpdateAnnotationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateAnnotationRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateAnnotationRequest.verify|verify} messages. + * @param message UpdateAnnotationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IUpdateAnnotationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateAnnotationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateAnnotationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.UpdateAnnotationRequest; + + /** + * Decodes an UpdateAnnotationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateAnnotationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.UpdateAnnotationRequest; + + /** + * Verifies an UpdateAnnotationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateAnnotationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateAnnotationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.UpdateAnnotationRequest; + + /** + * Creates a plain object from an UpdateAnnotationRequest message. Also converts values to other types if specified. + * @param message UpdateAnnotationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.UpdateAnnotationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateAnnotationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateAnnotationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteAnnotationRequest. */ + interface IDeleteAnnotationRequest { + + /** DeleteAnnotationRequest name */ + name?: (string|null); + } + + /** Represents a DeleteAnnotationRequest. */ + class DeleteAnnotationRequest implements IDeleteAnnotationRequest { + + /** + * Constructs a new DeleteAnnotationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IDeleteAnnotationRequest); + + /** DeleteAnnotationRequest name. */ + public name: string; + + /** + * Creates a new DeleteAnnotationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteAnnotationRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IDeleteAnnotationRequest): google.cloud.visionai.v1alpha1.DeleteAnnotationRequest; + + /** + * Encodes the specified DeleteAnnotationRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteAnnotationRequest.verify|verify} messages. + * @param message DeleteAnnotationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IDeleteAnnotationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteAnnotationRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteAnnotationRequest.verify|verify} messages. + * @param message DeleteAnnotationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IDeleteAnnotationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteAnnotationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteAnnotationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.DeleteAnnotationRequest; + + /** + * Decodes a DeleteAnnotationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteAnnotationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.DeleteAnnotationRequest; + + /** + * Verifies a DeleteAnnotationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteAnnotationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteAnnotationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.DeleteAnnotationRequest; + + /** + * Creates a plain object from a DeleteAnnotationRequest message. Also converts values to other types if specified. + * @param message DeleteAnnotationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.DeleteAnnotationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteAnnotationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteAnnotationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateSearchConfigRequest. */ + interface ICreateSearchConfigRequest { + + /** CreateSearchConfigRequest parent */ + parent?: (string|null); + + /** CreateSearchConfigRequest searchConfig */ + searchConfig?: (google.cloud.visionai.v1alpha1.ISearchConfig|null); + + /** CreateSearchConfigRequest searchConfigId */ + searchConfigId?: (string|null); + } + + /** Represents a CreateSearchConfigRequest. */ + class CreateSearchConfigRequest implements ICreateSearchConfigRequest { + + /** + * Constructs a new CreateSearchConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.ICreateSearchConfigRequest); + + /** CreateSearchConfigRequest parent. */ + public parent: string; + + /** CreateSearchConfigRequest searchConfig. */ + public searchConfig?: (google.cloud.visionai.v1alpha1.ISearchConfig|null); + + /** CreateSearchConfigRequest searchConfigId. */ + public searchConfigId: string; + + /** + * Creates a new CreateSearchConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateSearchConfigRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.ICreateSearchConfigRequest): google.cloud.visionai.v1alpha1.CreateSearchConfigRequest; + + /** + * Encodes the specified CreateSearchConfigRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateSearchConfigRequest.verify|verify} messages. + * @param message CreateSearchConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.ICreateSearchConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateSearchConfigRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateSearchConfigRequest.verify|verify} messages. + * @param message CreateSearchConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.ICreateSearchConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateSearchConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateSearchConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.CreateSearchConfigRequest; + + /** + * Decodes a CreateSearchConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateSearchConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.CreateSearchConfigRequest; + + /** + * Verifies a CreateSearchConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateSearchConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateSearchConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.CreateSearchConfigRequest; + + /** + * Creates a plain object from a CreateSearchConfigRequest message. Also converts values to other types if specified. + * @param message CreateSearchConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.CreateSearchConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateSearchConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateSearchConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateSearchConfigRequest. */ + interface IUpdateSearchConfigRequest { + + /** UpdateSearchConfigRequest searchConfig */ + searchConfig?: (google.cloud.visionai.v1alpha1.ISearchConfig|null); + + /** UpdateSearchConfigRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateSearchConfigRequest. */ + class UpdateSearchConfigRequest implements IUpdateSearchConfigRequest { + + /** + * Constructs a new UpdateSearchConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IUpdateSearchConfigRequest); + + /** UpdateSearchConfigRequest searchConfig. */ + public searchConfig?: (google.cloud.visionai.v1alpha1.ISearchConfig|null); + + /** UpdateSearchConfigRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateSearchConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateSearchConfigRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IUpdateSearchConfigRequest): google.cloud.visionai.v1alpha1.UpdateSearchConfigRequest; + + /** + * Encodes the specified UpdateSearchConfigRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateSearchConfigRequest.verify|verify} messages. + * @param message UpdateSearchConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IUpdateSearchConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateSearchConfigRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateSearchConfigRequest.verify|verify} messages. + * @param message UpdateSearchConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IUpdateSearchConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateSearchConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateSearchConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.UpdateSearchConfigRequest; + + /** + * Decodes an UpdateSearchConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateSearchConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.UpdateSearchConfigRequest; + + /** + * Verifies an UpdateSearchConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateSearchConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateSearchConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.UpdateSearchConfigRequest; + + /** + * Creates a plain object from an UpdateSearchConfigRequest message. Also converts values to other types if specified. + * @param message UpdateSearchConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.UpdateSearchConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateSearchConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateSearchConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetSearchConfigRequest. */ + interface IGetSearchConfigRequest { + + /** GetSearchConfigRequest name */ + name?: (string|null); + } + + /** Represents a GetSearchConfigRequest. */ + class GetSearchConfigRequest implements IGetSearchConfigRequest { + + /** + * Constructs a new GetSearchConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IGetSearchConfigRequest); + + /** GetSearchConfigRequest name. */ + public name: string; + + /** + * Creates a new GetSearchConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSearchConfigRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IGetSearchConfigRequest): google.cloud.visionai.v1alpha1.GetSearchConfigRequest; + + /** + * Encodes the specified GetSearchConfigRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetSearchConfigRequest.verify|verify} messages. + * @param message GetSearchConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IGetSearchConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSearchConfigRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetSearchConfigRequest.verify|verify} messages. + * @param message GetSearchConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IGetSearchConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSearchConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSearchConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.GetSearchConfigRequest; + + /** + * Decodes a GetSearchConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSearchConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.GetSearchConfigRequest; + + /** + * Verifies a GetSearchConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetSearchConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSearchConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.GetSearchConfigRequest; + + /** + * Creates a plain object from a GetSearchConfigRequest message. Also converts values to other types if specified. + * @param message GetSearchConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.GetSearchConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSearchConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetSearchConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteSearchConfigRequest. */ + interface IDeleteSearchConfigRequest { + + /** DeleteSearchConfigRequest name */ + name?: (string|null); + } + + /** Represents a DeleteSearchConfigRequest. */ + class DeleteSearchConfigRequest implements IDeleteSearchConfigRequest { + + /** + * Constructs a new DeleteSearchConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IDeleteSearchConfigRequest); + + /** DeleteSearchConfigRequest name. */ + public name: string; + + /** + * Creates a new DeleteSearchConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteSearchConfigRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IDeleteSearchConfigRequest): google.cloud.visionai.v1alpha1.DeleteSearchConfigRequest; + + /** + * Encodes the specified DeleteSearchConfigRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteSearchConfigRequest.verify|verify} messages. + * @param message DeleteSearchConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IDeleteSearchConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteSearchConfigRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteSearchConfigRequest.verify|verify} messages. + * @param message DeleteSearchConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IDeleteSearchConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteSearchConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteSearchConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.DeleteSearchConfigRequest; + + /** + * Decodes a DeleteSearchConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteSearchConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.DeleteSearchConfigRequest; + + /** + * Verifies a DeleteSearchConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteSearchConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteSearchConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.DeleteSearchConfigRequest; + + /** + * Creates a plain object from a DeleteSearchConfigRequest message. Also converts values to other types if specified. + * @param message DeleteSearchConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.DeleteSearchConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteSearchConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteSearchConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSearchConfigsRequest. */ + interface IListSearchConfigsRequest { + + /** ListSearchConfigsRequest parent */ + parent?: (string|null); + + /** ListSearchConfigsRequest pageSize */ + pageSize?: (number|null); + + /** ListSearchConfigsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListSearchConfigsRequest. */ + class ListSearchConfigsRequest implements IListSearchConfigsRequest { + + /** + * Constructs a new ListSearchConfigsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IListSearchConfigsRequest); + + /** ListSearchConfigsRequest parent. */ + public parent: string; + + /** ListSearchConfigsRequest pageSize. */ + public pageSize: number; + + /** ListSearchConfigsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListSearchConfigsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSearchConfigsRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IListSearchConfigsRequest): google.cloud.visionai.v1alpha1.ListSearchConfigsRequest; + + /** + * Encodes the specified ListSearchConfigsRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListSearchConfigsRequest.verify|verify} messages. + * @param message ListSearchConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IListSearchConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSearchConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListSearchConfigsRequest.verify|verify} messages. + * @param message ListSearchConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IListSearchConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSearchConfigsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSearchConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ListSearchConfigsRequest; + + /** + * Decodes a ListSearchConfigsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSearchConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ListSearchConfigsRequest; + + /** + * Verifies a ListSearchConfigsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSearchConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSearchConfigsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ListSearchConfigsRequest; + + /** + * Creates a plain object from a ListSearchConfigsRequest message. Also converts values to other types if specified. + * @param message ListSearchConfigsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ListSearchConfigsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSearchConfigsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSearchConfigsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSearchConfigsResponse. */ + interface IListSearchConfigsResponse { + + /** ListSearchConfigsResponse searchConfigs */ + searchConfigs?: (google.cloud.visionai.v1alpha1.ISearchConfig[]|null); + + /** ListSearchConfigsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListSearchConfigsResponse. */ + class ListSearchConfigsResponse implements IListSearchConfigsResponse { + + /** + * Constructs a new ListSearchConfigsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IListSearchConfigsResponse); + + /** ListSearchConfigsResponse searchConfigs. */ + public searchConfigs: google.cloud.visionai.v1alpha1.ISearchConfig[]; + + /** ListSearchConfigsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListSearchConfigsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSearchConfigsResponse instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IListSearchConfigsResponse): google.cloud.visionai.v1alpha1.ListSearchConfigsResponse; + + /** + * Encodes the specified ListSearchConfigsResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListSearchConfigsResponse.verify|verify} messages. + * @param message ListSearchConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IListSearchConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSearchConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListSearchConfigsResponse.verify|verify} messages. + * @param message ListSearchConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IListSearchConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSearchConfigsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSearchConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ListSearchConfigsResponse; + + /** + * Decodes a ListSearchConfigsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSearchConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ListSearchConfigsResponse; + + /** + * Verifies a ListSearchConfigsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSearchConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSearchConfigsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ListSearchConfigsResponse; + + /** + * Creates a plain object from a ListSearchConfigsResponse message. Also converts values to other types if specified. + * @param message ListSearchConfigsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ListSearchConfigsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSearchConfigsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSearchConfigsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchConfig. */ + interface ISearchConfig { + + /** SearchConfig name */ + name?: (string|null); + + /** SearchConfig facetProperty */ + facetProperty?: (google.cloud.visionai.v1alpha1.IFacetProperty|null); + + /** SearchConfig searchCriteriaProperty */ + searchCriteriaProperty?: (google.cloud.visionai.v1alpha1.ISearchCriteriaProperty|null); + } + + /** Represents a SearchConfig. */ + class SearchConfig implements ISearchConfig { + + /** + * Constructs a new SearchConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.ISearchConfig); + + /** SearchConfig name. */ + public name: string; + + /** SearchConfig facetProperty. */ + public facetProperty?: (google.cloud.visionai.v1alpha1.IFacetProperty|null); + + /** SearchConfig searchCriteriaProperty. */ + public searchCriteriaProperty?: (google.cloud.visionai.v1alpha1.ISearchCriteriaProperty|null); + + /** + * Creates a new SearchConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchConfig instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.ISearchConfig): google.cloud.visionai.v1alpha1.SearchConfig; + + /** + * Encodes the specified SearchConfig message. Does not implicitly {@link google.cloud.visionai.v1alpha1.SearchConfig.verify|verify} messages. + * @param message SearchConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.ISearchConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchConfig message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.SearchConfig.verify|verify} messages. + * @param message SearchConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.ISearchConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.SearchConfig; + + /** + * Decodes a SearchConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.SearchConfig; + + /** + * Verifies a SearchConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.SearchConfig; + + /** + * Creates a plain object from a SearchConfig message. Also converts values to other types if specified. + * @param message SearchConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.SearchConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FacetProperty. */ + interface IFacetProperty { + + /** FacetProperty fixedRangeBucketSpec */ + fixedRangeBucketSpec?: (google.cloud.visionai.v1alpha1.FacetProperty.IFixedRangeBucketSpec|null); + + /** FacetProperty customRangeBucketSpec */ + customRangeBucketSpec?: (google.cloud.visionai.v1alpha1.FacetProperty.ICustomRangeBucketSpec|null); + + /** FacetProperty datetimeBucketSpec */ + datetimeBucketSpec?: (google.cloud.visionai.v1alpha1.FacetProperty.IDateTimeBucketSpec|null); + + /** FacetProperty mappedFields */ + mappedFields?: (string[]|null); + + /** FacetProperty displayName */ + displayName?: (string|null); + + /** FacetProperty resultSize */ + resultSize?: (number|Long|string|null); + + /** FacetProperty bucketType */ + bucketType?: (google.cloud.visionai.v1alpha1.FacetBucketType|keyof typeof google.cloud.visionai.v1alpha1.FacetBucketType|null); + } + + /** Represents a FacetProperty. */ + class FacetProperty implements IFacetProperty { + + /** + * Constructs a new FacetProperty. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IFacetProperty); + + /** FacetProperty fixedRangeBucketSpec. */ + public fixedRangeBucketSpec?: (google.cloud.visionai.v1alpha1.FacetProperty.IFixedRangeBucketSpec|null); + + /** FacetProperty customRangeBucketSpec. */ + public customRangeBucketSpec?: (google.cloud.visionai.v1alpha1.FacetProperty.ICustomRangeBucketSpec|null); + + /** FacetProperty datetimeBucketSpec. */ + public datetimeBucketSpec?: (google.cloud.visionai.v1alpha1.FacetProperty.IDateTimeBucketSpec|null); + + /** FacetProperty mappedFields. */ + public mappedFields: string[]; + + /** FacetProperty displayName. */ + public displayName: string; + + /** FacetProperty resultSize. */ + public resultSize: (number|Long|string); + + /** FacetProperty bucketType. */ + public bucketType: (google.cloud.visionai.v1alpha1.FacetBucketType|keyof typeof google.cloud.visionai.v1alpha1.FacetBucketType); + + /** FacetProperty rangeFacetConfig. */ + public rangeFacetConfig?: ("fixedRangeBucketSpec"|"customRangeBucketSpec"|"datetimeBucketSpec"); + + /** + * Creates a new FacetProperty instance using the specified properties. + * @param [properties] Properties to set + * @returns FacetProperty instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IFacetProperty): google.cloud.visionai.v1alpha1.FacetProperty; + + /** + * Encodes the specified FacetProperty message. Does not implicitly {@link google.cloud.visionai.v1alpha1.FacetProperty.verify|verify} messages. + * @param message FacetProperty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IFacetProperty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FacetProperty message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.FacetProperty.verify|verify} messages. + * @param message FacetProperty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IFacetProperty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FacetProperty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FacetProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.FacetProperty; + + /** + * Decodes a FacetProperty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FacetProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.FacetProperty; + + /** + * Verifies a FacetProperty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FacetProperty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FacetProperty + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.FacetProperty; + + /** + * Creates a plain object from a FacetProperty message. Also converts values to other types if specified. + * @param message FacetProperty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.FacetProperty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FacetProperty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FacetProperty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FacetProperty { + + /** Properties of a FixedRangeBucketSpec. */ + interface IFixedRangeBucketSpec { + + /** FixedRangeBucketSpec bucketStart */ + bucketStart?: (google.cloud.visionai.v1alpha1.IFacetValue|null); + + /** FixedRangeBucketSpec bucketGranularity */ + bucketGranularity?: (google.cloud.visionai.v1alpha1.IFacetValue|null); + + /** FixedRangeBucketSpec bucketCount */ + bucketCount?: (number|null); + } + + /** Represents a FixedRangeBucketSpec. */ + class FixedRangeBucketSpec implements IFixedRangeBucketSpec { + + /** + * Constructs a new FixedRangeBucketSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.FacetProperty.IFixedRangeBucketSpec); + + /** FixedRangeBucketSpec bucketStart. */ + public bucketStart?: (google.cloud.visionai.v1alpha1.IFacetValue|null); + + /** FixedRangeBucketSpec bucketGranularity. */ + public bucketGranularity?: (google.cloud.visionai.v1alpha1.IFacetValue|null); + + /** FixedRangeBucketSpec bucketCount. */ + public bucketCount: number; + + /** + * Creates a new FixedRangeBucketSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedRangeBucketSpec instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.FacetProperty.IFixedRangeBucketSpec): google.cloud.visionai.v1alpha1.FacetProperty.FixedRangeBucketSpec; + + /** + * Encodes the specified FixedRangeBucketSpec message. Does not implicitly {@link google.cloud.visionai.v1alpha1.FacetProperty.FixedRangeBucketSpec.verify|verify} messages. + * @param message FixedRangeBucketSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.FacetProperty.IFixedRangeBucketSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FixedRangeBucketSpec message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.FacetProperty.FixedRangeBucketSpec.verify|verify} messages. + * @param message FixedRangeBucketSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.FacetProperty.IFixedRangeBucketSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedRangeBucketSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FixedRangeBucketSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.FacetProperty.FixedRangeBucketSpec; + + /** + * Decodes a FixedRangeBucketSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FixedRangeBucketSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.FacetProperty.FixedRangeBucketSpec; + + /** + * Verifies a FixedRangeBucketSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FixedRangeBucketSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FixedRangeBucketSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.FacetProperty.FixedRangeBucketSpec; + + /** + * Creates a plain object from a FixedRangeBucketSpec message. Also converts values to other types if specified. + * @param message FixedRangeBucketSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.FacetProperty.FixedRangeBucketSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FixedRangeBucketSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FixedRangeBucketSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomRangeBucketSpec. */ + interface ICustomRangeBucketSpec { + + /** CustomRangeBucketSpec endpoints */ + endpoints?: (google.cloud.visionai.v1alpha1.IFacetValue[]|null); + } + + /** Represents a CustomRangeBucketSpec. */ + class CustomRangeBucketSpec implements ICustomRangeBucketSpec { + + /** + * Constructs a new CustomRangeBucketSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.FacetProperty.ICustomRangeBucketSpec); + + /** CustomRangeBucketSpec endpoints. */ + public endpoints: google.cloud.visionai.v1alpha1.IFacetValue[]; + + /** + * Creates a new CustomRangeBucketSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomRangeBucketSpec instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.FacetProperty.ICustomRangeBucketSpec): google.cloud.visionai.v1alpha1.FacetProperty.CustomRangeBucketSpec; + + /** + * Encodes the specified CustomRangeBucketSpec message. Does not implicitly {@link google.cloud.visionai.v1alpha1.FacetProperty.CustomRangeBucketSpec.verify|verify} messages. + * @param message CustomRangeBucketSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.FacetProperty.ICustomRangeBucketSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomRangeBucketSpec message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.FacetProperty.CustomRangeBucketSpec.verify|verify} messages. + * @param message CustomRangeBucketSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.FacetProperty.ICustomRangeBucketSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomRangeBucketSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomRangeBucketSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.FacetProperty.CustomRangeBucketSpec; + + /** + * Decodes a CustomRangeBucketSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomRangeBucketSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.FacetProperty.CustomRangeBucketSpec; + + /** + * Verifies a CustomRangeBucketSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomRangeBucketSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomRangeBucketSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.FacetProperty.CustomRangeBucketSpec; + + /** + * Creates a plain object from a CustomRangeBucketSpec message. Also converts values to other types if specified. + * @param message CustomRangeBucketSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.FacetProperty.CustomRangeBucketSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomRangeBucketSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomRangeBucketSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DateTimeBucketSpec. */ + interface IDateTimeBucketSpec { + + /** DateTimeBucketSpec granularity */ + granularity?: (google.cloud.visionai.v1alpha1.FacetProperty.DateTimeBucketSpec.Granularity|keyof typeof google.cloud.visionai.v1alpha1.FacetProperty.DateTimeBucketSpec.Granularity|null); + } + + /** Represents a DateTimeBucketSpec. */ + class DateTimeBucketSpec implements IDateTimeBucketSpec { + + /** + * Constructs a new DateTimeBucketSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.FacetProperty.IDateTimeBucketSpec); + + /** DateTimeBucketSpec granularity. */ + public granularity: (google.cloud.visionai.v1alpha1.FacetProperty.DateTimeBucketSpec.Granularity|keyof typeof google.cloud.visionai.v1alpha1.FacetProperty.DateTimeBucketSpec.Granularity); + + /** + * Creates a new DateTimeBucketSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns DateTimeBucketSpec instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.FacetProperty.IDateTimeBucketSpec): google.cloud.visionai.v1alpha1.FacetProperty.DateTimeBucketSpec; + + /** + * Encodes the specified DateTimeBucketSpec message. Does not implicitly {@link google.cloud.visionai.v1alpha1.FacetProperty.DateTimeBucketSpec.verify|verify} messages. + * @param message DateTimeBucketSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.FacetProperty.IDateTimeBucketSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DateTimeBucketSpec message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.FacetProperty.DateTimeBucketSpec.verify|verify} messages. + * @param message DateTimeBucketSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.FacetProperty.IDateTimeBucketSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DateTimeBucketSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DateTimeBucketSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.FacetProperty.DateTimeBucketSpec; + + /** + * Decodes a DateTimeBucketSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DateTimeBucketSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.FacetProperty.DateTimeBucketSpec; + + /** + * Verifies a DateTimeBucketSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DateTimeBucketSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DateTimeBucketSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.FacetProperty.DateTimeBucketSpec; + + /** + * Creates a plain object from a DateTimeBucketSpec message. Also converts values to other types if specified. + * @param message DateTimeBucketSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.FacetProperty.DateTimeBucketSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DateTimeBucketSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DateTimeBucketSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DateTimeBucketSpec { + + /** Granularity enum. */ + enum Granularity { + GRANULARITY_UNSPECIFIED = 0, + YEAR = 1, + MONTH = 2, + DAY = 3 + } + } + } + + /** Properties of a SearchCriteriaProperty. */ + interface ISearchCriteriaProperty { + + /** SearchCriteriaProperty mappedFields */ + mappedFields?: (string[]|null); + } + + /** Represents a SearchCriteriaProperty. */ + class SearchCriteriaProperty implements ISearchCriteriaProperty { + + /** + * Constructs a new SearchCriteriaProperty. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.ISearchCriteriaProperty); + + /** SearchCriteriaProperty mappedFields. */ + public mappedFields: string[]; + + /** + * Creates a new SearchCriteriaProperty instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchCriteriaProperty instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.ISearchCriteriaProperty): google.cloud.visionai.v1alpha1.SearchCriteriaProperty; + + /** + * Encodes the specified SearchCriteriaProperty message. Does not implicitly {@link google.cloud.visionai.v1alpha1.SearchCriteriaProperty.verify|verify} messages. + * @param message SearchCriteriaProperty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.ISearchCriteriaProperty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchCriteriaProperty message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.SearchCriteriaProperty.verify|verify} messages. + * @param message SearchCriteriaProperty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.ISearchCriteriaProperty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchCriteriaProperty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchCriteriaProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.SearchCriteriaProperty; + + /** + * Decodes a SearchCriteriaProperty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchCriteriaProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.SearchCriteriaProperty; + + /** + * Verifies a SearchCriteriaProperty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchCriteriaProperty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchCriteriaProperty + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.SearchCriteriaProperty; + + /** + * Creates a plain object from a SearchCriteriaProperty message. Also converts values to other types if specified. + * @param message SearchCriteriaProperty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.SearchCriteriaProperty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchCriteriaProperty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchCriteriaProperty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FacetValue. */ + interface IFacetValue { + + /** FacetValue stringValue */ + stringValue?: (string|null); + + /** FacetValue integerValue */ + integerValue?: (number|Long|string|null); + + /** FacetValue datetimeValue */ + datetimeValue?: (google.type.IDateTime|null); + } + + /** Represents a FacetValue. */ + class FacetValue implements IFacetValue { + + /** + * Constructs a new FacetValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IFacetValue); + + /** FacetValue stringValue. */ + public stringValue?: (string|null); + + /** FacetValue integerValue. */ + public integerValue?: (number|Long|string|null); + + /** FacetValue datetimeValue. */ + public datetimeValue?: (google.type.IDateTime|null); + + /** FacetValue value. */ + public value?: ("stringValue"|"integerValue"|"datetimeValue"); + + /** + * Creates a new FacetValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FacetValue instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IFacetValue): google.cloud.visionai.v1alpha1.FacetValue; + + /** + * Encodes the specified FacetValue message. Does not implicitly {@link google.cloud.visionai.v1alpha1.FacetValue.verify|verify} messages. + * @param message FacetValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IFacetValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FacetValue message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.FacetValue.verify|verify} messages. + * @param message FacetValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IFacetValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FacetValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FacetValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.FacetValue; + + /** + * Decodes a FacetValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FacetValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.FacetValue; + + /** + * Verifies a FacetValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FacetValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FacetValue + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.FacetValue; + + /** + * Creates a plain object from a FacetValue message. Also converts values to other types if specified. + * @param message FacetValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.FacetValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FacetValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FacetValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FacetBucket. */ + interface IFacetBucket { + + /** FacetBucket value */ + value?: (google.cloud.visionai.v1alpha1.IFacetValue|null); + + /** FacetBucket range */ + range?: (google.cloud.visionai.v1alpha1.FacetBucket.IRange|null); + + /** FacetBucket selected */ + selected?: (boolean|null); + } + + /** Represents a FacetBucket. */ + class FacetBucket implements IFacetBucket { + + /** + * Constructs a new FacetBucket. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IFacetBucket); + + /** FacetBucket value. */ + public value?: (google.cloud.visionai.v1alpha1.IFacetValue|null); + + /** FacetBucket range. */ + public range?: (google.cloud.visionai.v1alpha1.FacetBucket.IRange|null); + + /** FacetBucket selected. */ + public selected: boolean; + + /** FacetBucket bucketValue. */ + public bucketValue?: ("value"|"range"); + + /** + * Creates a new FacetBucket instance using the specified properties. + * @param [properties] Properties to set + * @returns FacetBucket instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IFacetBucket): google.cloud.visionai.v1alpha1.FacetBucket; + + /** + * Encodes the specified FacetBucket message. Does not implicitly {@link google.cloud.visionai.v1alpha1.FacetBucket.verify|verify} messages. + * @param message FacetBucket message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IFacetBucket, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FacetBucket message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.FacetBucket.verify|verify} messages. + * @param message FacetBucket message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IFacetBucket, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FacetBucket message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FacetBucket + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.FacetBucket; + + /** + * Decodes a FacetBucket message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FacetBucket + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.FacetBucket; + + /** + * Verifies a FacetBucket message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FacetBucket message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FacetBucket + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.FacetBucket; + + /** + * Creates a plain object from a FacetBucket message. Also converts values to other types if specified. + * @param message FacetBucket + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.FacetBucket, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FacetBucket to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FacetBucket + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FacetBucket { + + /** Properties of a Range. */ + interface IRange { + + /** Range start */ + start?: (google.cloud.visionai.v1alpha1.IFacetValue|null); + + /** Range end */ + end?: (google.cloud.visionai.v1alpha1.IFacetValue|null); + } + + /** Represents a Range. */ + class Range implements IRange { + + /** + * Constructs a new Range. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.FacetBucket.IRange); + + /** Range start. */ + public start?: (google.cloud.visionai.v1alpha1.IFacetValue|null); + + /** Range end. */ + public end?: (google.cloud.visionai.v1alpha1.IFacetValue|null); + + /** + * Creates a new Range instance using the specified properties. + * @param [properties] Properties to set + * @returns Range instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.FacetBucket.IRange): google.cloud.visionai.v1alpha1.FacetBucket.Range; + + /** + * Encodes the specified Range message. Does not implicitly {@link google.cloud.visionai.v1alpha1.FacetBucket.Range.verify|verify} messages. + * @param message Range message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.FacetBucket.IRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Range message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.FacetBucket.Range.verify|verify} messages. + * @param message Range message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.FacetBucket.IRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Range message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Range + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.FacetBucket.Range; + + /** + * Decodes a Range message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Range + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.FacetBucket.Range; + + /** + * Verifies a Range message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Range message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Range + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.FacetBucket.Range; + + /** + * Creates a plain object from a Range message. Also converts values to other types if specified. + * @param message Range + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.FacetBucket.Range, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Range to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Range + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a FacetGroup. */ + interface IFacetGroup { + + /** FacetGroup facetId */ + facetId?: (string|null); + + /** FacetGroup displayName */ + displayName?: (string|null); + + /** FacetGroup buckets */ + buckets?: (google.cloud.visionai.v1alpha1.IFacetBucket[]|null); + + /** FacetGroup bucketType */ + bucketType?: (google.cloud.visionai.v1alpha1.FacetBucketType|keyof typeof google.cloud.visionai.v1alpha1.FacetBucketType|null); + + /** FacetGroup fetchMatchedAnnotations */ + fetchMatchedAnnotations?: (boolean|null); + } + + /** Represents a FacetGroup. */ + class FacetGroup implements IFacetGroup { + + /** + * Constructs a new FacetGroup. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IFacetGroup); + + /** FacetGroup facetId. */ + public facetId: string; + + /** FacetGroup displayName. */ + public displayName: string; + + /** FacetGroup buckets. */ + public buckets: google.cloud.visionai.v1alpha1.IFacetBucket[]; + + /** FacetGroup bucketType. */ + public bucketType: (google.cloud.visionai.v1alpha1.FacetBucketType|keyof typeof google.cloud.visionai.v1alpha1.FacetBucketType); + + /** FacetGroup fetchMatchedAnnotations. */ + public fetchMatchedAnnotations: boolean; + + /** + * Creates a new FacetGroup instance using the specified properties. + * @param [properties] Properties to set + * @returns FacetGroup instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IFacetGroup): google.cloud.visionai.v1alpha1.FacetGroup; + + /** + * Encodes the specified FacetGroup message. Does not implicitly {@link google.cloud.visionai.v1alpha1.FacetGroup.verify|verify} messages. + * @param message FacetGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IFacetGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FacetGroup message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.FacetGroup.verify|verify} messages. + * @param message FacetGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IFacetGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FacetGroup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FacetGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.FacetGroup; + + /** + * Decodes a FacetGroup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FacetGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.FacetGroup; + + /** + * Verifies a FacetGroup message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FacetGroup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FacetGroup + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.FacetGroup; + + /** + * Creates a plain object from a FacetGroup message. Also converts values to other types if specified. + * @param message FacetGroup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.FacetGroup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FacetGroup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FacetGroup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IngestAssetRequest. */ + interface IIngestAssetRequest { + + /** IngestAssetRequest config */ + config?: (google.cloud.visionai.v1alpha1.IngestAssetRequest.IConfig|null); + + /** IngestAssetRequest timeIndexedData */ + timeIndexedData?: (google.cloud.visionai.v1alpha1.IngestAssetRequest.ITimeIndexedData|null); + } + + /** Represents an IngestAssetRequest. */ + class IngestAssetRequest implements IIngestAssetRequest { + + /** + * Constructs a new IngestAssetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IIngestAssetRequest); + + /** IngestAssetRequest config. */ + public config?: (google.cloud.visionai.v1alpha1.IngestAssetRequest.IConfig|null); + + /** IngestAssetRequest timeIndexedData. */ + public timeIndexedData?: (google.cloud.visionai.v1alpha1.IngestAssetRequest.ITimeIndexedData|null); + + /** IngestAssetRequest streamingRequest. */ + public streamingRequest?: ("config"|"timeIndexedData"); + + /** + * Creates a new IngestAssetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns IngestAssetRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IIngestAssetRequest): google.cloud.visionai.v1alpha1.IngestAssetRequest; + + /** + * Encodes the specified IngestAssetRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.IngestAssetRequest.verify|verify} messages. + * @param message IngestAssetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IIngestAssetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IngestAssetRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.IngestAssetRequest.verify|verify} messages. + * @param message IngestAssetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IIngestAssetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IngestAssetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IngestAssetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.IngestAssetRequest; + + /** + * Decodes an IngestAssetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IngestAssetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.IngestAssetRequest; + + /** + * Verifies an IngestAssetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an IngestAssetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IngestAssetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.IngestAssetRequest; + + /** + * Creates a plain object from an IngestAssetRequest message. Also converts values to other types if specified. + * @param message IngestAssetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.IngestAssetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IngestAssetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IngestAssetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace IngestAssetRequest { + + /** Properties of a Config. */ + interface IConfig { + + /** Config videoType */ + videoType?: (google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.IVideoType|null); + + /** Config asset */ + asset?: (string|null); + } + + /** Represents a Config. */ + class Config implements IConfig { + + /** + * Constructs a new Config. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IngestAssetRequest.IConfig); + + /** Config videoType. */ + public videoType?: (google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.IVideoType|null); + + /** Config asset. */ + public asset: string; + + /** Config dataType. */ + public dataType?: "videoType"; + + /** + * Creates a new Config instance using the specified properties. + * @param [properties] Properties to set + * @returns Config instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IngestAssetRequest.IConfig): google.cloud.visionai.v1alpha1.IngestAssetRequest.Config; + + /** + * Encodes the specified Config message. Does not implicitly {@link google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.verify|verify} messages. + * @param message Config message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IngestAssetRequest.IConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Config message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.verify|verify} messages. + * @param message Config message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IngestAssetRequest.IConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Config message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Config + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.IngestAssetRequest.Config; + + /** + * Decodes a Config message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Config + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.IngestAssetRequest.Config; + + /** + * Verifies a Config message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Config message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Config + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.IngestAssetRequest.Config; + + /** + * Creates a plain object from a Config message. Also converts values to other types if specified. + * @param message Config + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.IngestAssetRequest.Config, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Config to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Config + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Config { + + /** Properties of a VideoType. */ + interface IVideoType { + + /** VideoType containerFormat */ + containerFormat?: (google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.VideoType.ContainerFormat|keyof typeof google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.VideoType.ContainerFormat|null); + } + + /** Represents a VideoType. */ + class VideoType implements IVideoType { + + /** + * Constructs a new VideoType. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.IVideoType); + + /** VideoType containerFormat. */ + public containerFormat: (google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.VideoType.ContainerFormat|keyof typeof google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.VideoType.ContainerFormat); + + /** + * Creates a new VideoType instance using the specified properties. + * @param [properties] Properties to set + * @returns VideoType instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.IVideoType): google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.VideoType; + + /** + * Encodes the specified VideoType message. Does not implicitly {@link google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.VideoType.verify|verify} messages. + * @param message VideoType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.IVideoType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VideoType message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.VideoType.verify|verify} messages. + * @param message VideoType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.IVideoType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VideoType message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VideoType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.VideoType; + + /** + * Decodes a VideoType message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VideoType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.VideoType; + + /** + * Verifies a VideoType message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VideoType message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VideoType + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.VideoType; + + /** + * Creates a plain object from a VideoType message. Also converts values to other types if specified. + * @param message VideoType + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.VideoType, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VideoType to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VideoType + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace VideoType { + + /** ContainerFormat enum. */ + enum ContainerFormat { + CONTAINER_FORMAT_UNSPECIFIED = 0, + CONTAINER_FORMAT_MP4 = 1 + } + } + } + + /** Properties of a TimeIndexedData. */ + interface ITimeIndexedData { + + /** TimeIndexedData data */ + data?: (Uint8Array|Buffer|string|null); + + /** TimeIndexedData temporalPartition */ + temporalPartition?: (google.cloud.visionai.v1alpha1.Partition.ITemporalPartition|null); + } + + /** Represents a TimeIndexedData. */ + class TimeIndexedData implements ITimeIndexedData { + + /** + * Constructs a new TimeIndexedData. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IngestAssetRequest.ITimeIndexedData); + + /** TimeIndexedData data. */ + public data: (Uint8Array|Buffer|string); + + /** TimeIndexedData temporalPartition. */ + public temporalPartition?: (google.cloud.visionai.v1alpha1.Partition.ITemporalPartition|null); + + /** + * Creates a new TimeIndexedData instance using the specified properties. + * @param [properties] Properties to set + * @returns TimeIndexedData instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IngestAssetRequest.ITimeIndexedData): google.cloud.visionai.v1alpha1.IngestAssetRequest.TimeIndexedData; + + /** + * Encodes the specified TimeIndexedData message. Does not implicitly {@link google.cloud.visionai.v1alpha1.IngestAssetRequest.TimeIndexedData.verify|verify} messages. + * @param message TimeIndexedData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IngestAssetRequest.ITimeIndexedData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimeIndexedData message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.IngestAssetRequest.TimeIndexedData.verify|verify} messages. + * @param message TimeIndexedData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IngestAssetRequest.ITimeIndexedData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimeIndexedData message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimeIndexedData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.IngestAssetRequest.TimeIndexedData; + + /** + * Decodes a TimeIndexedData message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimeIndexedData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.IngestAssetRequest.TimeIndexedData; + + /** + * Verifies a TimeIndexedData message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TimeIndexedData message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimeIndexedData + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.IngestAssetRequest.TimeIndexedData; + + /** + * Creates a plain object from a TimeIndexedData message. Also converts values to other types if specified. + * @param message TimeIndexedData + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.IngestAssetRequest.TimeIndexedData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimeIndexedData to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TimeIndexedData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an IngestAssetResponse. */ + interface IIngestAssetResponse { + + /** IngestAssetResponse successfullyIngestedPartition */ + successfullyIngestedPartition?: (google.cloud.visionai.v1alpha1.Partition.ITemporalPartition|null); + } + + /** Represents an IngestAssetResponse. */ + class IngestAssetResponse implements IIngestAssetResponse { + + /** + * Constructs a new IngestAssetResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IIngestAssetResponse); + + /** IngestAssetResponse successfullyIngestedPartition. */ + public successfullyIngestedPartition?: (google.cloud.visionai.v1alpha1.Partition.ITemporalPartition|null); + + /** + * Creates a new IngestAssetResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns IngestAssetResponse instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IIngestAssetResponse): google.cloud.visionai.v1alpha1.IngestAssetResponse; + + /** + * Encodes the specified IngestAssetResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.IngestAssetResponse.verify|verify} messages. + * @param message IngestAssetResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IIngestAssetResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IngestAssetResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.IngestAssetResponse.verify|verify} messages. + * @param message IngestAssetResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IIngestAssetResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IngestAssetResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IngestAssetResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.IngestAssetResponse; + + /** + * Decodes an IngestAssetResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IngestAssetResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.IngestAssetResponse; + + /** + * Verifies an IngestAssetResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an IngestAssetResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IngestAssetResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.IngestAssetResponse; + + /** + * Creates a plain object from an IngestAssetResponse message. Also converts values to other types if specified. + * @param message IngestAssetResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.IngestAssetResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IngestAssetResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IngestAssetResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClipAssetRequest. */ + interface IClipAssetRequest { + + /** ClipAssetRequest name */ + name?: (string|null); + + /** ClipAssetRequest temporalPartition */ + temporalPartition?: (google.cloud.visionai.v1alpha1.Partition.ITemporalPartition|null); + } + + /** Represents a ClipAssetRequest. */ + class ClipAssetRequest implements IClipAssetRequest { + + /** + * Constructs a new ClipAssetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IClipAssetRequest); + + /** ClipAssetRequest name. */ + public name: string; + + /** ClipAssetRequest temporalPartition. */ + public temporalPartition?: (google.cloud.visionai.v1alpha1.Partition.ITemporalPartition|null); + + /** + * Creates a new ClipAssetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ClipAssetRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IClipAssetRequest): google.cloud.visionai.v1alpha1.ClipAssetRequest; + + /** + * Encodes the specified ClipAssetRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ClipAssetRequest.verify|verify} messages. + * @param message ClipAssetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IClipAssetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClipAssetRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ClipAssetRequest.verify|verify} messages. + * @param message ClipAssetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IClipAssetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClipAssetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClipAssetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ClipAssetRequest; + + /** + * Decodes a ClipAssetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClipAssetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ClipAssetRequest; + + /** + * Verifies a ClipAssetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClipAssetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClipAssetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ClipAssetRequest; + + /** + * Creates a plain object from a ClipAssetRequest message. Also converts values to other types if specified. + * @param message ClipAssetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ClipAssetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClipAssetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClipAssetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClipAssetResponse. */ + interface IClipAssetResponse { + + /** ClipAssetResponse timeIndexedUris */ + timeIndexedUris?: (google.cloud.visionai.v1alpha1.ClipAssetResponse.ITimeIndexedUri[]|null); + } + + /** Represents a ClipAssetResponse. */ + class ClipAssetResponse implements IClipAssetResponse { + + /** + * Constructs a new ClipAssetResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IClipAssetResponse); + + /** ClipAssetResponse timeIndexedUris. */ + public timeIndexedUris: google.cloud.visionai.v1alpha1.ClipAssetResponse.ITimeIndexedUri[]; + + /** + * Creates a new ClipAssetResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ClipAssetResponse instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IClipAssetResponse): google.cloud.visionai.v1alpha1.ClipAssetResponse; + + /** + * Encodes the specified ClipAssetResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ClipAssetResponse.verify|verify} messages. + * @param message ClipAssetResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IClipAssetResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClipAssetResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ClipAssetResponse.verify|verify} messages. + * @param message ClipAssetResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IClipAssetResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClipAssetResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClipAssetResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ClipAssetResponse; + + /** + * Decodes a ClipAssetResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClipAssetResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ClipAssetResponse; + + /** + * Verifies a ClipAssetResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClipAssetResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClipAssetResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ClipAssetResponse; + + /** + * Creates a plain object from a ClipAssetResponse message. Also converts values to other types if specified. + * @param message ClipAssetResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ClipAssetResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClipAssetResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClipAssetResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ClipAssetResponse { + + /** Properties of a TimeIndexedUri. */ + interface ITimeIndexedUri { + + /** TimeIndexedUri temporalPartition */ + temporalPartition?: (google.cloud.visionai.v1alpha1.Partition.ITemporalPartition|null); + + /** TimeIndexedUri uri */ + uri?: (string|null); + } + + /** Represents a TimeIndexedUri. */ + class TimeIndexedUri implements ITimeIndexedUri { + + /** + * Constructs a new TimeIndexedUri. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.ClipAssetResponse.ITimeIndexedUri); + + /** TimeIndexedUri temporalPartition. */ + public temporalPartition?: (google.cloud.visionai.v1alpha1.Partition.ITemporalPartition|null); + + /** TimeIndexedUri uri. */ + public uri: string; + + /** + * Creates a new TimeIndexedUri instance using the specified properties. + * @param [properties] Properties to set + * @returns TimeIndexedUri instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.ClipAssetResponse.ITimeIndexedUri): google.cloud.visionai.v1alpha1.ClipAssetResponse.TimeIndexedUri; + + /** + * Encodes the specified TimeIndexedUri message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ClipAssetResponse.TimeIndexedUri.verify|verify} messages. + * @param message TimeIndexedUri message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.ClipAssetResponse.ITimeIndexedUri, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimeIndexedUri message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ClipAssetResponse.TimeIndexedUri.verify|verify} messages. + * @param message TimeIndexedUri message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.ClipAssetResponse.ITimeIndexedUri, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimeIndexedUri message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimeIndexedUri + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.ClipAssetResponse.TimeIndexedUri; + + /** + * Decodes a TimeIndexedUri message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimeIndexedUri + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.ClipAssetResponse.TimeIndexedUri; + + /** + * Verifies a TimeIndexedUri message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TimeIndexedUri message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimeIndexedUri + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.ClipAssetResponse.TimeIndexedUri; + + /** + * Creates a plain object from a TimeIndexedUri message. Also converts values to other types if specified. + * @param message TimeIndexedUri + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.ClipAssetResponse.TimeIndexedUri, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimeIndexedUri to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TimeIndexedUri + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GenerateHlsUriRequest. */ + interface IGenerateHlsUriRequest { + + /** GenerateHlsUriRequest name */ + name?: (string|null); + + /** GenerateHlsUriRequest temporalPartitions */ + temporalPartitions?: (google.cloud.visionai.v1alpha1.Partition.ITemporalPartition[]|null); + } + + /** Represents a GenerateHlsUriRequest. */ + class GenerateHlsUriRequest implements IGenerateHlsUriRequest { + + /** + * Constructs a new GenerateHlsUriRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IGenerateHlsUriRequest); + + /** GenerateHlsUriRequest name. */ + public name: string; + + /** GenerateHlsUriRequest temporalPartitions. */ + public temporalPartitions: google.cloud.visionai.v1alpha1.Partition.ITemporalPartition[]; + + /** + * Creates a new GenerateHlsUriRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateHlsUriRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IGenerateHlsUriRequest): google.cloud.visionai.v1alpha1.GenerateHlsUriRequest; + + /** + * Encodes the specified GenerateHlsUriRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.GenerateHlsUriRequest.verify|verify} messages. + * @param message GenerateHlsUriRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IGenerateHlsUriRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateHlsUriRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.GenerateHlsUriRequest.verify|verify} messages. + * @param message GenerateHlsUriRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IGenerateHlsUriRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateHlsUriRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateHlsUriRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.GenerateHlsUriRequest; + + /** + * Decodes a GenerateHlsUriRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateHlsUriRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.GenerateHlsUriRequest; + + /** + * Verifies a GenerateHlsUriRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateHlsUriRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateHlsUriRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.GenerateHlsUriRequest; + + /** + * Creates a plain object from a GenerateHlsUriRequest message. Also converts values to other types if specified. + * @param message GenerateHlsUriRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.GenerateHlsUriRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateHlsUriRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateHlsUriRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GenerateHlsUriResponse. */ + interface IGenerateHlsUriResponse { + + /** GenerateHlsUriResponse uri */ + uri?: (string|null); + + /** GenerateHlsUriResponse temporalPartitions */ + temporalPartitions?: (google.cloud.visionai.v1alpha1.Partition.ITemporalPartition[]|null); + } + + /** Represents a GenerateHlsUriResponse. */ + class GenerateHlsUriResponse implements IGenerateHlsUriResponse { + + /** + * Constructs a new GenerateHlsUriResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IGenerateHlsUriResponse); + + /** GenerateHlsUriResponse uri. */ + public uri: string; + + /** GenerateHlsUriResponse temporalPartitions. */ + public temporalPartitions: google.cloud.visionai.v1alpha1.Partition.ITemporalPartition[]; + + /** + * Creates a new GenerateHlsUriResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateHlsUriResponse instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IGenerateHlsUriResponse): google.cloud.visionai.v1alpha1.GenerateHlsUriResponse; + + /** + * Encodes the specified GenerateHlsUriResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.GenerateHlsUriResponse.verify|verify} messages. + * @param message GenerateHlsUriResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IGenerateHlsUriResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateHlsUriResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.GenerateHlsUriResponse.verify|verify} messages. + * @param message GenerateHlsUriResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IGenerateHlsUriResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateHlsUriResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateHlsUriResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.GenerateHlsUriResponse; + + /** + * Decodes a GenerateHlsUriResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateHlsUriResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.GenerateHlsUriResponse; + + /** + * Verifies a GenerateHlsUriResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateHlsUriResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateHlsUriResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.GenerateHlsUriResponse; + + /** + * Creates a plain object from a GenerateHlsUriResponse message. Also converts values to other types if specified. + * @param message GenerateHlsUriResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.GenerateHlsUriResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateHlsUriResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateHlsUriResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchAssetsRequest. */ + interface ISearchAssetsRequest { + + /** SearchAssetsRequest corpus */ + corpus?: (string|null); + + /** SearchAssetsRequest pageSize */ + pageSize?: (number|null); + + /** SearchAssetsRequest pageToken */ + pageToken?: (string|null); + + /** SearchAssetsRequest contentTimeRanges */ + contentTimeRanges?: (google.cloud.visionai.v1alpha1.IDateTimeRangeArray|null); + + /** SearchAssetsRequest criteria */ + criteria?: (google.cloud.visionai.v1alpha1.ICriteria[]|null); + + /** SearchAssetsRequest facetSelections */ + facetSelections?: (google.cloud.visionai.v1alpha1.IFacetGroup[]|null); + + /** SearchAssetsRequest resultAnnotationKeys */ + resultAnnotationKeys?: (string[]|null); + } + + /** Represents a SearchAssetsRequest. */ + class SearchAssetsRequest implements ISearchAssetsRequest { + + /** + * Constructs a new SearchAssetsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.ISearchAssetsRequest); + + /** SearchAssetsRequest corpus. */ + public corpus: string; + + /** SearchAssetsRequest pageSize. */ + public pageSize: number; + + /** SearchAssetsRequest pageToken. */ + public pageToken: string; + + /** SearchAssetsRequest contentTimeRanges. */ + public contentTimeRanges?: (google.cloud.visionai.v1alpha1.IDateTimeRangeArray|null); + + /** SearchAssetsRequest criteria. */ + public criteria: google.cloud.visionai.v1alpha1.ICriteria[]; + + /** SearchAssetsRequest facetSelections. */ + public facetSelections: google.cloud.visionai.v1alpha1.IFacetGroup[]; + + /** SearchAssetsRequest resultAnnotationKeys. */ + public resultAnnotationKeys: string[]; + + /** + * Creates a new SearchAssetsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchAssetsRequest instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.ISearchAssetsRequest): google.cloud.visionai.v1alpha1.SearchAssetsRequest; + + /** + * Encodes the specified SearchAssetsRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.SearchAssetsRequest.verify|verify} messages. + * @param message SearchAssetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.ISearchAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.SearchAssetsRequest.verify|verify} messages. + * @param message SearchAssetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.ISearchAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchAssetsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.SearchAssetsRequest; + + /** + * Decodes a SearchAssetsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.SearchAssetsRequest; + + /** + * Verifies a SearchAssetsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchAssetsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchAssetsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.SearchAssetsRequest; + + /** + * Creates a plain object from a SearchAssetsRequest message. Also converts values to other types if specified. + * @param message SearchAssetsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.SearchAssetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchAssetsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchAssetsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteAssetMetadata. */ + interface IDeleteAssetMetadata { + } + + /** Represents a DeleteAssetMetadata. */ + class DeleteAssetMetadata implements IDeleteAssetMetadata { + + /** + * Constructs a new DeleteAssetMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IDeleteAssetMetadata); + + /** + * Creates a new DeleteAssetMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteAssetMetadata instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IDeleteAssetMetadata): google.cloud.visionai.v1alpha1.DeleteAssetMetadata; + + /** + * Encodes the specified DeleteAssetMetadata message. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteAssetMetadata.verify|verify} messages. + * @param message DeleteAssetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IDeleteAssetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteAssetMetadata message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteAssetMetadata.verify|verify} messages. + * @param message DeleteAssetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IDeleteAssetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteAssetMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteAssetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.DeleteAssetMetadata; + + /** + * Decodes a DeleteAssetMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteAssetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.DeleteAssetMetadata; + + /** + * Verifies a DeleteAssetMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteAssetMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteAssetMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.DeleteAssetMetadata; + + /** + * Creates a plain object from a DeleteAssetMetadata message. Also converts values to other types if specified. + * @param message DeleteAssetMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.DeleteAssetMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteAssetMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteAssetMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AnnotationMatchingResult. */ + interface IAnnotationMatchingResult { + + /** AnnotationMatchingResult criteria */ + criteria?: (google.cloud.visionai.v1alpha1.ICriteria|null); + + /** AnnotationMatchingResult matchedAnnotations */ + matchedAnnotations?: (google.cloud.visionai.v1alpha1.IAnnotation[]|null); + + /** AnnotationMatchingResult status */ + status?: (google.rpc.IStatus|null); + } + + /** Represents an AnnotationMatchingResult. */ + class AnnotationMatchingResult implements IAnnotationMatchingResult { + + /** + * Constructs a new AnnotationMatchingResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IAnnotationMatchingResult); + + /** AnnotationMatchingResult criteria. */ + public criteria?: (google.cloud.visionai.v1alpha1.ICriteria|null); + + /** AnnotationMatchingResult matchedAnnotations. */ + public matchedAnnotations: google.cloud.visionai.v1alpha1.IAnnotation[]; + + /** AnnotationMatchingResult status. */ + public status?: (google.rpc.IStatus|null); + + /** + * Creates a new AnnotationMatchingResult instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotationMatchingResult instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IAnnotationMatchingResult): google.cloud.visionai.v1alpha1.AnnotationMatchingResult; + + /** + * Encodes the specified AnnotationMatchingResult message. Does not implicitly {@link google.cloud.visionai.v1alpha1.AnnotationMatchingResult.verify|verify} messages. + * @param message AnnotationMatchingResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IAnnotationMatchingResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotationMatchingResult message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.AnnotationMatchingResult.verify|verify} messages. + * @param message AnnotationMatchingResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IAnnotationMatchingResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotationMatchingResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotationMatchingResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.AnnotationMatchingResult; + + /** + * Decodes an AnnotationMatchingResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotationMatchingResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.AnnotationMatchingResult; + + /** + * Verifies an AnnotationMatchingResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AnnotationMatchingResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotationMatchingResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.AnnotationMatchingResult; + + /** + * Creates a plain object from an AnnotationMatchingResult message. Also converts values to other types if specified. + * @param message AnnotationMatchingResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.AnnotationMatchingResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotationMatchingResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnnotationMatchingResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchResultItem. */ + interface ISearchResultItem { + + /** SearchResultItem asset */ + asset?: (string|null); + + /** SearchResultItem segments */ + segments?: (google.cloud.visionai.v1alpha1.Partition.ITemporalPartition[]|null); + + /** SearchResultItem segment */ + segment?: (google.cloud.visionai.v1alpha1.Partition.ITemporalPartition|null); + + /** SearchResultItem requestedAnnotations */ + requestedAnnotations?: (google.cloud.visionai.v1alpha1.IAnnotation[]|null); + + /** SearchResultItem annotationMatchingResults */ + annotationMatchingResults?: (google.cloud.visionai.v1alpha1.IAnnotationMatchingResult[]|null); + } + + /** Represents a SearchResultItem. */ + class SearchResultItem implements ISearchResultItem { + + /** + * Constructs a new SearchResultItem. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.ISearchResultItem); + + /** SearchResultItem asset. */ + public asset: string; + + /** SearchResultItem segments. */ + public segments: google.cloud.visionai.v1alpha1.Partition.ITemporalPartition[]; + + /** SearchResultItem segment. */ + public segment?: (google.cloud.visionai.v1alpha1.Partition.ITemporalPartition|null); + + /** SearchResultItem requestedAnnotations. */ + public requestedAnnotations: google.cloud.visionai.v1alpha1.IAnnotation[]; + + /** SearchResultItem annotationMatchingResults. */ + public annotationMatchingResults: google.cloud.visionai.v1alpha1.IAnnotationMatchingResult[]; + + /** + * Creates a new SearchResultItem instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchResultItem instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.ISearchResultItem): google.cloud.visionai.v1alpha1.SearchResultItem; + + /** + * Encodes the specified SearchResultItem message. Does not implicitly {@link google.cloud.visionai.v1alpha1.SearchResultItem.verify|verify} messages. + * @param message SearchResultItem message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.ISearchResultItem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchResultItem message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.SearchResultItem.verify|verify} messages. + * @param message SearchResultItem message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.ISearchResultItem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchResultItem message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchResultItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.SearchResultItem; + + /** + * Decodes a SearchResultItem message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchResultItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.SearchResultItem; + + /** + * Verifies a SearchResultItem message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchResultItem message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchResultItem + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.SearchResultItem; + + /** + * Creates a plain object from a SearchResultItem message. Also converts values to other types if specified. + * @param message SearchResultItem + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.SearchResultItem, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchResultItem to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchResultItem + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchAssetsResponse. */ + interface ISearchAssetsResponse { + + /** SearchAssetsResponse searchResultItems */ + searchResultItems?: (google.cloud.visionai.v1alpha1.ISearchResultItem[]|null); + + /** SearchAssetsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** SearchAssetsResponse facetResults */ + facetResults?: (google.cloud.visionai.v1alpha1.IFacetGroup[]|null); + } + + /** Represents a SearchAssetsResponse. */ + class SearchAssetsResponse implements ISearchAssetsResponse { + + /** + * Constructs a new SearchAssetsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.ISearchAssetsResponse); + + /** SearchAssetsResponse searchResultItems. */ + public searchResultItems: google.cloud.visionai.v1alpha1.ISearchResultItem[]; + + /** SearchAssetsResponse nextPageToken. */ + public nextPageToken: string; + + /** SearchAssetsResponse facetResults. */ + public facetResults: google.cloud.visionai.v1alpha1.IFacetGroup[]; + + /** + * Creates a new SearchAssetsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchAssetsResponse instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.ISearchAssetsResponse): google.cloud.visionai.v1alpha1.SearchAssetsResponse; + + /** + * Encodes the specified SearchAssetsResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.SearchAssetsResponse.verify|verify} messages. + * @param message SearchAssetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.ISearchAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.SearchAssetsResponse.verify|verify} messages. + * @param message SearchAssetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.ISearchAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchAssetsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.SearchAssetsResponse; + + /** + * Decodes a SearchAssetsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.SearchAssetsResponse; + + /** + * Verifies a SearchAssetsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchAssetsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.SearchAssetsResponse; + + /** + * Creates a plain object from a SearchAssetsResponse message. Also converts values to other types if specified. + * @param message SearchAssetsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.SearchAssetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchAssetsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchAssetsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IntRange. */ + interface IIntRange { + + /** IntRange start */ + start?: (number|Long|string|null); + + /** IntRange end */ + end?: (number|Long|string|null); + } + + /** Represents an IntRange. */ + class IntRange implements IIntRange { + + /** + * Constructs a new IntRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IIntRange); + + /** IntRange start. */ + public start?: (number|Long|string|null); + + /** IntRange end. */ + public end?: (number|Long|string|null); + + /** + * Creates a new IntRange instance using the specified properties. + * @param [properties] Properties to set + * @returns IntRange instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IIntRange): google.cloud.visionai.v1alpha1.IntRange; + + /** + * Encodes the specified IntRange message. Does not implicitly {@link google.cloud.visionai.v1alpha1.IntRange.verify|verify} messages. + * @param message IntRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IIntRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IntRange message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.IntRange.verify|verify} messages. + * @param message IntRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IIntRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IntRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IntRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.IntRange; + + /** + * Decodes an IntRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IntRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.IntRange; + + /** + * Verifies an IntRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an IntRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IntRange + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.IntRange; + + /** + * Creates a plain object from an IntRange message. Also converts values to other types if specified. + * @param message IntRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.IntRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IntRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IntRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatRange. */ + interface IFloatRange { + + /** FloatRange start */ + start?: (number|null); + + /** FloatRange end */ + end?: (number|null); + } + + /** Represents a FloatRange. */ + class FloatRange implements IFloatRange { + + /** + * Constructs a new FloatRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IFloatRange); + + /** FloatRange start. */ + public start?: (number|null); + + /** FloatRange end. */ + public end?: (number|null); + + /** + * Creates a new FloatRange instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatRange instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IFloatRange): google.cloud.visionai.v1alpha1.FloatRange; + + /** + * Encodes the specified FloatRange message. Does not implicitly {@link google.cloud.visionai.v1alpha1.FloatRange.verify|verify} messages. + * @param message FloatRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IFloatRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FloatRange message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.FloatRange.verify|verify} messages. + * @param message FloatRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IFloatRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FloatRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.FloatRange; + + /** + * Decodes a FloatRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FloatRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.FloatRange; + + /** + * Verifies a FloatRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FloatRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FloatRange + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.FloatRange; + + /** + * Creates a plain object from a FloatRange message. Also converts values to other types if specified. + * @param message FloatRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.FloatRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FloatRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FloatRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringArray. */ + interface IStringArray { + + /** StringArray txtValues */ + txtValues?: (string[]|null); + } + + /** Represents a StringArray. */ + class StringArray implements IStringArray { + + /** + * Constructs a new StringArray. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IStringArray); + + /** StringArray txtValues. */ + public txtValues: string[]; + + /** + * Creates a new StringArray instance using the specified properties. + * @param [properties] Properties to set + * @returns StringArray instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IStringArray): google.cloud.visionai.v1alpha1.StringArray; + + /** + * Encodes the specified StringArray message. Does not implicitly {@link google.cloud.visionai.v1alpha1.StringArray.verify|verify} messages. + * @param message StringArray message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IStringArray, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StringArray message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.StringArray.verify|verify} messages. + * @param message StringArray message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IStringArray, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringArray message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StringArray + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.StringArray; + + /** + * Decodes a StringArray message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StringArray + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.StringArray; + + /** + * Verifies a StringArray message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StringArray message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StringArray + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.StringArray; + + /** + * Creates a plain object from a StringArray message. Also converts values to other types if specified. + * @param message StringArray + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.StringArray, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StringArray to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StringArray + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IntRangeArray. */ + interface IIntRangeArray { + + /** IntRangeArray intRanges */ + intRanges?: (google.cloud.visionai.v1alpha1.IIntRange[]|null); + } + + /** Represents an IntRangeArray. */ + class IntRangeArray implements IIntRangeArray { + + /** + * Constructs a new IntRangeArray. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IIntRangeArray); + + /** IntRangeArray intRanges. */ + public intRanges: google.cloud.visionai.v1alpha1.IIntRange[]; + + /** + * Creates a new IntRangeArray instance using the specified properties. + * @param [properties] Properties to set + * @returns IntRangeArray instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IIntRangeArray): google.cloud.visionai.v1alpha1.IntRangeArray; + + /** + * Encodes the specified IntRangeArray message. Does not implicitly {@link google.cloud.visionai.v1alpha1.IntRangeArray.verify|verify} messages. + * @param message IntRangeArray message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IIntRangeArray, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IntRangeArray message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.IntRangeArray.verify|verify} messages. + * @param message IntRangeArray message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IIntRangeArray, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IntRangeArray message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IntRangeArray + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.IntRangeArray; + + /** + * Decodes an IntRangeArray message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IntRangeArray + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.IntRangeArray; + + /** + * Verifies an IntRangeArray message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an IntRangeArray message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IntRangeArray + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.IntRangeArray; + + /** + * Creates a plain object from an IntRangeArray message. Also converts values to other types if specified. + * @param message IntRangeArray + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.IntRangeArray, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IntRangeArray to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IntRangeArray + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatRangeArray. */ + interface IFloatRangeArray { + + /** FloatRangeArray floatRanges */ + floatRanges?: (google.cloud.visionai.v1alpha1.IFloatRange[]|null); + } + + /** Represents a FloatRangeArray. */ + class FloatRangeArray implements IFloatRangeArray { + + /** + * Constructs a new FloatRangeArray. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IFloatRangeArray); + + /** FloatRangeArray floatRanges. */ + public floatRanges: google.cloud.visionai.v1alpha1.IFloatRange[]; + + /** + * Creates a new FloatRangeArray instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatRangeArray instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IFloatRangeArray): google.cloud.visionai.v1alpha1.FloatRangeArray; + + /** + * Encodes the specified FloatRangeArray message. Does not implicitly {@link google.cloud.visionai.v1alpha1.FloatRangeArray.verify|verify} messages. + * @param message FloatRangeArray message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IFloatRangeArray, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FloatRangeArray message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.FloatRangeArray.verify|verify} messages. + * @param message FloatRangeArray message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IFloatRangeArray, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatRangeArray message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FloatRangeArray + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.FloatRangeArray; + + /** + * Decodes a FloatRangeArray message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FloatRangeArray + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.FloatRangeArray; + + /** + * Verifies a FloatRangeArray message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FloatRangeArray message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FloatRangeArray + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.FloatRangeArray; + + /** + * Creates a plain object from a FloatRangeArray message. Also converts values to other types if specified. + * @param message FloatRangeArray + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.FloatRangeArray, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FloatRangeArray to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FloatRangeArray + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DateTimeRange. */ + interface IDateTimeRange { + + /** DateTimeRange start */ + start?: (google.type.IDateTime|null); + + /** DateTimeRange end */ + end?: (google.type.IDateTime|null); + } + + /** Represents a DateTimeRange. */ + class DateTimeRange implements IDateTimeRange { + + /** + * Constructs a new DateTimeRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IDateTimeRange); + + /** DateTimeRange start. */ + public start?: (google.type.IDateTime|null); + + /** DateTimeRange end. */ + public end?: (google.type.IDateTime|null); + + /** + * Creates a new DateTimeRange instance using the specified properties. + * @param [properties] Properties to set + * @returns DateTimeRange instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IDateTimeRange): google.cloud.visionai.v1alpha1.DateTimeRange; + + /** + * Encodes the specified DateTimeRange message. Does not implicitly {@link google.cloud.visionai.v1alpha1.DateTimeRange.verify|verify} messages. + * @param message DateTimeRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IDateTimeRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DateTimeRange message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.DateTimeRange.verify|verify} messages. + * @param message DateTimeRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IDateTimeRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DateTimeRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DateTimeRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.DateTimeRange; + + /** + * Decodes a DateTimeRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DateTimeRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.DateTimeRange; + + /** + * Verifies a DateTimeRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DateTimeRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DateTimeRange + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.DateTimeRange; + + /** + * Creates a plain object from a DateTimeRange message. Also converts values to other types if specified. + * @param message DateTimeRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.DateTimeRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DateTimeRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DateTimeRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DateTimeRangeArray. */ + interface IDateTimeRangeArray { + + /** DateTimeRangeArray dateTimeRanges */ + dateTimeRanges?: (google.cloud.visionai.v1alpha1.IDateTimeRange[]|null); + } + + /** Represents a DateTimeRangeArray. */ + class DateTimeRangeArray implements IDateTimeRangeArray { + + /** + * Constructs a new DateTimeRangeArray. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IDateTimeRangeArray); + + /** DateTimeRangeArray dateTimeRanges. */ + public dateTimeRanges: google.cloud.visionai.v1alpha1.IDateTimeRange[]; + + /** + * Creates a new DateTimeRangeArray instance using the specified properties. + * @param [properties] Properties to set + * @returns DateTimeRangeArray instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IDateTimeRangeArray): google.cloud.visionai.v1alpha1.DateTimeRangeArray; + + /** + * Encodes the specified DateTimeRangeArray message. Does not implicitly {@link google.cloud.visionai.v1alpha1.DateTimeRangeArray.verify|verify} messages. + * @param message DateTimeRangeArray message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IDateTimeRangeArray, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DateTimeRangeArray message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.DateTimeRangeArray.verify|verify} messages. + * @param message DateTimeRangeArray message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IDateTimeRangeArray, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DateTimeRangeArray message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DateTimeRangeArray + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.DateTimeRangeArray; + + /** + * Decodes a DateTimeRangeArray message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DateTimeRangeArray + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.DateTimeRangeArray; + + /** + * Verifies a DateTimeRangeArray message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DateTimeRangeArray message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DateTimeRangeArray + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.DateTimeRangeArray; + + /** + * Creates a plain object from a DateTimeRangeArray message. Also converts values to other types if specified. + * @param message DateTimeRangeArray + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.DateTimeRangeArray, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DateTimeRangeArray to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DateTimeRangeArray + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CircleArea. */ + interface ICircleArea { + + /** CircleArea latitude */ + latitude?: (number|null); + + /** CircleArea longitude */ + longitude?: (number|null); + + /** CircleArea radiusMeter */ + radiusMeter?: (number|null); + } + + /** Represents a CircleArea. */ + class CircleArea implements ICircleArea { + + /** + * Constructs a new CircleArea. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.ICircleArea); + + /** CircleArea latitude. */ + public latitude: number; + + /** CircleArea longitude. */ + public longitude: number; + + /** CircleArea radiusMeter. */ + public radiusMeter: number; + + /** + * Creates a new CircleArea instance using the specified properties. + * @param [properties] Properties to set + * @returns CircleArea instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.ICircleArea): google.cloud.visionai.v1alpha1.CircleArea; + + /** + * Encodes the specified CircleArea message. Does not implicitly {@link google.cloud.visionai.v1alpha1.CircleArea.verify|verify} messages. + * @param message CircleArea message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.ICircleArea, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CircleArea message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.CircleArea.verify|verify} messages. + * @param message CircleArea message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.ICircleArea, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CircleArea message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CircleArea + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.CircleArea; + + /** + * Decodes a CircleArea message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CircleArea + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.CircleArea; + + /** + * Verifies a CircleArea message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CircleArea message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CircleArea + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.CircleArea; + + /** + * Creates a plain object from a CircleArea message. Also converts values to other types if specified. + * @param message CircleArea + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.CircleArea, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CircleArea to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CircleArea + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GeoLocationArray. */ + interface IGeoLocationArray { + + /** GeoLocationArray circleAreas */ + circleAreas?: (google.cloud.visionai.v1alpha1.ICircleArea[]|null); + } + + /** Represents a GeoLocationArray. */ + class GeoLocationArray implements IGeoLocationArray { + + /** + * Constructs a new GeoLocationArray. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IGeoLocationArray); + + /** GeoLocationArray circleAreas. */ + public circleAreas: google.cloud.visionai.v1alpha1.ICircleArea[]; + + /** + * Creates a new GeoLocationArray instance using the specified properties. + * @param [properties] Properties to set + * @returns GeoLocationArray instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IGeoLocationArray): google.cloud.visionai.v1alpha1.GeoLocationArray; + + /** + * Encodes the specified GeoLocationArray message. Does not implicitly {@link google.cloud.visionai.v1alpha1.GeoLocationArray.verify|verify} messages. + * @param message GeoLocationArray message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IGeoLocationArray, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeoLocationArray message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.GeoLocationArray.verify|verify} messages. + * @param message GeoLocationArray message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IGeoLocationArray, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeoLocationArray message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeoLocationArray + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.GeoLocationArray; + + /** + * Decodes a GeoLocationArray message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeoLocationArray + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.GeoLocationArray; + + /** + * Verifies a GeoLocationArray message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeoLocationArray message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeoLocationArray + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.GeoLocationArray; + + /** + * Creates a plain object from a GeoLocationArray message. Also converts values to other types if specified. + * @param message GeoLocationArray + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.GeoLocationArray, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeoLocationArray to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeoLocationArray + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** BoolValue value */ + value?: (boolean|null); + } + + /** Represents a BoolValue. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IBoolValue); + + /** BoolValue value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IBoolValue): google.cloud.visionai.v1alpha1.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.cloud.visionai.v1alpha1.BoolValue.verify|verify} messages. + * @param message BoolValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.BoolValue.verify|verify} messages. + * @param message BoolValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.BoolValue; + + /** + * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.BoolValue; + + /** + * Verifies a BoolValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoolValue + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.BoolValue; + + /** + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @param message BoolValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.BoolValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoolValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Criteria. */ + interface ICriteria { + + /** Criteria textArray */ + textArray?: (google.cloud.visionai.v1alpha1.IStringArray|null); + + /** Criteria intRangeArray */ + intRangeArray?: (google.cloud.visionai.v1alpha1.IIntRangeArray|null); + + /** Criteria floatRangeArray */ + floatRangeArray?: (google.cloud.visionai.v1alpha1.IFloatRangeArray|null); + + /** Criteria dateTimeRangeArray */ + dateTimeRangeArray?: (google.cloud.visionai.v1alpha1.IDateTimeRangeArray|null); + + /** Criteria geoLocationArray */ + geoLocationArray?: (google.cloud.visionai.v1alpha1.IGeoLocationArray|null); + + /** Criteria boolValue */ + boolValue?: (google.cloud.visionai.v1alpha1.IBoolValue|null); + + /** Criteria field */ + field?: (string|null); + + /** Criteria fetchMatchedAnnotations */ + fetchMatchedAnnotations?: (boolean|null); + } + + /** Represents a Criteria. */ + class Criteria implements ICriteria { + + /** + * Constructs a new Criteria. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.ICriteria); + + /** Criteria textArray. */ + public textArray?: (google.cloud.visionai.v1alpha1.IStringArray|null); + + /** Criteria intRangeArray. */ + public intRangeArray?: (google.cloud.visionai.v1alpha1.IIntRangeArray|null); + + /** Criteria floatRangeArray. */ + public floatRangeArray?: (google.cloud.visionai.v1alpha1.IFloatRangeArray|null); + + /** Criteria dateTimeRangeArray. */ + public dateTimeRangeArray?: (google.cloud.visionai.v1alpha1.IDateTimeRangeArray|null); + + /** Criteria geoLocationArray. */ + public geoLocationArray?: (google.cloud.visionai.v1alpha1.IGeoLocationArray|null); + + /** Criteria boolValue. */ + public boolValue?: (google.cloud.visionai.v1alpha1.IBoolValue|null); + + /** Criteria field. */ + public field: string; + + /** Criteria fetchMatchedAnnotations. */ + public fetchMatchedAnnotations: boolean; + + /** Criteria value. */ + public value?: ("textArray"|"intRangeArray"|"floatRangeArray"|"dateTimeRangeArray"|"geoLocationArray"|"boolValue"); + + /** + * Creates a new Criteria instance using the specified properties. + * @param [properties] Properties to set + * @returns Criteria instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.ICriteria): google.cloud.visionai.v1alpha1.Criteria; + + /** + * Encodes the specified Criteria message. Does not implicitly {@link google.cloud.visionai.v1alpha1.Criteria.verify|verify} messages. + * @param message Criteria message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.ICriteria, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Criteria message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.Criteria.verify|verify} messages. + * @param message Criteria message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.ICriteria, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Criteria message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Criteria + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.Criteria; + + /** + * Decodes a Criteria message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Criteria + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.Criteria; + + /** + * Verifies a Criteria message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Criteria message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Criteria + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.Criteria; + + /** + * Creates a plain object from a Criteria message. Also converts values to other types if specified. + * @param message Criteria + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.Criteria, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Criteria to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Criteria + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Partition. */ + interface IPartition { + + /** Partition temporalPartition */ + temporalPartition?: (google.cloud.visionai.v1alpha1.Partition.ITemporalPartition|null); + + /** Partition spatialPartition */ + spatialPartition?: (google.cloud.visionai.v1alpha1.Partition.ISpatialPartition|null); + } + + /** Represents a Partition. */ + class Partition implements IPartition { + + /** + * Constructs a new Partition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.IPartition); + + /** Partition temporalPartition. */ + public temporalPartition?: (google.cloud.visionai.v1alpha1.Partition.ITemporalPartition|null); + + /** Partition spatialPartition. */ + public spatialPartition?: (google.cloud.visionai.v1alpha1.Partition.ISpatialPartition|null); + + /** + * Creates a new Partition instance using the specified properties. + * @param [properties] Properties to set + * @returns Partition instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.IPartition): google.cloud.visionai.v1alpha1.Partition; + + /** + * Encodes the specified Partition message. Does not implicitly {@link google.cloud.visionai.v1alpha1.Partition.verify|verify} messages. + * @param message Partition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.IPartition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Partition message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.Partition.verify|verify} messages. + * @param message Partition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.IPartition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Partition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Partition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.Partition; + + /** + * Decodes a Partition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Partition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.Partition; + + /** + * Verifies a Partition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Partition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Partition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.Partition; + + /** + * Creates a plain object from a Partition message. Also converts values to other types if specified. + * @param message Partition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.Partition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Partition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Partition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Partition { + + /** Properties of a TemporalPartition. */ + interface ITemporalPartition { + + /** TemporalPartition startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** TemporalPartition endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a TemporalPartition. */ + class TemporalPartition implements ITemporalPartition { + + /** + * Constructs a new TemporalPartition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.Partition.ITemporalPartition); + + /** TemporalPartition startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** TemporalPartition endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new TemporalPartition instance using the specified properties. + * @param [properties] Properties to set + * @returns TemporalPartition instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.Partition.ITemporalPartition): google.cloud.visionai.v1alpha1.Partition.TemporalPartition; + + /** + * Encodes the specified TemporalPartition message. Does not implicitly {@link google.cloud.visionai.v1alpha1.Partition.TemporalPartition.verify|verify} messages. + * @param message TemporalPartition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.Partition.ITemporalPartition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TemporalPartition message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.Partition.TemporalPartition.verify|verify} messages. + * @param message TemporalPartition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.Partition.ITemporalPartition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TemporalPartition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TemporalPartition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.Partition.TemporalPartition; + + /** + * Decodes a TemporalPartition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TemporalPartition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.Partition.TemporalPartition; + + /** + * Verifies a TemporalPartition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TemporalPartition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TemporalPartition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.Partition.TemporalPartition; + + /** + * Creates a plain object from a TemporalPartition message. Also converts values to other types if specified. + * @param message TemporalPartition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.Partition.TemporalPartition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TemporalPartition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TemporalPartition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpatialPartition. */ + interface ISpatialPartition { + + /** SpatialPartition xMin */ + xMin?: (number|Long|string|null); + + /** SpatialPartition yMin */ + yMin?: (number|Long|string|null); + + /** SpatialPartition xMax */ + xMax?: (number|Long|string|null); + + /** SpatialPartition yMax */ + yMax?: (number|Long|string|null); + } + + /** Represents a SpatialPartition. */ + class SpatialPartition implements ISpatialPartition { + + /** + * Constructs a new SpatialPartition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.visionai.v1alpha1.Partition.ISpatialPartition); + + /** SpatialPartition xMin. */ + public xMin?: (number|Long|string|null); + + /** SpatialPartition yMin. */ + public yMin?: (number|Long|string|null); + + /** SpatialPartition xMax. */ + public xMax?: (number|Long|string|null); + + /** SpatialPartition yMax. */ + public yMax?: (number|Long|string|null); + + /** + * Creates a new SpatialPartition instance using the specified properties. + * @param [properties] Properties to set + * @returns SpatialPartition instance + */ + public static create(properties?: google.cloud.visionai.v1alpha1.Partition.ISpatialPartition): google.cloud.visionai.v1alpha1.Partition.SpatialPartition; + + /** + * Encodes the specified SpatialPartition message. Does not implicitly {@link google.cloud.visionai.v1alpha1.Partition.SpatialPartition.verify|verify} messages. + * @param message SpatialPartition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.visionai.v1alpha1.Partition.ISpatialPartition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpatialPartition message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.Partition.SpatialPartition.verify|verify} messages. + * @param message SpatialPartition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.visionai.v1alpha1.Partition.ISpatialPartition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpatialPartition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpatialPartition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.visionai.v1alpha1.Partition.SpatialPartition; + + /** + * Decodes a SpatialPartition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpatialPartition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.visionai.v1alpha1.Partition.SpatialPartition; + + /** + * Verifies a SpatialPartition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpatialPartition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpatialPartition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.visionai.v1alpha1.Partition.SpatialPartition; + + /** + * Creates a plain object from a SpatialPartition message. Also converts values to other types if specified. + * @param message SpatialPartition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.visionai.v1alpha1.Partition.SpatialPartition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpatialPartition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpatialPartition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } } } diff --git a/packages/google-cloud-visionai/protos/protos.js b/packages/google-cloud-visionai/protos/protos.js index e69264aac7f7..6990490e96f1 100644 --- a/packages/google-cloud-visionai/protos/protos.js +++ b/packages/google-cloud-visionai/protos/protos.js @@ -135927,6 +135927,83057 @@ return v1; })(); + visionai.v1alpha1 = (function() { + + /** + * Namespace v1alpha1. + * @memberof google.cloud.visionai + * @namespace + */ + var v1alpha1 = {}; + + /** + * StreamAnnotationType enum. + * @name google.cloud.visionai.v1alpha1.StreamAnnotationType + * @enum {number} + * @property {number} STREAM_ANNOTATION_TYPE_UNSPECIFIED=0 STREAM_ANNOTATION_TYPE_UNSPECIFIED value + * @property {number} STREAM_ANNOTATION_TYPE_ACTIVE_ZONE=1 STREAM_ANNOTATION_TYPE_ACTIVE_ZONE value + * @property {number} STREAM_ANNOTATION_TYPE_CROSSING_LINE=2 STREAM_ANNOTATION_TYPE_CROSSING_LINE value + */ + v1alpha1.StreamAnnotationType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STREAM_ANNOTATION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STREAM_ANNOTATION_TYPE_ACTIVE_ZONE"] = 1; + values[valuesById[2] = "STREAM_ANNOTATION_TYPE_CROSSING_LINE"] = 2; + return values; + })(); + + v1alpha1.PersonalProtectiveEquipmentDetectionOutput = (function() { + + /** + * Properties of a PersonalProtectiveEquipmentDetectionOutput. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IPersonalProtectiveEquipmentDetectionOutput + * @property {google.protobuf.ITimestamp|null} [currentTime] PersonalProtectiveEquipmentDetectionOutput currentTime + * @property {Array.|null} [detectedPersons] PersonalProtectiveEquipmentDetectionOutput detectedPersons + */ + + /** + * Constructs a new PersonalProtectiveEquipmentDetectionOutput. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a PersonalProtectiveEquipmentDetectionOutput. + * @implements IPersonalProtectiveEquipmentDetectionOutput + * @constructor + * @param {google.cloud.visionai.v1alpha1.IPersonalProtectiveEquipmentDetectionOutput=} [properties] Properties to set + */ + function PersonalProtectiveEquipmentDetectionOutput(properties) { + this.detectedPersons = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PersonalProtectiveEquipmentDetectionOutput currentTime. + * @member {google.protobuf.ITimestamp|null|undefined} currentTime + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput + * @instance + */ + PersonalProtectiveEquipmentDetectionOutput.prototype.currentTime = null; + + /** + * PersonalProtectiveEquipmentDetectionOutput detectedPersons. + * @member {Array.} detectedPersons + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput + * @instance + */ + PersonalProtectiveEquipmentDetectionOutput.prototype.detectedPersons = $util.emptyArray; + + /** + * Creates a new PersonalProtectiveEquipmentDetectionOutput instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput + * @static + * @param {google.cloud.visionai.v1alpha1.IPersonalProtectiveEquipmentDetectionOutput=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput} PersonalProtectiveEquipmentDetectionOutput instance + */ + PersonalProtectiveEquipmentDetectionOutput.create = function create(properties) { + return new PersonalProtectiveEquipmentDetectionOutput(properties); + }; + + /** + * Encodes the specified PersonalProtectiveEquipmentDetectionOutput message. Does not implicitly {@link google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput + * @static + * @param {google.cloud.visionai.v1alpha1.IPersonalProtectiveEquipmentDetectionOutput} message PersonalProtectiveEquipmentDetectionOutput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PersonalProtectiveEquipmentDetectionOutput.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.currentTime != null && Object.hasOwnProperty.call(message, "currentTime")) + $root.google.protobuf.Timestamp.encode(message.currentTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.detectedPersons != null && message.detectedPersons.length) + for (var i = 0; i < message.detectedPersons.length; ++i) + $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.DetectedPerson.encode(message.detectedPersons[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PersonalProtectiveEquipmentDetectionOutput message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput + * @static + * @param {google.cloud.visionai.v1alpha1.IPersonalProtectiveEquipmentDetectionOutput} message PersonalProtectiveEquipmentDetectionOutput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PersonalProtectiveEquipmentDetectionOutput.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PersonalProtectiveEquipmentDetectionOutput message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput} PersonalProtectiveEquipmentDetectionOutput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PersonalProtectiveEquipmentDetectionOutput.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.currentTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + if (!(message.detectedPersons && message.detectedPersons.length)) + message.detectedPersons = []; + message.detectedPersons.push($root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.DetectedPerson.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PersonalProtectiveEquipmentDetectionOutput message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput} PersonalProtectiveEquipmentDetectionOutput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PersonalProtectiveEquipmentDetectionOutput.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PersonalProtectiveEquipmentDetectionOutput message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PersonalProtectiveEquipmentDetectionOutput.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.currentTime != null && message.hasOwnProperty("currentTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.currentTime, long + 1); + if (error) + return "currentTime." + error; + } + if (message.detectedPersons != null && message.hasOwnProperty("detectedPersons")) { + if (!Array.isArray(message.detectedPersons)) + return "detectedPersons: array expected"; + for (var i = 0; i < message.detectedPersons.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.DetectedPerson.verify(message.detectedPersons[i], long + 1); + if (error) + return "detectedPersons." + error; + } + } + return null; + }; + + /** + * Creates a PersonalProtectiveEquipmentDetectionOutput message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput} PersonalProtectiveEquipmentDetectionOutput + */ + PersonalProtectiveEquipmentDetectionOutput.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput(); + if (object.currentTime != null) { + if (typeof object.currentTime !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.currentTime: object expected"); + message.currentTime = $root.google.protobuf.Timestamp.fromObject(object.currentTime, long + 1); + } + if (object.detectedPersons) { + if (!Array.isArray(object.detectedPersons)) + throw TypeError(".google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.detectedPersons: array expected"); + message.detectedPersons = []; + for (var i = 0; i < object.detectedPersons.length; ++i) { + if (typeof object.detectedPersons[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.detectedPersons: object expected"); + message.detectedPersons[i] = $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.DetectedPerson.fromObject(object.detectedPersons[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a PersonalProtectiveEquipmentDetectionOutput message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput + * @static + * @param {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput} message PersonalProtectiveEquipmentDetectionOutput + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PersonalProtectiveEquipmentDetectionOutput.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.detectedPersons = []; + if (options.defaults) + object.currentTime = null; + if (message.currentTime != null && message.hasOwnProperty("currentTime")) + object.currentTime = $root.google.protobuf.Timestamp.toObject(message.currentTime, options); + if (message.detectedPersons && message.detectedPersons.length) { + object.detectedPersons = []; + for (var j = 0; j < message.detectedPersons.length; ++j) + object.detectedPersons[j] = $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.DetectedPerson.toObject(message.detectedPersons[j], options); + } + return object; + }; + + /** + * Converts this PersonalProtectiveEquipmentDetectionOutput to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput + * @instance + * @returns {Object.} JSON object + */ + PersonalProtectiveEquipmentDetectionOutput.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PersonalProtectiveEquipmentDetectionOutput + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PersonalProtectiveEquipmentDetectionOutput.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput"; + }; + + PersonalProtectiveEquipmentDetectionOutput.PersonEntity = (function() { + + /** + * Properties of a PersonEntity. + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput + * @interface IPersonEntity + * @property {number|Long|null} [personEntityId] PersonEntity personEntityId + */ + + /** + * Constructs a new PersonEntity. + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput + * @classdesc Represents a PersonEntity. + * @implements IPersonEntity + * @constructor + * @param {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.IPersonEntity=} [properties] Properties to set + */ + function PersonEntity(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PersonEntity personEntityId. + * @member {number|Long} personEntityId + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonEntity + * @instance + */ + PersonEntity.prototype.personEntityId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new PersonEntity instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonEntity + * @static + * @param {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.IPersonEntity=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonEntity} PersonEntity instance + */ + PersonEntity.create = function create(properties) { + return new PersonEntity(properties); + }; + + /** + * Encodes the specified PersonEntity message. Does not implicitly {@link google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonEntity.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonEntity + * @static + * @param {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.IPersonEntity} message PersonEntity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PersonEntity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.personEntityId != null && Object.hasOwnProperty.call(message, "personEntityId")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.personEntityId); + return writer; + }; + + /** + * Encodes the specified PersonEntity message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonEntity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonEntity + * @static + * @param {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.IPersonEntity} message PersonEntity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PersonEntity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PersonEntity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonEntity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonEntity} PersonEntity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PersonEntity.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonEntity(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.personEntityId = reader.int64(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PersonEntity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonEntity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonEntity} PersonEntity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PersonEntity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PersonEntity message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonEntity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PersonEntity.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.personEntityId != null && message.hasOwnProperty("personEntityId")) + if (!$util.isInteger(message.personEntityId) && !(message.personEntityId && $util.isInteger(message.personEntityId.low) && $util.isInteger(message.personEntityId.high))) + return "personEntityId: integer|Long expected"; + return null; + }; + + /** + * Creates a PersonEntity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonEntity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonEntity} PersonEntity + */ + PersonEntity.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonEntity) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonEntity(); + if (object.personEntityId != null) + if ($util.Long) + (message.personEntityId = $util.Long.fromValue(object.personEntityId)).unsigned = false; + else if (typeof object.personEntityId === "string") + message.personEntityId = parseInt(object.personEntityId, 10); + else if (typeof object.personEntityId === "number") + message.personEntityId = object.personEntityId; + else if (typeof object.personEntityId === "object") + message.personEntityId = new $util.LongBits(object.personEntityId.low >>> 0, object.personEntityId.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a PersonEntity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonEntity + * @static + * @param {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonEntity} message PersonEntity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PersonEntity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.personEntityId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.personEntityId = options.longs === String ? "0" : 0; + if (message.personEntityId != null && message.hasOwnProperty("personEntityId")) + if (typeof message.personEntityId === "number") + object.personEntityId = options.longs === String ? String(message.personEntityId) : message.personEntityId; + else + object.personEntityId = options.longs === String ? $util.Long.prototype.toString.call(message.personEntityId) : options.longs === Number ? new $util.LongBits(message.personEntityId.low >>> 0, message.personEntityId.high >>> 0).toNumber() : message.personEntityId; + return object; + }; + + /** + * Converts this PersonEntity to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonEntity + * @instance + * @returns {Object.} JSON object + */ + PersonEntity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PersonEntity + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonEntity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PersonEntity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonEntity"; + }; + + return PersonEntity; + })(); + + PersonalProtectiveEquipmentDetectionOutput.PPEEntity = (function() { + + /** + * Properties of a PPEEntity. + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput + * @interface IPPEEntity + * @property {number|Long|null} [ppeLabelId] PPEEntity ppeLabelId + * @property {string|null} [ppeLabelString] PPEEntity ppeLabelString + * @property {string|null} [ppeSupercategoryLabelString] PPEEntity ppeSupercategoryLabelString + * @property {number|Long|null} [ppeEntityId] PPEEntity ppeEntityId + */ + + /** + * Constructs a new PPEEntity. + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput + * @classdesc Represents a PPEEntity. + * @implements IPPEEntity + * @constructor + * @param {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.IPPEEntity=} [properties] Properties to set + */ + function PPEEntity(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PPEEntity ppeLabelId. + * @member {number|Long} ppeLabelId + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEEntity + * @instance + */ + PPEEntity.prototype.ppeLabelId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * PPEEntity ppeLabelString. + * @member {string} ppeLabelString + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEEntity + * @instance + */ + PPEEntity.prototype.ppeLabelString = ""; + + /** + * PPEEntity ppeSupercategoryLabelString. + * @member {string} ppeSupercategoryLabelString + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEEntity + * @instance + */ + PPEEntity.prototype.ppeSupercategoryLabelString = ""; + + /** + * PPEEntity ppeEntityId. + * @member {number|Long} ppeEntityId + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEEntity + * @instance + */ + PPEEntity.prototype.ppeEntityId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new PPEEntity instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEEntity + * @static + * @param {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.IPPEEntity=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEEntity} PPEEntity instance + */ + PPEEntity.create = function create(properties) { + return new PPEEntity(properties); + }; + + /** + * Encodes the specified PPEEntity message. Does not implicitly {@link google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEEntity.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEEntity + * @static + * @param {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.IPPEEntity} message PPEEntity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PPEEntity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ppeLabelId != null && Object.hasOwnProperty.call(message, "ppeLabelId")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.ppeLabelId); + if (message.ppeLabelString != null && Object.hasOwnProperty.call(message, "ppeLabelString")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.ppeLabelString); + if (message.ppeSupercategoryLabelString != null && Object.hasOwnProperty.call(message, "ppeSupercategoryLabelString")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.ppeSupercategoryLabelString); + if (message.ppeEntityId != null && Object.hasOwnProperty.call(message, "ppeEntityId")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.ppeEntityId); + return writer; + }; + + /** + * Encodes the specified PPEEntity message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEEntity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEEntity + * @static + * @param {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.IPPEEntity} message PPEEntity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PPEEntity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PPEEntity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEEntity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEEntity} PPEEntity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PPEEntity.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEEntity(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.ppeLabelId = reader.int64(); + break; + } + case 2: { + message.ppeLabelString = reader.string(); + break; + } + case 3: { + message.ppeSupercategoryLabelString = reader.string(); + break; + } + case 4: { + message.ppeEntityId = reader.int64(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PPEEntity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEEntity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEEntity} PPEEntity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PPEEntity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PPEEntity message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEEntity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PPEEntity.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.ppeLabelId != null && message.hasOwnProperty("ppeLabelId")) + if (!$util.isInteger(message.ppeLabelId) && !(message.ppeLabelId && $util.isInteger(message.ppeLabelId.low) && $util.isInteger(message.ppeLabelId.high))) + return "ppeLabelId: integer|Long expected"; + if (message.ppeLabelString != null && message.hasOwnProperty("ppeLabelString")) + if (!$util.isString(message.ppeLabelString)) + return "ppeLabelString: string expected"; + if (message.ppeSupercategoryLabelString != null && message.hasOwnProperty("ppeSupercategoryLabelString")) + if (!$util.isString(message.ppeSupercategoryLabelString)) + return "ppeSupercategoryLabelString: string expected"; + if (message.ppeEntityId != null && message.hasOwnProperty("ppeEntityId")) + if (!$util.isInteger(message.ppeEntityId) && !(message.ppeEntityId && $util.isInteger(message.ppeEntityId.low) && $util.isInteger(message.ppeEntityId.high))) + return "ppeEntityId: integer|Long expected"; + return null; + }; + + /** + * Creates a PPEEntity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEEntity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEEntity} PPEEntity + */ + PPEEntity.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEEntity) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEEntity(); + if (object.ppeLabelId != null) + if ($util.Long) + (message.ppeLabelId = $util.Long.fromValue(object.ppeLabelId)).unsigned = false; + else if (typeof object.ppeLabelId === "string") + message.ppeLabelId = parseInt(object.ppeLabelId, 10); + else if (typeof object.ppeLabelId === "number") + message.ppeLabelId = object.ppeLabelId; + else if (typeof object.ppeLabelId === "object") + message.ppeLabelId = new $util.LongBits(object.ppeLabelId.low >>> 0, object.ppeLabelId.high >>> 0).toNumber(); + if (object.ppeLabelString != null) + message.ppeLabelString = String(object.ppeLabelString); + if (object.ppeSupercategoryLabelString != null) + message.ppeSupercategoryLabelString = String(object.ppeSupercategoryLabelString); + if (object.ppeEntityId != null) + if ($util.Long) + (message.ppeEntityId = $util.Long.fromValue(object.ppeEntityId)).unsigned = false; + else if (typeof object.ppeEntityId === "string") + message.ppeEntityId = parseInt(object.ppeEntityId, 10); + else if (typeof object.ppeEntityId === "number") + message.ppeEntityId = object.ppeEntityId; + else if (typeof object.ppeEntityId === "object") + message.ppeEntityId = new $util.LongBits(object.ppeEntityId.low >>> 0, object.ppeEntityId.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a PPEEntity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEEntity + * @static + * @param {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEEntity} message PPEEntity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PPEEntity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.ppeLabelId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.ppeLabelId = options.longs === String ? "0" : 0; + object.ppeLabelString = ""; + object.ppeSupercategoryLabelString = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.ppeEntityId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.ppeEntityId = options.longs === String ? "0" : 0; + } + if (message.ppeLabelId != null && message.hasOwnProperty("ppeLabelId")) + if (typeof message.ppeLabelId === "number") + object.ppeLabelId = options.longs === String ? String(message.ppeLabelId) : message.ppeLabelId; + else + object.ppeLabelId = options.longs === String ? $util.Long.prototype.toString.call(message.ppeLabelId) : options.longs === Number ? new $util.LongBits(message.ppeLabelId.low >>> 0, message.ppeLabelId.high >>> 0).toNumber() : message.ppeLabelId; + if (message.ppeLabelString != null && message.hasOwnProperty("ppeLabelString")) + object.ppeLabelString = message.ppeLabelString; + if (message.ppeSupercategoryLabelString != null && message.hasOwnProperty("ppeSupercategoryLabelString")) + object.ppeSupercategoryLabelString = message.ppeSupercategoryLabelString; + if (message.ppeEntityId != null && message.hasOwnProperty("ppeEntityId")) + if (typeof message.ppeEntityId === "number") + object.ppeEntityId = options.longs === String ? String(message.ppeEntityId) : message.ppeEntityId; + else + object.ppeEntityId = options.longs === String ? $util.Long.prototype.toString.call(message.ppeEntityId) : options.longs === Number ? new $util.LongBits(message.ppeEntityId.low >>> 0, message.ppeEntityId.high >>> 0).toNumber() : message.ppeEntityId; + return object; + }; + + /** + * Converts this PPEEntity to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEEntity + * @instance + * @returns {Object.} JSON object + */ + PPEEntity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PPEEntity + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEEntity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PPEEntity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEEntity"; + }; + + return PPEEntity; + })(); + + PersonalProtectiveEquipmentDetectionOutput.NormalizedBoundingBox = (function() { + + /** + * Properties of a NormalizedBoundingBox. + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput + * @interface INormalizedBoundingBox + * @property {number|null} [xmin] NormalizedBoundingBox xmin + * @property {number|null} [ymin] NormalizedBoundingBox ymin + * @property {number|null} [width] NormalizedBoundingBox width + * @property {number|null} [height] NormalizedBoundingBox height + */ + + /** + * Constructs a new NormalizedBoundingBox. + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput + * @classdesc Represents a NormalizedBoundingBox. + * @implements INormalizedBoundingBox + * @constructor + * @param {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.INormalizedBoundingBox=} [properties] Properties to set + */ + function NormalizedBoundingBox(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * NormalizedBoundingBox xmin. + * @member {number} xmin + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.NormalizedBoundingBox + * @instance + */ + NormalizedBoundingBox.prototype.xmin = 0; + + /** + * NormalizedBoundingBox ymin. + * @member {number} ymin + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.NormalizedBoundingBox + * @instance + */ + NormalizedBoundingBox.prototype.ymin = 0; + + /** + * NormalizedBoundingBox width. + * @member {number} width + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.NormalizedBoundingBox + * @instance + */ + NormalizedBoundingBox.prototype.width = 0; + + /** + * NormalizedBoundingBox height. + * @member {number} height + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.NormalizedBoundingBox + * @instance + */ + NormalizedBoundingBox.prototype.height = 0; + + /** + * Creates a new NormalizedBoundingBox instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.NormalizedBoundingBox + * @static + * @param {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.INormalizedBoundingBox=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.NormalizedBoundingBox} NormalizedBoundingBox instance + */ + NormalizedBoundingBox.create = function create(properties) { + return new NormalizedBoundingBox(properties); + }; + + /** + * Encodes the specified NormalizedBoundingBox message. Does not implicitly {@link google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.NormalizedBoundingBox.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.NormalizedBoundingBox + * @static + * @param {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.INormalizedBoundingBox} message NormalizedBoundingBox message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NormalizedBoundingBox.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.xmin != null && Object.hasOwnProperty.call(message, "xmin")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.xmin); + if (message.ymin != null && Object.hasOwnProperty.call(message, "ymin")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.ymin); + if (message.width != null && Object.hasOwnProperty.call(message, "width")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.width); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.height); + return writer; + }; + + /** + * Encodes the specified NormalizedBoundingBox message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.NormalizedBoundingBox.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.NormalizedBoundingBox + * @static + * @param {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.INormalizedBoundingBox} message NormalizedBoundingBox message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NormalizedBoundingBox.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NormalizedBoundingBox message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.NormalizedBoundingBox + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.NormalizedBoundingBox} NormalizedBoundingBox + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NormalizedBoundingBox.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.NormalizedBoundingBox(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.xmin = reader.float(); + break; + } + case 2: { + message.ymin = reader.float(); + break; + } + case 3: { + message.width = reader.float(); + break; + } + case 4: { + message.height = reader.float(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a NormalizedBoundingBox message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.NormalizedBoundingBox + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.NormalizedBoundingBox} NormalizedBoundingBox + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NormalizedBoundingBox.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NormalizedBoundingBox message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.NormalizedBoundingBox + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NormalizedBoundingBox.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.xmin != null && message.hasOwnProperty("xmin")) + if (typeof message.xmin !== "number") + return "xmin: number expected"; + if (message.ymin != null && message.hasOwnProperty("ymin")) + if (typeof message.ymin !== "number") + return "ymin: number expected"; + if (message.width != null && message.hasOwnProperty("width")) + if (typeof message.width !== "number") + return "width: number expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (typeof message.height !== "number") + return "height: number expected"; + return null; + }; + + /** + * Creates a NormalizedBoundingBox message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.NormalizedBoundingBox + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.NormalizedBoundingBox} NormalizedBoundingBox + */ + NormalizedBoundingBox.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.NormalizedBoundingBox) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.NormalizedBoundingBox(); + if (object.xmin != null) + message.xmin = Number(object.xmin); + if (object.ymin != null) + message.ymin = Number(object.ymin); + if (object.width != null) + message.width = Number(object.width); + if (object.height != null) + message.height = Number(object.height); + return message; + }; + + /** + * Creates a plain object from a NormalizedBoundingBox message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.NormalizedBoundingBox + * @static + * @param {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.NormalizedBoundingBox} message NormalizedBoundingBox + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NormalizedBoundingBox.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.xmin = 0; + object.ymin = 0; + object.width = 0; + object.height = 0; + } + if (message.xmin != null && message.hasOwnProperty("xmin")) + object.xmin = options.json && !isFinite(message.xmin) ? String(message.xmin) : message.xmin; + if (message.ymin != null && message.hasOwnProperty("ymin")) + object.ymin = options.json && !isFinite(message.ymin) ? String(message.ymin) : message.ymin; + if (message.width != null && message.hasOwnProperty("width")) + object.width = options.json && !isFinite(message.width) ? String(message.width) : message.width; + if (message.height != null && message.hasOwnProperty("height")) + object.height = options.json && !isFinite(message.height) ? String(message.height) : message.height; + return object; + }; + + /** + * Converts this NormalizedBoundingBox to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.NormalizedBoundingBox + * @instance + * @returns {Object.} JSON object + */ + NormalizedBoundingBox.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NormalizedBoundingBox + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.NormalizedBoundingBox + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NormalizedBoundingBox.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.NormalizedBoundingBox"; + }; + + return NormalizedBoundingBox; + })(); + + PersonalProtectiveEquipmentDetectionOutput.PersonIdentifiedBox = (function() { + + /** + * Properties of a PersonIdentifiedBox. + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput + * @interface IPersonIdentifiedBox + * @property {number|Long|null} [boxId] PersonIdentifiedBox boxId + * @property {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.INormalizedBoundingBox|null} [normalizedBoundingBox] PersonIdentifiedBox normalizedBoundingBox + * @property {number|null} [confidenceScore] PersonIdentifiedBox confidenceScore + * @property {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.IPersonEntity|null} [personEntity] PersonIdentifiedBox personEntity + */ + + /** + * Constructs a new PersonIdentifiedBox. + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput + * @classdesc Represents a PersonIdentifiedBox. + * @implements IPersonIdentifiedBox + * @constructor + * @param {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.IPersonIdentifiedBox=} [properties] Properties to set + */ + function PersonIdentifiedBox(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PersonIdentifiedBox boxId. + * @member {number|Long} boxId + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonIdentifiedBox + * @instance + */ + PersonIdentifiedBox.prototype.boxId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * PersonIdentifiedBox normalizedBoundingBox. + * @member {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.INormalizedBoundingBox|null|undefined} normalizedBoundingBox + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonIdentifiedBox + * @instance + */ + PersonIdentifiedBox.prototype.normalizedBoundingBox = null; + + /** + * PersonIdentifiedBox confidenceScore. + * @member {number} confidenceScore + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonIdentifiedBox + * @instance + */ + PersonIdentifiedBox.prototype.confidenceScore = 0; + + /** + * PersonIdentifiedBox personEntity. + * @member {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.IPersonEntity|null|undefined} personEntity + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonIdentifiedBox + * @instance + */ + PersonIdentifiedBox.prototype.personEntity = null; + + /** + * Creates a new PersonIdentifiedBox instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonIdentifiedBox + * @static + * @param {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.IPersonIdentifiedBox=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonIdentifiedBox} PersonIdentifiedBox instance + */ + PersonIdentifiedBox.create = function create(properties) { + return new PersonIdentifiedBox(properties); + }; + + /** + * Encodes the specified PersonIdentifiedBox message. Does not implicitly {@link google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonIdentifiedBox.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonIdentifiedBox + * @static + * @param {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.IPersonIdentifiedBox} message PersonIdentifiedBox message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PersonIdentifiedBox.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.boxId != null && Object.hasOwnProperty.call(message, "boxId")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.boxId); + if (message.normalizedBoundingBox != null && Object.hasOwnProperty.call(message, "normalizedBoundingBox")) + $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.NormalizedBoundingBox.encode(message.normalizedBoundingBox, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.confidenceScore != null && Object.hasOwnProperty.call(message, "confidenceScore")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.confidenceScore); + if (message.personEntity != null && Object.hasOwnProperty.call(message, "personEntity")) + $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonEntity.encode(message.personEntity, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PersonIdentifiedBox message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonIdentifiedBox.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonIdentifiedBox + * @static + * @param {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.IPersonIdentifiedBox} message PersonIdentifiedBox message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PersonIdentifiedBox.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PersonIdentifiedBox message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonIdentifiedBox + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonIdentifiedBox} PersonIdentifiedBox + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PersonIdentifiedBox.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonIdentifiedBox(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.boxId = reader.int64(); + break; + } + case 2: { + message.normalizedBoundingBox = $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.NormalizedBoundingBox.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.confidenceScore = reader.float(); + break; + } + case 4: { + message.personEntity = $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonEntity.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PersonIdentifiedBox message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonIdentifiedBox + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonIdentifiedBox} PersonIdentifiedBox + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PersonIdentifiedBox.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PersonIdentifiedBox message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonIdentifiedBox + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PersonIdentifiedBox.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.boxId != null && message.hasOwnProperty("boxId")) + if (!$util.isInteger(message.boxId) && !(message.boxId && $util.isInteger(message.boxId.low) && $util.isInteger(message.boxId.high))) + return "boxId: integer|Long expected"; + if (message.normalizedBoundingBox != null && message.hasOwnProperty("normalizedBoundingBox")) { + var error = $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.NormalizedBoundingBox.verify(message.normalizedBoundingBox, long + 1); + if (error) + return "normalizedBoundingBox." + error; + } + if (message.confidenceScore != null && message.hasOwnProperty("confidenceScore")) + if (typeof message.confidenceScore !== "number") + return "confidenceScore: number expected"; + if (message.personEntity != null && message.hasOwnProperty("personEntity")) { + var error = $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonEntity.verify(message.personEntity, long + 1); + if (error) + return "personEntity." + error; + } + return null; + }; + + /** + * Creates a PersonIdentifiedBox message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonIdentifiedBox + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonIdentifiedBox} PersonIdentifiedBox + */ + PersonIdentifiedBox.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonIdentifiedBox) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonIdentifiedBox(); + if (object.boxId != null) + if ($util.Long) + (message.boxId = $util.Long.fromValue(object.boxId)).unsigned = false; + else if (typeof object.boxId === "string") + message.boxId = parseInt(object.boxId, 10); + else if (typeof object.boxId === "number") + message.boxId = object.boxId; + else if (typeof object.boxId === "object") + message.boxId = new $util.LongBits(object.boxId.low >>> 0, object.boxId.high >>> 0).toNumber(); + if (object.normalizedBoundingBox != null) { + if (typeof object.normalizedBoundingBox !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonIdentifiedBox.normalizedBoundingBox: object expected"); + message.normalizedBoundingBox = $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.NormalizedBoundingBox.fromObject(object.normalizedBoundingBox, long + 1); + } + if (object.confidenceScore != null) + message.confidenceScore = Number(object.confidenceScore); + if (object.personEntity != null) { + if (typeof object.personEntity !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonIdentifiedBox.personEntity: object expected"); + message.personEntity = $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonEntity.fromObject(object.personEntity, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a PersonIdentifiedBox message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonIdentifiedBox + * @static + * @param {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonIdentifiedBox} message PersonIdentifiedBox + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PersonIdentifiedBox.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.boxId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.boxId = options.longs === String ? "0" : 0; + object.normalizedBoundingBox = null; + object.confidenceScore = 0; + object.personEntity = null; + } + if (message.boxId != null && message.hasOwnProperty("boxId")) + if (typeof message.boxId === "number") + object.boxId = options.longs === String ? String(message.boxId) : message.boxId; + else + object.boxId = options.longs === String ? $util.Long.prototype.toString.call(message.boxId) : options.longs === Number ? new $util.LongBits(message.boxId.low >>> 0, message.boxId.high >>> 0).toNumber() : message.boxId; + if (message.normalizedBoundingBox != null && message.hasOwnProperty("normalizedBoundingBox")) + object.normalizedBoundingBox = $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.NormalizedBoundingBox.toObject(message.normalizedBoundingBox, options); + if (message.confidenceScore != null && message.hasOwnProperty("confidenceScore")) + object.confidenceScore = options.json && !isFinite(message.confidenceScore) ? String(message.confidenceScore) : message.confidenceScore; + if (message.personEntity != null && message.hasOwnProperty("personEntity")) + object.personEntity = $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonEntity.toObject(message.personEntity, options); + return object; + }; + + /** + * Converts this PersonIdentifiedBox to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonIdentifiedBox + * @instance + * @returns {Object.} JSON object + */ + PersonIdentifiedBox.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PersonIdentifiedBox + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonIdentifiedBox + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PersonIdentifiedBox.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonIdentifiedBox"; + }; + + return PersonIdentifiedBox; + })(); + + PersonalProtectiveEquipmentDetectionOutput.PPEIdentifiedBox = (function() { + + /** + * Properties of a PPEIdentifiedBox. + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput + * @interface IPPEIdentifiedBox + * @property {number|Long|null} [boxId] PPEIdentifiedBox boxId + * @property {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.INormalizedBoundingBox|null} [normalizedBoundingBox] PPEIdentifiedBox normalizedBoundingBox + * @property {number|null} [confidenceScore] PPEIdentifiedBox confidenceScore + * @property {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.IPPEEntity|null} [ppeEntity] PPEIdentifiedBox ppeEntity + */ + + /** + * Constructs a new PPEIdentifiedBox. + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput + * @classdesc Represents a PPEIdentifiedBox. + * @implements IPPEIdentifiedBox + * @constructor + * @param {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.IPPEIdentifiedBox=} [properties] Properties to set + */ + function PPEIdentifiedBox(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PPEIdentifiedBox boxId. + * @member {number|Long} boxId + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEIdentifiedBox + * @instance + */ + PPEIdentifiedBox.prototype.boxId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * PPEIdentifiedBox normalizedBoundingBox. + * @member {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.INormalizedBoundingBox|null|undefined} normalizedBoundingBox + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEIdentifiedBox + * @instance + */ + PPEIdentifiedBox.prototype.normalizedBoundingBox = null; + + /** + * PPEIdentifiedBox confidenceScore. + * @member {number} confidenceScore + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEIdentifiedBox + * @instance + */ + PPEIdentifiedBox.prototype.confidenceScore = 0; + + /** + * PPEIdentifiedBox ppeEntity. + * @member {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.IPPEEntity|null|undefined} ppeEntity + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEIdentifiedBox + * @instance + */ + PPEIdentifiedBox.prototype.ppeEntity = null; + + /** + * Creates a new PPEIdentifiedBox instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEIdentifiedBox + * @static + * @param {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.IPPEIdentifiedBox=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEIdentifiedBox} PPEIdentifiedBox instance + */ + PPEIdentifiedBox.create = function create(properties) { + return new PPEIdentifiedBox(properties); + }; + + /** + * Encodes the specified PPEIdentifiedBox message. Does not implicitly {@link google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEIdentifiedBox.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEIdentifiedBox + * @static + * @param {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.IPPEIdentifiedBox} message PPEIdentifiedBox message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PPEIdentifiedBox.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.boxId != null && Object.hasOwnProperty.call(message, "boxId")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.boxId); + if (message.normalizedBoundingBox != null && Object.hasOwnProperty.call(message, "normalizedBoundingBox")) + $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.NormalizedBoundingBox.encode(message.normalizedBoundingBox, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.confidenceScore != null && Object.hasOwnProperty.call(message, "confidenceScore")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.confidenceScore); + if (message.ppeEntity != null && Object.hasOwnProperty.call(message, "ppeEntity")) + $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEEntity.encode(message.ppeEntity, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PPEIdentifiedBox message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEIdentifiedBox.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEIdentifiedBox + * @static + * @param {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.IPPEIdentifiedBox} message PPEIdentifiedBox message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PPEIdentifiedBox.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PPEIdentifiedBox message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEIdentifiedBox + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEIdentifiedBox} PPEIdentifiedBox + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PPEIdentifiedBox.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEIdentifiedBox(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.boxId = reader.int64(); + break; + } + case 2: { + message.normalizedBoundingBox = $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.NormalizedBoundingBox.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.confidenceScore = reader.float(); + break; + } + case 4: { + message.ppeEntity = $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEEntity.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PPEIdentifiedBox message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEIdentifiedBox + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEIdentifiedBox} PPEIdentifiedBox + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PPEIdentifiedBox.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PPEIdentifiedBox message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEIdentifiedBox + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PPEIdentifiedBox.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.boxId != null && message.hasOwnProperty("boxId")) + if (!$util.isInteger(message.boxId) && !(message.boxId && $util.isInteger(message.boxId.low) && $util.isInteger(message.boxId.high))) + return "boxId: integer|Long expected"; + if (message.normalizedBoundingBox != null && message.hasOwnProperty("normalizedBoundingBox")) { + var error = $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.NormalizedBoundingBox.verify(message.normalizedBoundingBox, long + 1); + if (error) + return "normalizedBoundingBox." + error; + } + if (message.confidenceScore != null && message.hasOwnProperty("confidenceScore")) + if (typeof message.confidenceScore !== "number") + return "confidenceScore: number expected"; + if (message.ppeEntity != null && message.hasOwnProperty("ppeEntity")) { + var error = $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEEntity.verify(message.ppeEntity, long + 1); + if (error) + return "ppeEntity." + error; + } + return null; + }; + + /** + * Creates a PPEIdentifiedBox message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEIdentifiedBox + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEIdentifiedBox} PPEIdentifiedBox + */ + PPEIdentifiedBox.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEIdentifiedBox) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEIdentifiedBox(); + if (object.boxId != null) + if ($util.Long) + (message.boxId = $util.Long.fromValue(object.boxId)).unsigned = false; + else if (typeof object.boxId === "string") + message.boxId = parseInt(object.boxId, 10); + else if (typeof object.boxId === "number") + message.boxId = object.boxId; + else if (typeof object.boxId === "object") + message.boxId = new $util.LongBits(object.boxId.low >>> 0, object.boxId.high >>> 0).toNumber(); + if (object.normalizedBoundingBox != null) { + if (typeof object.normalizedBoundingBox !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEIdentifiedBox.normalizedBoundingBox: object expected"); + message.normalizedBoundingBox = $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.NormalizedBoundingBox.fromObject(object.normalizedBoundingBox, long + 1); + } + if (object.confidenceScore != null) + message.confidenceScore = Number(object.confidenceScore); + if (object.ppeEntity != null) { + if (typeof object.ppeEntity !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEIdentifiedBox.ppeEntity: object expected"); + message.ppeEntity = $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEEntity.fromObject(object.ppeEntity, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a PPEIdentifiedBox message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEIdentifiedBox + * @static + * @param {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEIdentifiedBox} message PPEIdentifiedBox + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PPEIdentifiedBox.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.boxId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.boxId = options.longs === String ? "0" : 0; + object.normalizedBoundingBox = null; + object.confidenceScore = 0; + object.ppeEntity = null; + } + if (message.boxId != null && message.hasOwnProperty("boxId")) + if (typeof message.boxId === "number") + object.boxId = options.longs === String ? String(message.boxId) : message.boxId; + else + object.boxId = options.longs === String ? $util.Long.prototype.toString.call(message.boxId) : options.longs === Number ? new $util.LongBits(message.boxId.low >>> 0, message.boxId.high >>> 0).toNumber() : message.boxId; + if (message.normalizedBoundingBox != null && message.hasOwnProperty("normalizedBoundingBox")) + object.normalizedBoundingBox = $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.NormalizedBoundingBox.toObject(message.normalizedBoundingBox, options); + if (message.confidenceScore != null && message.hasOwnProperty("confidenceScore")) + object.confidenceScore = options.json && !isFinite(message.confidenceScore) ? String(message.confidenceScore) : message.confidenceScore; + if (message.ppeEntity != null && message.hasOwnProperty("ppeEntity")) + object.ppeEntity = $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEEntity.toObject(message.ppeEntity, options); + return object; + }; + + /** + * Converts this PPEIdentifiedBox to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEIdentifiedBox + * @instance + * @returns {Object.} JSON object + */ + PPEIdentifiedBox.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PPEIdentifiedBox + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEIdentifiedBox + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PPEIdentifiedBox.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEIdentifiedBox"; + }; + + return PPEIdentifiedBox; + })(); + + PersonalProtectiveEquipmentDetectionOutput.DetectedPerson = (function() { + + /** + * Properties of a DetectedPerson. + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput + * @interface IDetectedPerson + * @property {number|Long|null} [personId] DetectedPerson personId + * @property {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.IPersonIdentifiedBox|null} [detectedPersonIdentifiedBox] DetectedPerson detectedPersonIdentifiedBox + * @property {Array.|null} [detectedPpeIdentifiedBoxes] DetectedPerson detectedPpeIdentifiedBoxes + * @property {number|null} [faceCoverageScore] DetectedPerson faceCoverageScore + * @property {number|null} [eyesCoverageScore] DetectedPerson eyesCoverageScore + * @property {number|null} [headCoverageScore] DetectedPerson headCoverageScore + * @property {number|null} [handsCoverageScore] DetectedPerson handsCoverageScore + * @property {number|null} [bodyCoverageScore] DetectedPerson bodyCoverageScore + * @property {number|null} [feetCoverageScore] DetectedPerson feetCoverageScore + */ + + /** + * Constructs a new DetectedPerson. + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput + * @classdesc Represents a DetectedPerson. + * @implements IDetectedPerson + * @constructor + * @param {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.IDetectedPerson=} [properties] Properties to set + */ + function DetectedPerson(properties) { + this.detectedPpeIdentifiedBoxes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DetectedPerson personId. + * @member {number|Long} personId + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.DetectedPerson + * @instance + */ + DetectedPerson.prototype.personId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * DetectedPerson detectedPersonIdentifiedBox. + * @member {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.IPersonIdentifiedBox|null|undefined} detectedPersonIdentifiedBox + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.DetectedPerson + * @instance + */ + DetectedPerson.prototype.detectedPersonIdentifiedBox = null; + + /** + * DetectedPerson detectedPpeIdentifiedBoxes. + * @member {Array.} detectedPpeIdentifiedBoxes + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.DetectedPerson + * @instance + */ + DetectedPerson.prototype.detectedPpeIdentifiedBoxes = $util.emptyArray; + + /** + * DetectedPerson faceCoverageScore. + * @member {number|null|undefined} faceCoverageScore + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.DetectedPerson + * @instance + */ + DetectedPerson.prototype.faceCoverageScore = null; + + /** + * DetectedPerson eyesCoverageScore. + * @member {number|null|undefined} eyesCoverageScore + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.DetectedPerson + * @instance + */ + DetectedPerson.prototype.eyesCoverageScore = null; + + /** + * DetectedPerson headCoverageScore. + * @member {number|null|undefined} headCoverageScore + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.DetectedPerson + * @instance + */ + DetectedPerson.prototype.headCoverageScore = null; + + /** + * DetectedPerson handsCoverageScore. + * @member {number|null|undefined} handsCoverageScore + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.DetectedPerson + * @instance + */ + DetectedPerson.prototype.handsCoverageScore = null; + + /** + * DetectedPerson bodyCoverageScore. + * @member {number|null|undefined} bodyCoverageScore + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.DetectedPerson + * @instance + */ + DetectedPerson.prototype.bodyCoverageScore = null; + + /** + * DetectedPerson feetCoverageScore. + * @member {number|null|undefined} feetCoverageScore + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.DetectedPerson + * @instance + */ + DetectedPerson.prototype.feetCoverageScore = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DetectedPerson.prototype, "_faceCoverageScore", { + get: $util.oneOfGetter($oneOfFields = ["faceCoverageScore"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DetectedPerson.prototype, "_eyesCoverageScore", { + get: $util.oneOfGetter($oneOfFields = ["eyesCoverageScore"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DetectedPerson.prototype, "_headCoverageScore", { + get: $util.oneOfGetter($oneOfFields = ["headCoverageScore"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DetectedPerson.prototype, "_handsCoverageScore", { + get: $util.oneOfGetter($oneOfFields = ["handsCoverageScore"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DetectedPerson.prototype, "_bodyCoverageScore", { + get: $util.oneOfGetter($oneOfFields = ["bodyCoverageScore"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DetectedPerson.prototype, "_feetCoverageScore", { + get: $util.oneOfGetter($oneOfFields = ["feetCoverageScore"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DetectedPerson instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.DetectedPerson + * @static + * @param {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.IDetectedPerson=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.DetectedPerson} DetectedPerson instance + */ + DetectedPerson.create = function create(properties) { + return new DetectedPerson(properties); + }; + + /** + * Encodes the specified DetectedPerson message. Does not implicitly {@link google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.DetectedPerson.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.DetectedPerson + * @static + * @param {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.IDetectedPerson} message DetectedPerson message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectedPerson.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.personId != null && Object.hasOwnProperty.call(message, "personId")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.personId); + if (message.detectedPersonIdentifiedBox != null && Object.hasOwnProperty.call(message, "detectedPersonIdentifiedBox")) + $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonIdentifiedBox.encode(message.detectedPersonIdentifiedBox, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.detectedPpeIdentifiedBoxes != null && message.detectedPpeIdentifiedBoxes.length) + for (var i = 0; i < message.detectedPpeIdentifiedBoxes.length; ++i) + $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEIdentifiedBox.encode(message.detectedPpeIdentifiedBoxes[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.faceCoverageScore != null && Object.hasOwnProperty.call(message, "faceCoverageScore")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.faceCoverageScore); + if (message.eyesCoverageScore != null && Object.hasOwnProperty.call(message, "eyesCoverageScore")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.eyesCoverageScore); + if (message.headCoverageScore != null && Object.hasOwnProperty.call(message, "headCoverageScore")) + writer.uint32(/* id 6, wireType 5 =*/53).float(message.headCoverageScore); + if (message.handsCoverageScore != null && Object.hasOwnProperty.call(message, "handsCoverageScore")) + writer.uint32(/* id 7, wireType 5 =*/61).float(message.handsCoverageScore); + if (message.bodyCoverageScore != null && Object.hasOwnProperty.call(message, "bodyCoverageScore")) + writer.uint32(/* id 8, wireType 5 =*/69).float(message.bodyCoverageScore); + if (message.feetCoverageScore != null && Object.hasOwnProperty.call(message, "feetCoverageScore")) + writer.uint32(/* id 9, wireType 5 =*/77).float(message.feetCoverageScore); + return writer; + }; + + /** + * Encodes the specified DetectedPerson message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.DetectedPerson.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.DetectedPerson + * @static + * @param {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.IDetectedPerson} message DetectedPerson message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectedPerson.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DetectedPerson message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.DetectedPerson + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.DetectedPerson} DetectedPerson + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectedPerson.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.DetectedPerson(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.personId = reader.int64(); + break; + } + case 2: { + message.detectedPersonIdentifiedBox = $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonIdentifiedBox.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + if (!(message.detectedPpeIdentifiedBoxes && message.detectedPpeIdentifiedBoxes.length)) + message.detectedPpeIdentifiedBoxes = []; + message.detectedPpeIdentifiedBoxes.push($root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEIdentifiedBox.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 4: { + message.faceCoverageScore = reader.float(); + break; + } + case 5: { + message.eyesCoverageScore = reader.float(); + break; + } + case 6: { + message.headCoverageScore = reader.float(); + break; + } + case 7: { + message.handsCoverageScore = reader.float(); + break; + } + case 8: { + message.bodyCoverageScore = reader.float(); + break; + } + case 9: { + message.feetCoverageScore = reader.float(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DetectedPerson message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.DetectedPerson + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.DetectedPerson} DetectedPerson + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectedPerson.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DetectedPerson message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.DetectedPerson + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DetectedPerson.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.personId != null && message.hasOwnProperty("personId")) + if (!$util.isInteger(message.personId) && !(message.personId && $util.isInteger(message.personId.low) && $util.isInteger(message.personId.high))) + return "personId: integer|Long expected"; + if (message.detectedPersonIdentifiedBox != null && message.hasOwnProperty("detectedPersonIdentifiedBox")) { + var error = $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonIdentifiedBox.verify(message.detectedPersonIdentifiedBox, long + 1); + if (error) + return "detectedPersonIdentifiedBox." + error; + } + if (message.detectedPpeIdentifiedBoxes != null && message.hasOwnProperty("detectedPpeIdentifiedBoxes")) { + if (!Array.isArray(message.detectedPpeIdentifiedBoxes)) + return "detectedPpeIdentifiedBoxes: array expected"; + for (var i = 0; i < message.detectedPpeIdentifiedBoxes.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEIdentifiedBox.verify(message.detectedPpeIdentifiedBoxes[i], long + 1); + if (error) + return "detectedPpeIdentifiedBoxes." + error; + } + } + if (message.faceCoverageScore != null && message.hasOwnProperty("faceCoverageScore")) { + properties._faceCoverageScore = 1; + if (typeof message.faceCoverageScore !== "number") + return "faceCoverageScore: number expected"; + } + if (message.eyesCoverageScore != null && message.hasOwnProperty("eyesCoverageScore")) { + properties._eyesCoverageScore = 1; + if (typeof message.eyesCoverageScore !== "number") + return "eyesCoverageScore: number expected"; + } + if (message.headCoverageScore != null && message.hasOwnProperty("headCoverageScore")) { + properties._headCoverageScore = 1; + if (typeof message.headCoverageScore !== "number") + return "headCoverageScore: number expected"; + } + if (message.handsCoverageScore != null && message.hasOwnProperty("handsCoverageScore")) { + properties._handsCoverageScore = 1; + if (typeof message.handsCoverageScore !== "number") + return "handsCoverageScore: number expected"; + } + if (message.bodyCoverageScore != null && message.hasOwnProperty("bodyCoverageScore")) { + properties._bodyCoverageScore = 1; + if (typeof message.bodyCoverageScore !== "number") + return "bodyCoverageScore: number expected"; + } + if (message.feetCoverageScore != null && message.hasOwnProperty("feetCoverageScore")) { + properties._feetCoverageScore = 1; + if (typeof message.feetCoverageScore !== "number") + return "feetCoverageScore: number expected"; + } + return null; + }; + + /** + * Creates a DetectedPerson message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.DetectedPerson + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.DetectedPerson} DetectedPerson + */ + DetectedPerson.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.DetectedPerson) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.DetectedPerson(); + if (object.personId != null) + if ($util.Long) + (message.personId = $util.Long.fromValue(object.personId)).unsigned = false; + else if (typeof object.personId === "string") + message.personId = parseInt(object.personId, 10); + else if (typeof object.personId === "number") + message.personId = object.personId; + else if (typeof object.personId === "object") + message.personId = new $util.LongBits(object.personId.low >>> 0, object.personId.high >>> 0).toNumber(); + if (object.detectedPersonIdentifiedBox != null) { + if (typeof object.detectedPersonIdentifiedBox !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.DetectedPerson.detectedPersonIdentifiedBox: object expected"); + message.detectedPersonIdentifiedBox = $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonIdentifiedBox.fromObject(object.detectedPersonIdentifiedBox, long + 1); + } + if (object.detectedPpeIdentifiedBoxes) { + if (!Array.isArray(object.detectedPpeIdentifiedBoxes)) + throw TypeError(".google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.DetectedPerson.detectedPpeIdentifiedBoxes: array expected"); + message.detectedPpeIdentifiedBoxes = []; + for (var i = 0; i < object.detectedPpeIdentifiedBoxes.length; ++i) { + if (typeof object.detectedPpeIdentifiedBoxes[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.DetectedPerson.detectedPpeIdentifiedBoxes: object expected"); + message.detectedPpeIdentifiedBoxes[i] = $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEIdentifiedBox.fromObject(object.detectedPpeIdentifiedBoxes[i], long + 1); + } + } + if (object.faceCoverageScore != null) + message.faceCoverageScore = Number(object.faceCoverageScore); + if (object.eyesCoverageScore != null) + message.eyesCoverageScore = Number(object.eyesCoverageScore); + if (object.headCoverageScore != null) + message.headCoverageScore = Number(object.headCoverageScore); + if (object.handsCoverageScore != null) + message.handsCoverageScore = Number(object.handsCoverageScore); + if (object.bodyCoverageScore != null) + message.bodyCoverageScore = Number(object.bodyCoverageScore); + if (object.feetCoverageScore != null) + message.feetCoverageScore = Number(object.feetCoverageScore); + return message; + }; + + /** + * Creates a plain object from a DetectedPerson message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.DetectedPerson + * @static + * @param {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.DetectedPerson} message DetectedPerson + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DetectedPerson.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.detectedPpeIdentifiedBoxes = []; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.personId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.personId = options.longs === String ? "0" : 0; + object.detectedPersonIdentifiedBox = null; + } + if (message.personId != null && message.hasOwnProperty("personId")) + if (typeof message.personId === "number") + object.personId = options.longs === String ? String(message.personId) : message.personId; + else + object.personId = options.longs === String ? $util.Long.prototype.toString.call(message.personId) : options.longs === Number ? new $util.LongBits(message.personId.low >>> 0, message.personId.high >>> 0).toNumber() : message.personId; + if (message.detectedPersonIdentifiedBox != null && message.hasOwnProperty("detectedPersonIdentifiedBox")) + object.detectedPersonIdentifiedBox = $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PersonIdentifiedBox.toObject(message.detectedPersonIdentifiedBox, options); + if (message.detectedPpeIdentifiedBoxes && message.detectedPpeIdentifiedBoxes.length) { + object.detectedPpeIdentifiedBoxes = []; + for (var j = 0; j < message.detectedPpeIdentifiedBoxes.length; ++j) + object.detectedPpeIdentifiedBoxes[j] = $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.PPEIdentifiedBox.toObject(message.detectedPpeIdentifiedBoxes[j], options); + } + if (message.faceCoverageScore != null && message.hasOwnProperty("faceCoverageScore")) { + object.faceCoverageScore = options.json && !isFinite(message.faceCoverageScore) ? String(message.faceCoverageScore) : message.faceCoverageScore; + if (options.oneofs) + object._faceCoverageScore = "faceCoverageScore"; + } + if (message.eyesCoverageScore != null && message.hasOwnProperty("eyesCoverageScore")) { + object.eyesCoverageScore = options.json && !isFinite(message.eyesCoverageScore) ? String(message.eyesCoverageScore) : message.eyesCoverageScore; + if (options.oneofs) + object._eyesCoverageScore = "eyesCoverageScore"; + } + if (message.headCoverageScore != null && message.hasOwnProperty("headCoverageScore")) { + object.headCoverageScore = options.json && !isFinite(message.headCoverageScore) ? String(message.headCoverageScore) : message.headCoverageScore; + if (options.oneofs) + object._headCoverageScore = "headCoverageScore"; + } + if (message.handsCoverageScore != null && message.hasOwnProperty("handsCoverageScore")) { + object.handsCoverageScore = options.json && !isFinite(message.handsCoverageScore) ? String(message.handsCoverageScore) : message.handsCoverageScore; + if (options.oneofs) + object._handsCoverageScore = "handsCoverageScore"; + } + if (message.bodyCoverageScore != null && message.hasOwnProperty("bodyCoverageScore")) { + object.bodyCoverageScore = options.json && !isFinite(message.bodyCoverageScore) ? String(message.bodyCoverageScore) : message.bodyCoverageScore; + if (options.oneofs) + object._bodyCoverageScore = "bodyCoverageScore"; + } + if (message.feetCoverageScore != null && message.hasOwnProperty("feetCoverageScore")) { + object.feetCoverageScore = options.json && !isFinite(message.feetCoverageScore) ? String(message.feetCoverageScore) : message.feetCoverageScore; + if (options.oneofs) + object._feetCoverageScore = "feetCoverageScore"; + } + return object; + }; + + /** + * Converts this DetectedPerson to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.DetectedPerson + * @instance + * @returns {Object.} JSON object + */ + DetectedPerson.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DetectedPerson + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.DetectedPerson + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DetectedPerson.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionOutput.DetectedPerson"; + }; + + return DetectedPerson; + })(); + + return PersonalProtectiveEquipmentDetectionOutput; + })(); + + v1alpha1.ObjectDetectionPredictionResult = (function() { + + /** + * Properties of an ObjectDetectionPredictionResult. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IObjectDetectionPredictionResult + * @property {google.protobuf.ITimestamp|null} [currentTime] ObjectDetectionPredictionResult currentTime + * @property {Array.|null} [identifiedBoxes] ObjectDetectionPredictionResult identifiedBoxes + */ + + /** + * Constructs a new ObjectDetectionPredictionResult. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents an ObjectDetectionPredictionResult. + * @implements IObjectDetectionPredictionResult + * @constructor + * @param {google.cloud.visionai.v1alpha1.IObjectDetectionPredictionResult=} [properties] Properties to set + */ + function ObjectDetectionPredictionResult(properties) { + this.identifiedBoxes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ObjectDetectionPredictionResult currentTime. + * @member {google.protobuf.ITimestamp|null|undefined} currentTime + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult + * @instance + */ + ObjectDetectionPredictionResult.prototype.currentTime = null; + + /** + * ObjectDetectionPredictionResult identifiedBoxes. + * @member {Array.} identifiedBoxes + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult + * @instance + */ + ObjectDetectionPredictionResult.prototype.identifiedBoxes = $util.emptyArray; + + /** + * Creates a new ObjectDetectionPredictionResult instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult + * @static + * @param {google.cloud.visionai.v1alpha1.IObjectDetectionPredictionResult=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult} ObjectDetectionPredictionResult instance + */ + ObjectDetectionPredictionResult.create = function create(properties) { + return new ObjectDetectionPredictionResult(properties); + }; + + /** + * Encodes the specified ObjectDetectionPredictionResult message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult + * @static + * @param {google.cloud.visionai.v1alpha1.IObjectDetectionPredictionResult} message ObjectDetectionPredictionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObjectDetectionPredictionResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.currentTime != null && Object.hasOwnProperty.call(message, "currentTime")) + $root.google.protobuf.Timestamp.encode(message.currentTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.identifiedBoxes != null && message.identifiedBoxes.length) + for (var i = 0; i < message.identifiedBoxes.length; ++i) + $root.google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.encode(message.identifiedBoxes[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ObjectDetectionPredictionResult message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult + * @static + * @param {google.cloud.visionai.v1alpha1.IObjectDetectionPredictionResult} message ObjectDetectionPredictionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObjectDetectionPredictionResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ObjectDetectionPredictionResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult} ObjectDetectionPredictionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObjectDetectionPredictionResult.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.currentTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + if (!(message.identifiedBoxes && message.identifiedBoxes.length)) + message.identifiedBoxes = []; + message.identifiedBoxes.push($root.google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ObjectDetectionPredictionResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult} ObjectDetectionPredictionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObjectDetectionPredictionResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ObjectDetectionPredictionResult message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ObjectDetectionPredictionResult.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.currentTime != null && message.hasOwnProperty("currentTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.currentTime, long + 1); + if (error) + return "currentTime." + error; + } + if (message.identifiedBoxes != null && message.hasOwnProperty("identifiedBoxes")) { + if (!Array.isArray(message.identifiedBoxes)) + return "identifiedBoxes: array expected"; + for (var i = 0; i < message.identifiedBoxes.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.verify(message.identifiedBoxes[i], long + 1); + if (error) + return "identifiedBoxes." + error; + } + } + return null; + }; + + /** + * Creates an ObjectDetectionPredictionResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult} ObjectDetectionPredictionResult + */ + ObjectDetectionPredictionResult.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult(); + if (object.currentTime != null) { + if (typeof object.currentTime !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.currentTime: object expected"); + message.currentTime = $root.google.protobuf.Timestamp.fromObject(object.currentTime, long + 1); + } + if (object.identifiedBoxes) { + if (!Array.isArray(object.identifiedBoxes)) + throw TypeError(".google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.identifiedBoxes: array expected"); + message.identifiedBoxes = []; + for (var i = 0; i < object.identifiedBoxes.length; ++i) { + if (typeof object.identifiedBoxes[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.identifiedBoxes: object expected"); + message.identifiedBoxes[i] = $root.google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.fromObject(object.identifiedBoxes[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from an ObjectDetectionPredictionResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult + * @static + * @param {google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult} message ObjectDetectionPredictionResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ObjectDetectionPredictionResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.identifiedBoxes = []; + if (options.defaults) + object.currentTime = null; + if (message.currentTime != null && message.hasOwnProperty("currentTime")) + object.currentTime = $root.google.protobuf.Timestamp.toObject(message.currentTime, options); + if (message.identifiedBoxes && message.identifiedBoxes.length) { + object.identifiedBoxes = []; + for (var j = 0; j < message.identifiedBoxes.length; ++j) + object.identifiedBoxes[j] = $root.google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.toObject(message.identifiedBoxes[j], options); + } + return object; + }; + + /** + * Converts this ObjectDetectionPredictionResult to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult + * @instance + * @returns {Object.} JSON object + */ + ObjectDetectionPredictionResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ObjectDetectionPredictionResult + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ObjectDetectionPredictionResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult"; + }; + + ObjectDetectionPredictionResult.Entity = (function() { + + /** + * Properties of an Entity. + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult + * @interface IEntity + * @property {number|Long|null} [labelId] Entity labelId + * @property {string|null} [labelString] Entity labelString + */ + + /** + * Constructs a new Entity. + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult + * @classdesc Represents an Entity. + * @implements IEntity + * @constructor + * @param {google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IEntity=} [properties] Properties to set + */ + function Entity(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Entity labelId. + * @member {number|Long} labelId + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.Entity + * @instance + */ + Entity.prototype.labelId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Entity labelString. + * @member {string} labelString + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.Entity + * @instance + */ + Entity.prototype.labelString = ""; + + /** + * Creates a new Entity instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.Entity + * @static + * @param {google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IEntity=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.Entity} Entity instance + */ + Entity.create = function create(properties) { + return new Entity(properties); + }; + + /** + * Encodes the specified Entity message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.Entity.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.Entity + * @static + * @param {google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IEntity} message Entity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.labelId != null && Object.hasOwnProperty.call(message, "labelId")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.labelId); + if (message.labelString != null && Object.hasOwnProperty.call(message, "labelString")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.labelString); + return writer; + }; + + /** + * Encodes the specified Entity message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.Entity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.Entity + * @static + * @param {google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IEntity} message Entity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Entity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.Entity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.Entity} Entity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entity.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.Entity(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.labelId = reader.int64(); + break; + } + case 2: { + message.labelString = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an Entity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.Entity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.Entity} Entity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Entity message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.Entity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Entity.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.labelId != null && message.hasOwnProperty("labelId")) + if (!$util.isInteger(message.labelId) && !(message.labelId && $util.isInteger(message.labelId.low) && $util.isInteger(message.labelId.high))) + return "labelId: integer|Long expected"; + if (message.labelString != null && message.hasOwnProperty("labelString")) + if (!$util.isString(message.labelString)) + return "labelString: string expected"; + return null; + }; + + /** + * Creates an Entity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.Entity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.Entity} Entity + */ + Entity.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.Entity) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.Entity(); + if (object.labelId != null) + if ($util.Long) + (message.labelId = $util.Long.fromValue(object.labelId)).unsigned = false; + else if (typeof object.labelId === "string") + message.labelId = parseInt(object.labelId, 10); + else if (typeof object.labelId === "number") + message.labelId = object.labelId; + else if (typeof object.labelId === "object") + message.labelId = new $util.LongBits(object.labelId.low >>> 0, object.labelId.high >>> 0).toNumber(); + if (object.labelString != null) + message.labelString = String(object.labelString); + return message; + }; + + /** + * Creates a plain object from an Entity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.Entity + * @static + * @param {google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.Entity} message Entity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Entity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.labelId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.labelId = options.longs === String ? "0" : 0; + object.labelString = ""; + } + if (message.labelId != null && message.hasOwnProperty("labelId")) + if (typeof message.labelId === "number") + object.labelId = options.longs === String ? String(message.labelId) : message.labelId; + else + object.labelId = options.longs === String ? $util.Long.prototype.toString.call(message.labelId) : options.longs === Number ? new $util.LongBits(message.labelId.low >>> 0, message.labelId.high >>> 0).toNumber() : message.labelId; + if (message.labelString != null && message.hasOwnProperty("labelString")) + object.labelString = message.labelString; + return object; + }; + + /** + * Converts this Entity to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.Entity + * @instance + * @returns {Object.} JSON object + */ + Entity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Entity + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.Entity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Entity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.Entity"; + }; + + return Entity; + })(); + + ObjectDetectionPredictionResult.IdentifiedBox = (function() { + + /** + * Properties of an IdentifiedBox. + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult + * @interface IIdentifiedBox + * @property {number|Long|null} [boxId] IdentifiedBox boxId + * @property {google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.INormalizedBoundingBox|null} [normalizedBoundingBox] IdentifiedBox normalizedBoundingBox + * @property {number|null} [confidenceScore] IdentifiedBox confidenceScore + * @property {google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IEntity|null} [entity] IdentifiedBox entity + */ + + /** + * Constructs a new IdentifiedBox. + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult + * @classdesc Represents an IdentifiedBox. + * @implements IIdentifiedBox + * @constructor + * @param {google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IIdentifiedBox=} [properties] Properties to set + */ + function IdentifiedBox(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * IdentifiedBox boxId. + * @member {number|Long} boxId + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox + * @instance + */ + IdentifiedBox.prototype.boxId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * IdentifiedBox normalizedBoundingBox. + * @member {google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.INormalizedBoundingBox|null|undefined} normalizedBoundingBox + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox + * @instance + */ + IdentifiedBox.prototype.normalizedBoundingBox = null; + + /** + * IdentifiedBox confidenceScore. + * @member {number} confidenceScore + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox + * @instance + */ + IdentifiedBox.prototype.confidenceScore = 0; + + /** + * IdentifiedBox entity. + * @member {google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IEntity|null|undefined} entity + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox + * @instance + */ + IdentifiedBox.prototype.entity = null; + + /** + * Creates a new IdentifiedBox instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox + * @static + * @param {google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IIdentifiedBox=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox} IdentifiedBox instance + */ + IdentifiedBox.create = function create(properties) { + return new IdentifiedBox(properties); + }; + + /** + * Encodes the specified IdentifiedBox message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox + * @static + * @param {google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IIdentifiedBox} message IdentifiedBox message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentifiedBox.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.boxId != null && Object.hasOwnProperty.call(message, "boxId")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.boxId); + if (message.normalizedBoundingBox != null && Object.hasOwnProperty.call(message, "normalizedBoundingBox")) + $root.google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.NormalizedBoundingBox.encode(message.normalizedBoundingBox, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.confidenceScore != null && Object.hasOwnProperty.call(message, "confidenceScore")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.confidenceScore); + if (message.entity != null && Object.hasOwnProperty.call(message, "entity")) + $root.google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.Entity.encode(message.entity, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IdentifiedBox message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox + * @static + * @param {google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IIdentifiedBox} message IdentifiedBox message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentifiedBox.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IdentifiedBox message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox} IdentifiedBox + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentifiedBox.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.boxId = reader.int64(); + break; + } + case 2: { + message.normalizedBoundingBox = $root.google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.NormalizedBoundingBox.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.confidenceScore = reader.float(); + break; + } + case 4: { + message.entity = $root.google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.Entity.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an IdentifiedBox message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox} IdentifiedBox + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentifiedBox.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IdentifiedBox message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IdentifiedBox.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.boxId != null && message.hasOwnProperty("boxId")) + if (!$util.isInteger(message.boxId) && !(message.boxId && $util.isInteger(message.boxId.low) && $util.isInteger(message.boxId.high))) + return "boxId: integer|Long expected"; + if (message.normalizedBoundingBox != null && message.hasOwnProperty("normalizedBoundingBox")) { + var error = $root.google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.NormalizedBoundingBox.verify(message.normalizedBoundingBox, long + 1); + if (error) + return "normalizedBoundingBox." + error; + } + if (message.confidenceScore != null && message.hasOwnProperty("confidenceScore")) + if (typeof message.confidenceScore !== "number") + return "confidenceScore: number expected"; + if (message.entity != null && message.hasOwnProperty("entity")) { + var error = $root.google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.Entity.verify(message.entity, long + 1); + if (error) + return "entity." + error; + } + return null; + }; + + /** + * Creates an IdentifiedBox message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox} IdentifiedBox + */ + IdentifiedBox.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox(); + if (object.boxId != null) + if ($util.Long) + (message.boxId = $util.Long.fromValue(object.boxId)).unsigned = false; + else if (typeof object.boxId === "string") + message.boxId = parseInt(object.boxId, 10); + else if (typeof object.boxId === "number") + message.boxId = object.boxId; + else if (typeof object.boxId === "object") + message.boxId = new $util.LongBits(object.boxId.low >>> 0, object.boxId.high >>> 0).toNumber(); + if (object.normalizedBoundingBox != null) { + if (typeof object.normalizedBoundingBox !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.normalizedBoundingBox: object expected"); + message.normalizedBoundingBox = $root.google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.NormalizedBoundingBox.fromObject(object.normalizedBoundingBox, long + 1); + } + if (object.confidenceScore != null) + message.confidenceScore = Number(object.confidenceScore); + if (object.entity != null) { + if (typeof object.entity !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.entity: object expected"); + message.entity = $root.google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.Entity.fromObject(object.entity, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an IdentifiedBox message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox + * @static + * @param {google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox} message IdentifiedBox + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IdentifiedBox.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.boxId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.boxId = options.longs === String ? "0" : 0; + object.normalizedBoundingBox = null; + object.confidenceScore = 0; + object.entity = null; + } + if (message.boxId != null && message.hasOwnProperty("boxId")) + if (typeof message.boxId === "number") + object.boxId = options.longs === String ? String(message.boxId) : message.boxId; + else + object.boxId = options.longs === String ? $util.Long.prototype.toString.call(message.boxId) : options.longs === Number ? new $util.LongBits(message.boxId.low >>> 0, message.boxId.high >>> 0).toNumber() : message.boxId; + if (message.normalizedBoundingBox != null && message.hasOwnProperty("normalizedBoundingBox")) + object.normalizedBoundingBox = $root.google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.NormalizedBoundingBox.toObject(message.normalizedBoundingBox, options); + if (message.confidenceScore != null && message.hasOwnProperty("confidenceScore")) + object.confidenceScore = options.json && !isFinite(message.confidenceScore) ? String(message.confidenceScore) : message.confidenceScore; + if (message.entity != null && message.hasOwnProperty("entity")) + object.entity = $root.google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.Entity.toObject(message.entity, options); + return object; + }; + + /** + * Converts this IdentifiedBox to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox + * @instance + * @returns {Object.} JSON object + */ + IdentifiedBox.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IdentifiedBox + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IdentifiedBox.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox"; + }; + + IdentifiedBox.NormalizedBoundingBox = (function() { + + /** + * Properties of a NormalizedBoundingBox. + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox + * @interface INormalizedBoundingBox + * @property {number|null} [xmin] NormalizedBoundingBox xmin + * @property {number|null} [ymin] NormalizedBoundingBox ymin + * @property {number|null} [width] NormalizedBoundingBox width + * @property {number|null} [height] NormalizedBoundingBox height + */ + + /** + * Constructs a new NormalizedBoundingBox. + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox + * @classdesc Represents a NormalizedBoundingBox. + * @implements INormalizedBoundingBox + * @constructor + * @param {google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.INormalizedBoundingBox=} [properties] Properties to set + */ + function NormalizedBoundingBox(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * NormalizedBoundingBox xmin. + * @member {number} xmin + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.NormalizedBoundingBox + * @instance + */ + NormalizedBoundingBox.prototype.xmin = 0; + + /** + * NormalizedBoundingBox ymin. + * @member {number} ymin + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.NormalizedBoundingBox + * @instance + */ + NormalizedBoundingBox.prototype.ymin = 0; + + /** + * NormalizedBoundingBox width. + * @member {number} width + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.NormalizedBoundingBox + * @instance + */ + NormalizedBoundingBox.prototype.width = 0; + + /** + * NormalizedBoundingBox height. + * @member {number} height + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.NormalizedBoundingBox + * @instance + */ + NormalizedBoundingBox.prototype.height = 0; + + /** + * Creates a new NormalizedBoundingBox instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.NormalizedBoundingBox + * @static + * @param {google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.INormalizedBoundingBox=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.NormalizedBoundingBox} NormalizedBoundingBox instance + */ + NormalizedBoundingBox.create = function create(properties) { + return new NormalizedBoundingBox(properties); + }; + + /** + * Encodes the specified NormalizedBoundingBox message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.NormalizedBoundingBox.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.NormalizedBoundingBox + * @static + * @param {google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.INormalizedBoundingBox} message NormalizedBoundingBox message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NormalizedBoundingBox.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.xmin != null && Object.hasOwnProperty.call(message, "xmin")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.xmin); + if (message.ymin != null && Object.hasOwnProperty.call(message, "ymin")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.ymin); + if (message.width != null && Object.hasOwnProperty.call(message, "width")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.width); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.height); + return writer; + }; + + /** + * Encodes the specified NormalizedBoundingBox message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.NormalizedBoundingBox.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.NormalizedBoundingBox + * @static + * @param {google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.INormalizedBoundingBox} message NormalizedBoundingBox message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NormalizedBoundingBox.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NormalizedBoundingBox message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.NormalizedBoundingBox + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.NormalizedBoundingBox} NormalizedBoundingBox + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NormalizedBoundingBox.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.NormalizedBoundingBox(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.xmin = reader.float(); + break; + } + case 2: { + message.ymin = reader.float(); + break; + } + case 3: { + message.width = reader.float(); + break; + } + case 4: { + message.height = reader.float(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a NormalizedBoundingBox message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.NormalizedBoundingBox + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.NormalizedBoundingBox} NormalizedBoundingBox + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NormalizedBoundingBox.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NormalizedBoundingBox message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.NormalizedBoundingBox + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NormalizedBoundingBox.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.xmin != null && message.hasOwnProperty("xmin")) + if (typeof message.xmin !== "number") + return "xmin: number expected"; + if (message.ymin != null && message.hasOwnProperty("ymin")) + if (typeof message.ymin !== "number") + return "ymin: number expected"; + if (message.width != null && message.hasOwnProperty("width")) + if (typeof message.width !== "number") + return "width: number expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (typeof message.height !== "number") + return "height: number expected"; + return null; + }; + + /** + * Creates a NormalizedBoundingBox message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.NormalizedBoundingBox + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.NormalizedBoundingBox} NormalizedBoundingBox + */ + NormalizedBoundingBox.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.NormalizedBoundingBox) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.NormalizedBoundingBox(); + if (object.xmin != null) + message.xmin = Number(object.xmin); + if (object.ymin != null) + message.ymin = Number(object.ymin); + if (object.width != null) + message.width = Number(object.width); + if (object.height != null) + message.height = Number(object.height); + return message; + }; + + /** + * Creates a plain object from a NormalizedBoundingBox message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.NormalizedBoundingBox + * @static + * @param {google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.NormalizedBoundingBox} message NormalizedBoundingBox + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NormalizedBoundingBox.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.xmin = 0; + object.ymin = 0; + object.width = 0; + object.height = 0; + } + if (message.xmin != null && message.hasOwnProperty("xmin")) + object.xmin = options.json && !isFinite(message.xmin) ? String(message.xmin) : message.xmin; + if (message.ymin != null && message.hasOwnProperty("ymin")) + object.ymin = options.json && !isFinite(message.ymin) ? String(message.ymin) : message.ymin; + if (message.width != null && message.hasOwnProperty("width")) + object.width = options.json && !isFinite(message.width) ? String(message.width) : message.width; + if (message.height != null && message.hasOwnProperty("height")) + object.height = options.json && !isFinite(message.height) ? String(message.height) : message.height; + return object; + }; + + /** + * Converts this NormalizedBoundingBox to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.NormalizedBoundingBox + * @instance + * @returns {Object.} JSON object + */ + NormalizedBoundingBox.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NormalizedBoundingBox + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.NormalizedBoundingBox + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NormalizedBoundingBox.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ObjectDetectionPredictionResult.IdentifiedBox.NormalizedBoundingBox"; + }; + + return NormalizedBoundingBox; + })(); + + return IdentifiedBox; + })(); + + return ObjectDetectionPredictionResult; + })(); + + v1alpha1.ImageObjectDetectionPredictionResult = (function() { + + /** + * Properties of an ImageObjectDetectionPredictionResult. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IImageObjectDetectionPredictionResult + * @property {Array.|null} [ids] ImageObjectDetectionPredictionResult ids + * @property {Array.|null} [displayNames] ImageObjectDetectionPredictionResult displayNames + * @property {Array.|null} [confidences] ImageObjectDetectionPredictionResult confidences + * @property {Array.|null} [bboxes] ImageObjectDetectionPredictionResult bboxes + */ + + /** + * Constructs a new ImageObjectDetectionPredictionResult. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents an ImageObjectDetectionPredictionResult. + * @implements IImageObjectDetectionPredictionResult + * @constructor + * @param {google.cloud.visionai.v1alpha1.IImageObjectDetectionPredictionResult=} [properties] Properties to set + */ + function ImageObjectDetectionPredictionResult(properties) { + this.ids = []; + this.displayNames = []; + this.confidences = []; + this.bboxes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImageObjectDetectionPredictionResult ids. + * @member {Array.} ids + * @memberof google.cloud.visionai.v1alpha1.ImageObjectDetectionPredictionResult + * @instance + */ + ImageObjectDetectionPredictionResult.prototype.ids = $util.emptyArray; + + /** + * ImageObjectDetectionPredictionResult displayNames. + * @member {Array.} displayNames + * @memberof google.cloud.visionai.v1alpha1.ImageObjectDetectionPredictionResult + * @instance + */ + ImageObjectDetectionPredictionResult.prototype.displayNames = $util.emptyArray; + + /** + * ImageObjectDetectionPredictionResult confidences. + * @member {Array.} confidences + * @memberof google.cloud.visionai.v1alpha1.ImageObjectDetectionPredictionResult + * @instance + */ + ImageObjectDetectionPredictionResult.prototype.confidences = $util.emptyArray; + + /** + * ImageObjectDetectionPredictionResult bboxes. + * @member {Array.} bboxes + * @memberof google.cloud.visionai.v1alpha1.ImageObjectDetectionPredictionResult + * @instance + */ + ImageObjectDetectionPredictionResult.prototype.bboxes = $util.emptyArray; + + /** + * Creates a new ImageObjectDetectionPredictionResult instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ImageObjectDetectionPredictionResult + * @static + * @param {google.cloud.visionai.v1alpha1.IImageObjectDetectionPredictionResult=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ImageObjectDetectionPredictionResult} ImageObjectDetectionPredictionResult instance + */ + ImageObjectDetectionPredictionResult.create = function create(properties) { + return new ImageObjectDetectionPredictionResult(properties); + }; + + /** + * Encodes the specified ImageObjectDetectionPredictionResult message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ImageObjectDetectionPredictionResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ImageObjectDetectionPredictionResult + * @static + * @param {google.cloud.visionai.v1alpha1.IImageObjectDetectionPredictionResult} message ImageObjectDetectionPredictionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageObjectDetectionPredictionResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ids != null && message.ids.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.ids.length; ++i) + writer.int64(message.ids[i]); + writer.ldelim(); + } + if (message.displayNames != null && message.displayNames.length) + for (var i = 0; i < message.displayNames.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayNames[i]); + if (message.confidences != null && message.confidences.length) { + writer.uint32(/* id 3, wireType 2 =*/26).fork(); + for (var i = 0; i < message.confidences.length; ++i) + writer.float(message.confidences[i]); + writer.ldelim(); + } + if (message.bboxes != null && message.bboxes.length) + for (var i = 0; i < message.bboxes.length; ++i) + $root.google.protobuf.ListValue.encode(message.bboxes[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImageObjectDetectionPredictionResult message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ImageObjectDetectionPredictionResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ImageObjectDetectionPredictionResult + * @static + * @param {google.cloud.visionai.v1alpha1.IImageObjectDetectionPredictionResult} message ImageObjectDetectionPredictionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageObjectDetectionPredictionResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageObjectDetectionPredictionResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ImageObjectDetectionPredictionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ImageObjectDetectionPredictionResult} ImageObjectDetectionPredictionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageObjectDetectionPredictionResult.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ImageObjectDetectionPredictionResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.ids && message.ids.length)) + message.ids = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.ids.push(reader.int64()); + } else + message.ids.push(reader.int64()); + break; + } + case 2: { + if (!(message.displayNames && message.displayNames.length)) + message.displayNames = []; + message.displayNames.push(reader.string()); + break; + } + case 3: { + if (!(message.confidences && message.confidences.length)) + message.confidences = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.confidences.push(reader.float()); + } else + message.confidences.push(reader.float()); + break; + } + case 4: { + if (!(message.bboxes && message.bboxes.length)) + message.bboxes = []; + message.bboxes.push($root.google.protobuf.ListValue.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ImageObjectDetectionPredictionResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ImageObjectDetectionPredictionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ImageObjectDetectionPredictionResult} ImageObjectDetectionPredictionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageObjectDetectionPredictionResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageObjectDetectionPredictionResult message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ImageObjectDetectionPredictionResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageObjectDetectionPredictionResult.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.ids != null && message.hasOwnProperty("ids")) { + if (!Array.isArray(message.ids)) + return "ids: array expected"; + for (var i = 0; i < message.ids.length; ++i) + if (!$util.isInteger(message.ids[i]) && !(message.ids[i] && $util.isInteger(message.ids[i].low) && $util.isInteger(message.ids[i].high))) + return "ids: integer|Long[] expected"; + } + if (message.displayNames != null && message.hasOwnProperty("displayNames")) { + if (!Array.isArray(message.displayNames)) + return "displayNames: array expected"; + for (var i = 0; i < message.displayNames.length; ++i) + if (!$util.isString(message.displayNames[i])) + return "displayNames: string[] expected"; + } + if (message.confidences != null && message.hasOwnProperty("confidences")) { + if (!Array.isArray(message.confidences)) + return "confidences: array expected"; + for (var i = 0; i < message.confidences.length; ++i) + if (typeof message.confidences[i] !== "number") + return "confidences: number[] expected"; + } + if (message.bboxes != null && message.hasOwnProperty("bboxes")) { + if (!Array.isArray(message.bboxes)) + return "bboxes: array expected"; + for (var i = 0; i < message.bboxes.length; ++i) { + var error = $root.google.protobuf.ListValue.verify(message.bboxes[i], long + 1); + if (error) + return "bboxes." + error; + } + } + return null; + }; + + /** + * Creates an ImageObjectDetectionPredictionResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ImageObjectDetectionPredictionResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ImageObjectDetectionPredictionResult} ImageObjectDetectionPredictionResult + */ + ImageObjectDetectionPredictionResult.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ImageObjectDetectionPredictionResult) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ImageObjectDetectionPredictionResult(); + if (object.ids) { + if (!Array.isArray(object.ids)) + throw TypeError(".google.cloud.visionai.v1alpha1.ImageObjectDetectionPredictionResult.ids: array expected"); + message.ids = []; + for (var i = 0; i < object.ids.length; ++i) + if ($util.Long) + (message.ids[i] = $util.Long.fromValue(object.ids[i])).unsigned = false; + else if (typeof object.ids[i] === "string") + message.ids[i] = parseInt(object.ids[i], 10); + else if (typeof object.ids[i] === "number") + message.ids[i] = object.ids[i]; + else if (typeof object.ids[i] === "object") + message.ids[i] = new $util.LongBits(object.ids[i].low >>> 0, object.ids[i].high >>> 0).toNumber(); + } + if (object.displayNames) { + if (!Array.isArray(object.displayNames)) + throw TypeError(".google.cloud.visionai.v1alpha1.ImageObjectDetectionPredictionResult.displayNames: array expected"); + message.displayNames = []; + for (var i = 0; i < object.displayNames.length; ++i) + message.displayNames[i] = String(object.displayNames[i]); + } + if (object.confidences) { + if (!Array.isArray(object.confidences)) + throw TypeError(".google.cloud.visionai.v1alpha1.ImageObjectDetectionPredictionResult.confidences: array expected"); + message.confidences = []; + for (var i = 0; i < object.confidences.length; ++i) + message.confidences[i] = Number(object.confidences[i]); + } + if (object.bboxes) { + if (!Array.isArray(object.bboxes)) + throw TypeError(".google.cloud.visionai.v1alpha1.ImageObjectDetectionPredictionResult.bboxes: array expected"); + message.bboxes = []; + for (var i = 0; i < object.bboxes.length; ++i) { + if (typeof object.bboxes[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ImageObjectDetectionPredictionResult.bboxes: object expected"); + message.bboxes[i] = $root.google.protobuf.ListValue.fromObject(object.bboxes[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from an ImageObjectDetectionPredictionResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ImageObjectDetectionPredictionResult + * @static + * @param {google.cloud.visionai.v1alpha1.ImageObjectDetectionPredictionResult} message ImageObjectDetectionPredictionResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageObjectDetectionPredictionResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ids = []; + object.displayNames = []; + object.confidences = []; + object.bboxes = []; + } + if (message.ids && message.ids.length) { + object.ids = []; + for (var j = 0; j < message.ids.length; ++j) + if (typeof message.ids[j] === "number") + object.ids[j] = options.longs === String ? String(message.ids[j]) : message.ids[j]; + else + object.ids[j] = options.longs === String ? $util.Long.prototype.toString.call(message.ids[j]) : options.longs === Number ? new $util.LongBits(message.ids[j].low >>> 0, message.ids[j].high >>> 0).toNumber() : message.ids[j]; + } + if (message.displayNames && message.displayNames.length) { + object.displayNames = []; + for (var j = 0; j < message.displayNames.length; ++j) + object.displayNames[j] = message.displayNames[j]; + } + if (message.confidences && message.confidences.length) { + object.confidences = []; + for (var j = 0; j < message.confidences.length; ++j) + object.confidences[j] = options.json && !isFinite(message.confidences[j]) ? String(message.confidences[j]) : message.confidences[j]; + } + if (message.bboxes && message.bboxes.length) { + object.bboxes = []; + for (var j = 0; j < message.bboxes.length; ++j) + object.bboxes[j] = $root.google.protobuf.ListValue.toObject(message.bboxes[j], options); + } + return object; + }; + + /** + * Converts this ImageObjectDetectionPredictionResult to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ImageObjectDetectionPredictionResult + * @instance + * @returns {Object.} JSON object + */ + ImageObjectDetectionPredictionResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImageObjectDetectionPredictionResult + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ImageObjectDetectionPredictionResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImageObjectDetectionPredictionResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ImageObjectDetectionPredictionResult"; + }; + + return ImageObjectDetectionPredictionResult; + })(); + + v1alpha1.ClassificationPredictionResult = (function() { + + /** + * Properties of a ClassificationPredictionResult. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IClassificationPredictionResult + * @property {Array.|null} [ids] ClassificationPredictionResult ids + * @property {Array.|null} [displayNames] ClassificationPredictionResult displayNames + * @property {Array.|null} [confidences] ClassificationPredictionResult confidences + */ + + /** + * Constructs a new ClassificationPredictionResult. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a ClassificationPredictionResult. + * @implements IClassificationPredictionResult + * @constructor + * @param {google.cloud.visionai.v1alpha1.IClassificationPredictionResult=} [properties] Properties to set + */ + function ClassificationPredictionResult(properties) { + this.ids = []; + this.displayNames = []; + this.confidences = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClassificationPredictionResult ids. + * @member {Array.} ids + * @memberof google.cloud.visionai.v1alpha1.ClassificationPredictionResult + * @instance + */ + ClassificationPredictionResult.prototype.ids = $util.emptyArray; + + /** + * ClassificationPredictionResult displayNames. + * @member {Array.} displayNames + * @memberof google.cloud.visionai.v1alpha1.ClassificationPredictionResult + * @instance + */ + ClassificationPredictionResult.prototype.displayNames = $util.emptyArray; + + /** + * ClassificationPredictionResult confidences. + * @member {Array.} confidences + * @memberof google.cloud.visionai.v1alpha1.ClassificationPredictionResult + * @instance + */ + ClassificationPredictionResult.prototype.confidences = $util.emptyArray; + + /** + * Creates a new ClassificationPredictionResult instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ClassificationPredictionResult + * @static + * @param {google.cloud.visionai.v1alpha1.IClassificationPredictionResult=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ClassificationPredictionResult} ClassificationPredictionResult instance + */ + ClassificationPredictionResult.create = function create(properties) { + return new ClassificationPredictionResult(properties); + }; + + /** + * Encodes the specified ClassificationPredictionResult message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ClassificationPredictionResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ClassificationPredictionResult + * @static + * @param {google.cloud.visionai.v1alpha1.IClassificationPredictionResult} message ClassificationPredictionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClassificationPredictionResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ids != null && message.ids.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.ids.length; ++i) + writer.int64(message.ids[i]); + writer.ldelim(); + } + if (message.displayNames != null && message.displayNames.length) + for (var i = 0; i < message.displayNames.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayNames[i]); + if (message.confidences != null && message.confidences.length) { + writer.uint32(/* id 3, wireType 2 =*/26).fork(); + for (var i = 0; i < message.confidences.length; ++i) + writer.float(message.confidences[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ClassificationPredictionResult message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ClassificationPredictionResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ClassificationPredictionResult + * @static + * @param {google.cloud.visionai.v1alpha1.IClassificationPredictionResult} message ClassificationPredictionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClassificationPredictionResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClassificationPredictionResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ClassificationPredictionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ClassificationPredictionResult} ClassificationPredictionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClassificationPredictionResult.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ClassificationPredictionResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.ids && message.ids.length)) + message.ids = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.ids.push(reader.int64()); + } else + message.ids.push(reader.int64()); + break; + } + case 2: { + if (!(message.displayNames && message.displayNames.length)) + message.displayNames = []; + message.displayNames.push(reader.string()); + break; + } + case 3: { + if (!(message.confidences && message.confidences.length)) + message.confidences = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.confidences.push(reader.float()); + } else + message.confidences.push(reader.float()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ClassificationPredictionResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ClassificationPredictionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ClassificationPredictionResult} ClassificationPredictionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClassificationPredictionResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClassificationPredictionResult message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ClassificationPredictionResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClassificationPredictionResult.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.ids != null && message.hasOwnProperty("ids")) { + if (!Array.isArray(message.ids)) + return "ids: array expected"; + for (var i = 0; i < message.ids.length; ++i) + if (!$util.isInteger(message.ids[i]) && !(message.ids[i] && $util.isInteger(message.ids[i].low) && $util.isInteger(message.ids[i].high))) + return "ids: integer|Long[] expected"; + } + if (message.displayNames != null && message.hasOwnProperty("displayNames")) { + if (!Array.isArray(message.displayNames)) + return "displayNames: array expected"; + for (var i = 0; i < message.displayNames.length; ++i) + if (!$util.isString(message.displayNames[i])) + return "displayNames: string[] expected"; + } + if (message.confidences != null && message.hasOwnProperty("confidences")) { + if (!Array.isArray(message.confidences)) + return "confidences: array expected"; + for (var i = 0; i < message.confidences.length; ++i) + if (typeof message.confidences[i] !== "number") + return "confidences: number[] expected"; + } + return null; + }; + + /** + * Creates a ClassificationPredictionResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ClassificationPredictionResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ClassificationPredictionResult} ClassificationPredictionResult + */ + ClassificationPredictionResult.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ClassificationPredictionResult) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ClassificationPredictionResult(); + if (object.ids) { + if (!Array.isArray(object.ids)) + throw TypeError(".google.cloud.visionai.v1alpha1.ClassificationPredictionResult.ids: array expected"); + message.ids = []; + for (var i = 0; i < object.ids.length; ++i) + if ($util.Long) + (message.ids[i] = $util.Long.fromValue(object.ids[i])).unsigned = false; + else if (typeof object.ids[i] === "string") + message.ids[i] = parseInt(object.ids[i], 10); + else if (typeof object.ids[i] === "number") + message.ids[i] = object.ids[i]; + else if (typeof object.ids[i] === "object") + message.ids[i] = new $util.LongBits(object.ids[i].low >>> 0, object.ids[i].high >>> 0).toNumber(); + } + if (object.displayNames) { + if (!Array.isArray(object.displayNames)) + throw TypeError(".google.cloud.visionai.v1alpha1.ClassificationPredictionResult.displayNames: array expected"); + message.displayNames = []; + for (var i = 0; i < object.displayNames.length; ++i) + message.displayNames[i] = String(object.displayNames[i]); + } + if (object.confidences) { + if (!Array.isArray(object.confidences)) + throw TypeError(".google.cloud.visionai.v1alpha1.ClassificationPredictionResult.confidences: array expected"); + message.confidences = []; + for (var i = 0; i < object.confidences.length; ++i) + message.confidences[i] = Number(object.confidences[i]); + } + return message; + }; + + /** + * Creates a plain object from a ClassificationPredictionResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ClassificationPredictionResult + * @static + * @param {google.cloud.visionai.v1alpha1.ClassificationPredictionResult} message ClassificationPredictionResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClassificationPredictionResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ids = []; + object.displayNames = []; + object.confidences = []; + } + if (message.ids && message.ids.length) { + object.ids = []; + for (var j = 0; j < message.ids.length; ++j) + if (typeof message.ids[j] === "number") + object.ids[j] = options.longs === String ? String(message.ids[j]) : message.ids[j]; + else + object.ids[j] = options.longs === String ? $util.Long.prototype.toString.call(message.ids[j]) : options.longs === Number ? new $util.LongBits(message.ids[j].low >>> 0, message.ids[j].high >>> 0).toNumber() : message.ids[j]; + } + if (message.displayNames && message.displayNames.length) { + object.displayNames = []; + for (var j = 0; j < message.displayNames.length; ++j) + object.displayNames[j] = message.displayNames[j]; + } + if (message.confidences && message.confidences.length) { + object.confidences = []; + for (var j = 0; j < message.confidences.length; ++j) + object.confidences[j] = options.json && !isFinite(message.confidences[j]) ? String(message.confidences[j]) : message.confidences[j]; + } + return object; + }; + + /** + * Converts this ClassificationPredictionResult to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ClassificationPredictionResult + * @instance + * @returns {Object.} JSON object + */ + ClassificationPredictionResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClassificationPredictionResult + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ClassificationPredictionResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClassificationPredictionResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ClassificationPredictionResult"; + }; + + return ClassificationPredictionResult; + })(); + + v1alpha1.ImageSegmentationPredictionResult = (function() { + + /** + * Properties of an ImageSegmentationPredictionResult. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IImageSegmentationPredictionResult + * @property {string|null} [categoryMask] ImageSegmentationPredictionResult categoryMask + * @property {string|null} [confidenceMask] ImageSegmentationPredictionResult confidenceMask + */ + + /** + * Constructs a new ImageSegmentationPredictionResult. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents an ImageSegmentationPredictionResult. + * @implements IImageSegmentationPredictionResult + * @constructor + * @param {google.cloud.visionai.v1alpha1.IImageSegmentationPredictionResult=} [properties] Properties to set + */ + function ImageSegmentationPredictionResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImageSegmentationPredictionResult categoryMask. + * @member {string} categoryMask + * @memberof google.cloud.visionai.v1alpha1.ImageSegmentationPredictionResult + * @instance + */ + ImageSegmentationPredictionResult.prototype.categoryMask = ""; + + /** + * ImageSegmentationPredictionResult confidenceMask. + * @member {string} confidenceMask + * @memberof google.cloud.visionai.v1alpha1.ImageSegmentationPredictionResult + * @instance + */ + ImageSegmentationPredictionResult.prototype.confidenceMask = ""; + + /** + * Creates a new ImageSegmentationPredictionResult instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ImageSegmentationPredictionResult + * @static + * @param {google.cloud.visionai.v1alpha1.IImageSegmentationPredictionResult=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ImageSegmentationPredictionResult} ImageSegmentationPredictionResult instance + */ + ImageSegmentationPredictionResult.create = function create(properties) { + return new ImageSegmentationPredictionResult(properties); + }; + + /** + * Encodes the specified ImageSegmentationPredictionResult message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ImageSegmentationPredictionResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ImageSegmentationPredictionResult + * @static + * @param {google.cloud.visionai.v1alpha1.IImageSegmentationPredictionResult} message ImageSegmentationPredictionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageSegmentationPredictionResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.categoryMask != null && Object.hasOwnProperty.call(message, "categoryMask")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.categoryMask); + if (message.confidenceMask != null && Object.hasOwnProperty.call(message, "confidenceMask")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.confidenceMask); + return writer; + }; + + /** + * Encodes the specified ImageSegmentationPredictionResult message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ImageSegmentationPredictionResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ImageSegmentationPredictionResult + * @static + * @param {google.cloud.visionai.v1alpha1.IImageSegmentationPredictionResult} message ImageSegmentationPredictionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageSegmentationPredictionResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageSegmentationPredictionResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ImageSegmentationPredictionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ImageSegmentationPredictionResult} ImageSegmentationPredictionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageSegmentationPredictionResult.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ImageSegmentationPredictionResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.categoryMask = reader.string(); + break; + } + case 2: { + message.confidenceMask = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ImageSegmentationPredictionResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ImageSegmentationPredictionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ImageSegmentationPredictionResult} ImageSegmentationPredictionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageSegmentationPredictionResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageSegmentationPredictionResult message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ImageSegmentationPredictionResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageSegmentationPredictionResult.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.categoryMask != null && message.hasOwnProperty("categoryMask")) + if (!$util.isString(message.categoryMask)) + return "categoryMask: string expected"; + if (message.confidenceMask != null && message.hasOwnProperty("confidenceMask")) + if (!$util.isString(message.confidenceMask)) + return "confidenceMask: string expected"; + return null; + }; + + /** + * Creates an ImageSegmentationPredictionResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ImageSegmentationPredictionResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ImageSegmentationPredictionResult} ImageSegmentationPredictionResult + */ + ImageSegmentationPredictionResult.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ImageSegmentationPredictionResult) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ImageSegmentationPredictionResult(); + if (object.categoryMask != null) + message.categoryMask = String(object.categoryMask); + if (object.confidenceMask != null) + message.confidenceMask = String(object.confidenceMask); + return message; + }; + + /** + * Creates a plain object from an ImageSegmentationPredictionResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ImageSegmentationPredictionResult + * @static + * @param {google.cloud.visionai.v1alpha1.ImageSegmentationPredictionResult} message ImageSegmentationPredictionResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageSegmentationPredictionResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.categoryMask = ""; + object.confidenceMask = ""; + } + if (message.categoryMask != null && message.hasOwnProperty("categoryMask")) + object.categoryMask = message.categoryMask; + if (message.confidenceMask != null && message.hasOwnProperty("confidenceMask")) + object.confidenceMask = message.confidenceMask; + return object; + }; + + /** + * Converts this ImageSegmentationPredictionResult to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ImageSegmentationPredictionResult + * @instance + * @returns {Object.} JSON object + */ + ImageSegmentationPredictionResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImageSegmentationPredictionResult + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ImageSegmentationPredictionResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImageSegmentationPredictionResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ImageSegmentationPredictionResult"; + }; + + return ImageSegmentationPredictionResult; + })(); + + v1alpha1.VideoActionRecognitionPredictionResult = (function() { + + /** + * Properties of a VideoActionRecognitionPredictionResult. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IVideoActionRecognitionPredictionResult + * @property {google.protobuf.ITimestamp|null} [segmentStartTime] VideoActionRecognitionPredictionResult segmentStartTime + * @property {google.protobuf.ITimestamp|null} [segmentEndTime] VideoActionRecognitionPredictionResult segmentEndTime + * @property {Array.|null} [actions] VideoActionRecognitionPredictionResult actions + */ + + /** + * Constructs a new VideoActionRecognitionPredictionResult. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a VideoActionRecognitionPredictionResult. + * @implements IVideoActionRecognitionPredictionResult + * @constructor + * @param {google.cloud.visionai.v1alpha1.IVideoActionRecognitionPredictionResult=} [properties] Properties to set + */ + function VideoActionRecognitionPredictionResult(properties) { + this.actions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * VideoActionRecognitionPredictionResult segmentStartTime. + * @member {google.protobuf.ITimestamp|null|undefined} segmentStartTime + * @memberof google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult + * @instance + */ + VideoActionRecognitionPredictionResult.prototype.segmentStartTime = null; + + /** + * VideoActionRecognitionPredictionResult segmentEndTime. + * @member {google.protobuf.ITimestamp|null|undefined} segmentEndTime + * @memberof google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult + * @instance + */ + VideoActionRecognitionPredictionResult.prototype.segmentEndTime = null; + + /** + * VideoActionRecognitionPredictionResult actions. + * @member {Array.} actions + * @memberof google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult + * @instance + */ + VideoActionRecognitionPredictionResult.prototype.actions = $util.emptyArray; + + /** + * Creates a new VideoActionRecognitionPredictionResult instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult + * @static + * @param {google.cloud.visionai.v1alpha1.IVideoActionRecognitionPredictionResult=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult} VideoActionRecognitionPredictionResult instance + */ + VideoActionRecognitionPredictionResult.create = function create(properties) { + return new VideoActionRecognitionPredictionResult(properties); + }; + + /** + * Encodes the specified VideoActionRecognitionPredictionResult message. Does not implicitly {@link google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult + * @static + * @param {google.cloud.visionai.v1alpha1.IVideoActionRecognitionPredictionResult} message VideoActionRecognitionPredictionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoActionRecognitionPredictionResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.segmentStartTime != null && Object.hasOwnProperty.call(message, "segmentStartTime")) + $root.google.protobuf.Timestamp.encode(message.segmentStartTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.segmentEndTime != null && Object.hasOwnProperty.call(message, "segmentEndTime")) + $root.google.protobuf.Timestamp.encode(message.segmentEndTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.actions != null && message.actions.length) + for (var i = 0; i < message.actions.length; ++i) + $root.google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult.IdentifiedAction.encode(message.actions[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VideoActionRecognitionPredictionResult message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult + * @static + * @param {google.cloud.visionai.v1alpha1.IVideoActionRecognitionPredictionResult} message VideoActionRecognitionPredictionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoActionRecognitionPredictionResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VideoActionRecognitionPredictionResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult} VideoActionRecognitionPredictionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoActionRecognitionPredictionResult.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.segmentStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.segmentEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + if (!(message.actions && message.actions.length)) + message.actions = []; + message.actions.push($root.google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult.IdentifiedAction.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a VideoActionRecognitionPredictionResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult} VideoActionRecognitionPredictionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoActionRecognitionPredictionResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VideoActionRecognitionPredictionResult message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VideoActionRecognitionPredictionResult.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.segmentStartTime != null && message.hasOwnProperty("segmentStartTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.segmentStartTime, long + 1); + if (error) + return "segmentStartTime." + error; + } + if (message.segmentEndTime != null && message.hasOwnProperty("segmentEndTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.segmentEndTime, long + 1); + if (error) + return "segmentEndTime." + error; + } + if (message.actions != null && message.hasOwnProperty("actions")) { + if (!Array.isArray(message.actions)) + return "actions: array expected"; + for (var i = 0; i < message.actions.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult.IdentifiedAction.verify(message.actions[i], long + 1); + if (error) + return "actions." + error; + } + } + return null; + }; + + /** + * Creates a VideoActionRecognitionPredictionResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult} VideoActionRecognitionPredictionResult + */ + VideoActionRecognitionPredictionResult.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult(); + if (object.segmentStartTime != null) { + if (typeof object.segmentStartTime !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult.segmentStartTime: object expected"); + message.segmentStartTime = $root.google.protobuf.Timestamp.fromObject(object.segmentStartTime, long + 1); + } + if (object.segmentEndTime != null) { + if (typeof object.segmentEndTime !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult.segmentEndTime: object expected"); + message.segmentEndTime = $root.google.protobuf.Timestamp.fromObject(object.segmentEndTime, long + 1); + } + if (object.actions) { + if (!Array.isArray(object.actions)) + throw TypeError(".google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult.actions: array expected"); + message.actions = []; + for (var i = 0; i < object.actions.length; ++i) { + if (typeof object.actions[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult.actions: object expected"); + message.actions[i] = $root.google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult.IdentifiedAction.fromObject(object.actions[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a VideoActionRecognitionPredictionResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult + * @static + * @param {google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult} message VideoActionRecognitionPredictionResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VideoActionRecognitionPredictionResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.actions = []; + if (options.defaults) { + object.segmentStartTime = null; + object.segmentEndTime = null; + } + if (message.segmentStartTime != null && message.hasOwnProperty("segmentStartTime")) + object.segmentStartTime = $root.google.protobuf.Timestamp.toObject(message.segmentStartTime, options); + if (message.segmentEndTime != null && message.hasOwnProperty("segmentEndTime")) + object.segmentEndTime = $root.google.protobuf.Timestamp.toObject(message.segmentEndTime, options); + if (message.actions && message.actions.length) { + object.actions = []; + for (var j = 0; j < message.actions.length; ++j) + object.actions[j] = $root.google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult.IdentifiedAction.toObject(message.actions[j], options); + } + return object; + }; + + /** + * Converts this VideoActionRecognitionPredictionResult to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult + * @instance + * @returns {Object.} JSON object + */ + VideoActionRecognitionPredictionResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VideoActionRecognitionPredictionResult + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VideoActionRecognitionPredictionResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult"; + }; + + VideoActionRecognitionPredictionResult.IdentifiedAction = (function() { + + /** + * Properties of an IdentifiedAction. + * @memberof google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult + * @interface IIdentifiedAction + * @property {string|null} [id] IdentifiedAction id + * @property {string|null} [displayName] IdentifiedAction displayName + * @property {number|null} [confidence] IdentifiedAction confidence + */ + + /** + * Constructs a new IdentifiedAction. + * @memberof google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult + * @classdesc Represents an IdentifiedAction. + * @implements IIdentifiedAction + * @constructor + * @param {google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult.IIdentifiedAction=} [properties] Properties to set + */ + function IdentifiedAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * IdentifiedAction id. + * @member {string} id + * @memberof google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult.IdentifiedAction + * @instance + */ + IdentifiedAction.prototype.id = ""; + + /** + * IdentifiedAction displayName. + * @member {string} displayName + * @memberof google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult.IdentifiedAction + * @instance + */ + IdentifiedAction.prototype.displayName = ""; + + /** + * IdentifiedAction confidence. + * @member {number} confidence + * @memberof google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult.IdentifiedAction + * @instance + */ + IdentifiedAction.prototype.confidence = 0; + + /** + * Creates a new IdentifiedAction instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult.IdentifiedAction + * @static + * @param {google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult.IIdentifiedAction=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult.IdentifiedAction} IdentifiedAction instance + */ + IdentifiedAction.create = function create(properties) { + return new IdentifiedAction(properties); + }; + + /** + * Encodes the specified IdentifiedAction message. Does not implicitly {@link google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult.IdentifiedAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult.IdentifiedAction + * @static + * @param {google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult.IIdentifiedAction} message IdentifiedAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentifiedAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified IdentifiedAction message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult.IdentifiedAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult.IdentifiedAction + * @static + * @param {google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult.IIdentifiedAction} message IdentifiedAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentifiedAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IdentifiedAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult.IdentifiedAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult.IdentifiedAction} IdentifiedAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentifiedAction.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult.IdentifiedAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.confidence = reader.float(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an IdentifiedAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult.IdentifiedAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult.IdentifiedAction} IdentifiedAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentifiedAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IdentifiedAction message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult.IdentifiedAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IdentifiedAction.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates an IdentifiedAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult.IdentifiedAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult.IdentifiedAction} IdentifiedAction + */ + IdentifiedAction.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult.IdentifiedAction) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult.IdentifiedAction(); + if (object.id != null) + message.id = String(object.id); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from an IdentifiedAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult.IdentifiedAction + * @static + * @param {google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult.IdentifiedAction} message IdentifiedAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IdentifiedAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.displayName = ""; + object.confidence = 0; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this IdentifiedAction to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult.IdentifiedAction + * @instance + * @returns {Object.} JSON object + */ + IdentifiedAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IdentifiedAction + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult.IdentifiedAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IdentifiedAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.VideoActionRecognitionPredictionResult.IdentifiedAction"; + }; + + return IdentifiedAction; + })(); + + return VideoActionRecognitionPredictionResult; + })(); + + v1alpha1.VideoObjectTrackingPredictionResult = (function() { + + /** + * Properties of a VideoObjectTrackingPredictionResult. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IVideoObjectTrackingPredictionResult + * @property {google.protobuf.ITimestamp|null} [segmentStartTime] VideoObjectTrackingPredictionResult segmentStartTime + * @property {google.protobuf.ITimestamp|null} [segmentEndTime] VideoObjectTrackingPredictionResult segmentEndTime + * @property {Array.|null} [objects] VideoObjectTrackingPredictionResult objects + */ + + /** + * Constructs a new VideoObjectTrackingPredictionResult. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a VideoObjectTrackingPredictionResult. + * @implements IVideoObjectTrackingPredictionResult + * @constructor + * @param {google.cloud.visionai.v1alpha1.IVideoObjectTrackingPredictionResult=} [properties] Properties to set + */ + function VideoObjectTrackingPredictionResult(properties) { + this.objects = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * VideoObjectTrackingPredictionResult segmentStartTime. + * @member {google.protobuf.ITimestamp|null|undefined} segmentStartTime + * @memberof google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult + * @instance + */ + VideoObjectTrackingPredictionResult.prototype.segmentStartTime = null; + + /** + * VideoObjectTrackingPredictionResult segmentEndTime. + * @member {google.protobuf.ITimestamp|null|undefined} segmentEndTime + * @memberof google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult + * @instance + */ + VideoObjectTrackingPredictionResult.prototype.segmentEndTime = null; + + /** + * VideoObjectTrackingPredictionResult objects. + * @member {Array.} objects + * @memberof google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult + * @instance + */ + VideoObjectTrackingPredictionResult.prototype.objects = $util.emptyArray; + + /** + * Creates a new VideoObjectTrackingPredictionResult instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult + * @static + * @param {google.cloud.visionai.v1alpha1.IVideoObjectTrackingPredictionResult=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult} VideoObjectTrackingPredictionResult instance + */ + VideoObjectTrackingPredictionResult.create = function create(properties) { + return new VideoObjectTrackingPredictionResult(properties); + }; + + /** + * Encodes the specified VideoObjectTrackingPredictionResult message. Does not implicitly {@link google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult + * @static + * @param {google.cloud.visionai.v1alpha1.IVideoObjectTrackingPredictionResult} message VideoObjectTrackingPredictionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoObjectTrackingPredictionResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.segmentStartTime != null && Object.hasOwnProperty.call(message, "segmentStartTime")) + $root.google.protobuf.Timestamp.encode(message.segmentStartTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.segmentEndTime != null && Object.hasOwnProperty.call(message, "segmentEndTime")) + $root.google.protobuf.Timestamp.encode(message.segmentEndTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.objects != null && message.objects.length) + for (var i = 0; i < message.objects.length; ++i) + $root.google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.DetectedObject.encode(message.objects[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VideoObjectTrackingPredictionResult message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult + * @static + * @param {google.cloud.visionai.v1alpha1.IVideoObjectTrackingPredictionResult} message VideoObjectTrackingPredictionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoObjectTrackingPredictionResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VideoObjectTrackingPredictionResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult} VideoObjectTrackingPredictionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoObjectTrackingPredictionResult.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.segmentStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.segmentEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + if (!(message.objects && message.objects.length)) + message.objects = []; + message.objects.push($root.google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.DetectedObject.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a VideoObjectTrackingPredictionResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult} VideoObjectTrackingPredictionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoObjectTrackingPredictionResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VideoObjectTrackingPredictionResult message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VideoObjectTrackingPredictionResult.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.segmentStartTime != null && message.hasOwnProperty("segmentStartTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.segmentStartTime, long + 1); + if (error) + return "segmentStartTime." + error; + } + if (message.segmentEndTime != null && message.hasOwnProperty("segmentEndTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.segmentEndTime, long + 1); + if (error) + return "segmentEndTime." + error; + } + if (message.objects != null && message.hasOwnProperty("objects")) { + if (!Array.isArray(message.objects)) + return "objects: array expected"; + for (var i = 0; i < message.objects.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.DetectedObject.verify(message.objects[i], long + 1); + if (error) + return "objects." + error; + } + } + return null; + }; + + /** + * Creates a VideoObjectTrackingPredictionResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult} VideoObjectTrackingPredictionResult + */ + VideoObjectTrackingPredictionResult.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult(); + if (object.segmentStartTime != null) { + if (typeof object.segmentStartTime !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.segmentStartTime: object expected"); + message.segmentStartTime = $root.google.protobuf.Timestamp.fromObject(object.segmentStartTime, long + 1); + } + if (object.segmentEndTime != null) { + if (typeof object.segmentEndTime !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.segmentEndTime: object expected"); + message.segmentEndTime = $root.google.protobuf.Timestamp.fromObject(object.segmentEndTime, long + 1); + } + if (object.objects) { + if (!Array.isArray(object.objects)) + throw TypeError(".google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.objects: array expected"); + message.objects = []; + for (var i = 0; i < object.objects.length; ++i) { + if (typeof object.objects[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.objects: object expected"); + message.objects[i] = $root.google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.DetectedObject.fromObject(object.objects[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a VideoObjectTrackingPredictionResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult + * @static + * @param {google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult} message VideoObjectTrackingPredictionResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VideoObjectTrackingPredictionResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.objects = []; + if (options.defaults) { + object.segmentStartTime = null; + object.segmentEndTime = null; + } + if (message.segmentStartTime != null && message.hasOwnProperty("segmentStartTime")) + object.segmentStartTime = $root.google.protobuf.Timestamp.toObject(message.segmentStartTime, options); + if (message.segmentEndTime != null && message.hasOwnProperty("segmentEndTime")) + object.segmentEndTime = $root.google.protobuf.Timestamp.toObject(message.segmentEndTime, options); + if (message.objects && message.objects.length) { + object.objects = []; + for (var j = 0; j < message.objects.length; ++j) + object.objects[j] = $root.google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.DetectedObject.toObject(message.objects[j], options); + } + return object; + }; + + /** + * Converts this VideoObjectTrackingPredictionResult to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult + * @instance + * @returns {Object.} JSON object + */ + VideoObjectTrackingPredictionResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VideoObjectTrackingPredictionResult + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VideoObjectTrackingPredictionResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult"; + }; + + VideoObjectTrackingPredictionResult.BoundingBox = (function() { + + /** + * Properties of a BoundingBox. + * @memberof google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult + * @interface IBoundingBox + * @property {number|null} [xMin] BoundingBox xMin + * @property {number|null} [xMax] BoundingBox xMax + * @property {number|null} [yMin] BoundingBox yMin + * @property {number|null} [yMax] BoundingBox yMax + */ + + /** + * Constructs a new BoundingBox. + * @memberof google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult + * @classdesc Represents a BoundingBox. + * @implements IBoundingBox + * @constructor + * @param {google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.IBoundingBox=} [properties] Properties to set + */ + function BoundingBox(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * BoundingBox xMin. + * @member {number} xMin + * @memberof google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.BoundingBox + * @instance + */ + BoundingBox.prototype.xMin = 0; + + /** + * BoundingBox xMax. + * @member {number} xMax + * @memberof google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.BoundingBox + * @instance + */ + BoundingBox.prototype.xMax = 0; + + /** + * BoundingBox yMin. + * @member {number} yMin + * @memberof google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.BoundingBox + * @instance + */ + BoundingBox.prototype.yMin = 0; + + /** + * BoundingBox yMax. + * @member {number} yMax + * @memberof google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.BoundingBox + * @instance + */ + BoundingBox.prototype.yMax = 0; + + /** + * Creates a new BoundingBox instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.BoundingBox + * @static + * @param {google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.IBoundingBox=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.BoundingBox} BoundingBox instance + */ + BoundingBox.create = function create(properties) { + return new BoundingBox(properties); + }; + + /** + * Encodes the specified BoundingBox message. Does not implicitly {@link google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.BoundingBox.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.BoundingBox + * @static + * @param {google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.IBoundingBox} message BoundingBox message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoundingBox.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.xMin != null && Object.hasOwnProperty.call(message, "xMin")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.xMin); + if (message.xMax != null && Object.hasOwnProperty.call(message, "xMax")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.xMax); + if (message.yMin != null && Object.hasOwnProperty.call(message, "yMin")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.yMin); + if (message.yMax != null && Object.hasOwnProperty.call(message, "yMax")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.yMax); + return writer; + }; + + /** + * Encodes the specified BoundingBox message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.BoundingBox.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.BoundingBox + * @static + * @param {google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.IBoundingBox} message BoundingBox message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoundingBox.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoundingBox message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.BoundingBox + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.BoundingBox} BoundingBox + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoundingBox.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.BoundingBox(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.xMin = reader.float(); + break; + } + case 2: { + message.xMax = reader.float(); + break; + } + case 3: { + message.yMin = reader.float(); + break; + } + case 4: { + message.yMax = reader.float(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a BoundingBox message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.BoundingBox + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.BoundingBox} BoundingBox + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoundingBox.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoundingBox message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.BoundingBox + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoundingBox.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.xMin != null && message.hasOwnProperty("xMin")) + if (typeof message.xMin !== "number") + return "xMin: number expected"; + if (message.xMax != null && message.hasOwnProperty("xMax")) + if (typeof message.xMax !== "number") + return "xMax: number expected"; + if (message.yMin != null && message.hasOwnProperty("yMin")) + if (typeof message.yMin !== "number") + return "yMin: number expected"; + if (message.yMax != null && message.hasOwnProperty("yMax")) + if (typeof message.yMax !== "number") + return "yMax: number expected"; + return null; + }; + + /** + * Creates a BoundingBox message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.BoundingBox + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.BoundingBox} BoundingBox + */ + BoundingBox.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.BoundingBox) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.BoundingBox(); + if (object.xMin != null) + message.xMin = Number(object.xMin); + if (object.xMax != null) + message.xMax = Number(object.xMax); + if (object.yMin != null) + message.yMin = Number(object.yMin); + if (object.yMax != null) + message.yMax = Number(object.yMax); + return message; + }; + + /** + * Creates a plain object from a BoundingBox message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.BoundingBox + * @static + * @param {google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.BoundingBox} message BoundingBox + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoundingBox.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.xMin = 0; + object.xMax = 0; + object.yMin = 0; + object.yMax = 0; + } + if (message.xMin != null && message.hasOwnProperty("xMin")) + object.xMin = options.json && !isFinite(message.xMin) ? String(message.xMin) : message.xMin; + if (message.xMax != null && message.hasOwnProperty("xMax")) + object.xMax = options.json && !isFinite(message.xMax) ? String(message.xMax) : message.xMax; + if (message.yMin != null && message.hasOwnProperty("yMin")) + object.yMin = options.json && !isFinite(message.yMin) ? String(message.yMin) : message.yMin; + if (message.yMax != null && message.hasOwnProperty("yMax")) + object.yMax = options.json && !isFinite(message.yMax) ? String(message.yMax) : message.yMax; + return object; + }; + + /** + * Converts this BoundingBox to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.BoundingBox + * @instance + * @returns {Object.} JSON object + */ + BoundingBox.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BoundingBox + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.BoundingBox + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoundingBox.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.BoundingBox"; + }; + + return BoundingBox; + })(); + + VideoObjectTrackingPredictionResult.DetectedObject = (function() { + + /** + * Properties of a DetectedObject. + * @memberof google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult + * @interface IDetectedObject + * @property {string|null} [id] DetectedObject id + * @property {string|null} [displayName] DetectedObject displayName + * @property {google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.IBoundingBox|null} [boundingBox] DetectedObject boundingBox + * @property {number|null} [confidence] DetectedObject confidence + * @property {number|Long|null} [trackId] DetectedObject trackId + */ + + /** + * Constructs a new DetectedObject. + * @memberof google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult + * @classdesc Represents a DetectedObject. + * @implements IDetectedObject + * @constructor + * @param {google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.IDetectedObject=} [properties] Properties to set + */ + function DetectedObject(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DetectedObject id. + * @member {string} id + * @memberof google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.DetectedObject + * @instance + */ + DetectedObject.prototype.id = ""; + + /** + * DetectedObject displayName. + * @member {string} displayName + * @memberof google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.DetectedObject + * @instance + */ + DetectedObject.prototype.displayName = ""; + + /** + * DetectedObject boundingBox. + * @member {google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.IBoundingBox|null|undefined} boundingBox + * @memberof google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.DetectedObject + * @instance + */ + DetectedObject.prototype.boundingBox = null; + + /** + * DetectedObject confidence. + * @member {number} confidence + * @memberof google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.DetectedObject + * @instance + */ + DetectedObject.prototype.confidence = 0; + + /** + * DetectedObject trackId. + * @member {number|Long} trackId + * @memberof google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.DetectedObject + * @instance + */ + DetectedObject.prototype.trackId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new DetectedObject instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.DetectedObject + * @static + * @param {google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.IDetectedObject=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.DetectedObject} DetectedObject instance + */ + DetectedObject.create = function create(properties) { + return new DetectedObject(properties); + }; + + /** + * Encodes the specified DetectedObject message. Does not implicitly {@link google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.DetectedObject.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.DetectedObject + * @static + * @param {google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.IDetectedObject} message DetectedObject message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectedObject.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.boundingBox != null && Object.hasOwnProperty.call(message, "boundingBox")) + $root.google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.BoundingBox.encode(message.boundingBox, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.confidence); + if (message.trackId != null && Object.hasOwnProperty.call(message, "trackId")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.trackId); + return writer; + }; + + /** + * Encodes the specified DetectedObject message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.DetectedObject.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.DetectedObject + * @static + * @param {google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.IDetectedObject} message DetectedObject message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectedObject.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DetectedObject message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.DetectedObject + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.DetectedObject} DetectedObject + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectedObject.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.DetectedObject(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.boundingBox = $root.google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.BoundingBox.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.confidence = reader.float(); + break; + } + case 5: { + message.trackId = reader.int64(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DetectedObject message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.DetectedObject + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.DetectedObject} DetectedObject + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectedObject.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DetectedObject message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.DetectedObject + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DetectedObject.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) { + var error = $root.google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.BoundingBox.verify(message.boundingBox, long + 1); + if (error) + return "boundingBox." + error; + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + if (message.trackId != null && message.hasOwnProperty("trackId")) + if (!$util.isInteger(message.trackId) && !(message.trackId && $util.isInteger(message.trackId.low) && $util.isInteger(message.trackId.high))) + return "trackId: integer|Long expected"; + return null; + }; + + /** + * Creates a DetectedObject message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.DetectedObject + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.DetectedObject} DetectedObject + */ + DetectedObject.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.DetectedObject) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.DetectedObject(); + if (object.id != null) + message.id = String(object.id); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.boundingBox != null) { + if (typeof object.boundingBox !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.DetectedObject.boundingBox: object expected"); + message.boundingBox = $root.google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.BoundingBox.fromObject(object.boundingBox, long + 1); + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + if (object.trackId != null) + if ($util.Long) + (message.trackId = $util.Long.fromValue(object.trackId)).unsigned = false; + else if (typeof object.trackId === "string") + message.trackId = parseInt(object.trackId, 10); + else if (typeof object.trackId === "number") + message.trackId = object.trackId; + else if (typeof object.trackId === "object") + message.trackId = new $util.LongBits(object.trackId.low >>> 0, object.trackId.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a DetectedObject message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.DetectedObject + * @static + * @param {google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.DetectedObject} message DetectedObject + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DetectedObject.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.displayName = ""; + object.boundingBox = null; + object.confidence = 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.trackId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.trackId = options.longs === String ? "0" : 0; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) + object.boundingBox = $root.google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.BoundingBox.toObject(message.boundingBox, options); + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + if (message.trackId != null && message.hasOwnProperty("trackId")) + if (typeof message.trackId === "number") + object.trackId = options.longs === String ? String(message.trackId) : message.trackId; + else + object.trackId = options.longs === String ? $util.Long.prototype.toString.call(message.trackId) : options.longs === Number ? new $util.LongBits(message.trackId.low >>> 0, message.trackId.high >>> 0).toNumber() : message.trackId; + return object; + }; + + /** + * Converts this DetectedObject to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.DetectedObject + * @instance + * @returns {Object.} JSON object + */ + DetectedObject.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DetectedObject + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.DetectedObject + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DetectedObject.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.VideoObjectTrackingPredictionResult.DetectedObject"; + }; + + return DetectedObject; + })(); + + return VideoObjectTrackingPredictionResult; + })(); + + v1alpha1.VideoClassificationPredictionResult = (function() { + + /** + * Properties of a VideoClassificationPredictionResult. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IVideoClassificationPredictionResult + * @property {google.protobuf.ITimestamp|null} [segmentStartTime] VideoClassificationPredictionResult segmentStartTime + * @property {google.protobuf.ITimestamp|null} [segmentEndTime] VideoClassificationPredictionResult segmentEndTime + * @property {Array.|null} [classifications] VideoClassificationPredictionResult classifications + */ + + /** + * Constructs a new VideoClassificationPredictionResult. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a VideoClassificationPredictionResult. + * @implements IVideoClassificationPredictionResult + * @constructor + * @param {google.cloud.visionai.v1alpha1.IVideoClassificationPredictionResult=} [properties] Properties to set + */ + function VideoClassificationPredictionResult(properties) { + this.classifications = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * VideoClassificationPredictionResult segmentStartTime. + * @member {google.protobuf.ITimestamp|null|undefined} segmentStartTime + * @memberof google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult + * @instance + */ + VideoClassificationPredictionResult.prototype.segmentStartTime = null; + + /** + * VideoClassificationPredictionResult segmentEndTime. + * @member {google.protobuf.ITimestamp|null|undefined} segmentEndTime + * @memberof google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult + * @instance + */ + VideoClassificationPredictionResult.prototype.segmentEndTime = null; + + /** + * VideoClassificationPredictionResult classifications. + * @member {Array.} classifications + * @memberof google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult + * @instance + */ + VideoClassificationPredictionResult.prototype.classifications = $util.emptyArray; + + /** + * Creates a new VideoClassificationPredictionResult instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult + * @static + * @param {google.cloud.visionai.v1alpha1.IVideoClassificationPredictionResult=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult} VideoClassificationPredictionResult instance + */ + VideoClassificationPredictionResult.create = function create(properties) { + return new VideoClassificationPredictionResult(properties); + }; + + /** + * Encodes the specified VideoClassificationPredictionResult message. Does not implicitly {@link google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult + * @static + * @param {google.cloud.visionai.v1alpha1.IVideoClassificationPredictionResult} message VideoClassificationPredictionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoClassificationPredictionResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.segmentStartTime != null && Object.hasOwnProperty.call(message, "segmentStartTime")) + $root.google.protobuf.Timestamp.encode(message.segmentStartTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.segmentEndTime != null && Object.hasOwnProperty.call(message, "segmentEndTime")) + $root.google.protobuf.Timestamp.encode(message.segmentEndTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.classifications != null && message.classifications.length) + for (var i = 0; i < message.classifications.length; ++i) + $root.google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult.IdentifiedClassification.encode(message.classifications[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VideoClassificationPredictionResult message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult + * @static + * @param {google.cloud.visionai.v1alpha1.IVideoClassificationPredictionResult} message VideoClassificationPredictionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoClassificationPredictionResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VideoClassificationPredictionResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult} VideoClassificationPredictionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoClassificationPredictionResult.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.segmentStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.segmentEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + if (!(message.classifications && message.classifications.length)) + message.classifications = []; + message.classifications.push($root.google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult.IdentifiedClassification.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a VideoClassificationPredictionResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult} VideoClassificationPredictionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoClassificationPredictionResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VideoClassificationPredictionResult message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VideoClassificationPredictionResult.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.segmentStartTime != null && message.hasOwnProperty("segmentStartTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.segmentStartTime, long + 1); + if (error) + return "segmentStartTime." + error; + } + if (message.segmentEndTime != null && message.hasOwnProperty("segmentEndTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.segmentEndTime, long + 1); + if (error) + return "segmentEndTime." + error; + } + if (message.classifications != null && message.hasOwnProperty("classifications")) { + if (!Array.isArray(message.classifications)) + return "classifications: array expected"; + for (var i = 0; i < message.classifications.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult.IdentifiedClassification.verify(message.classifications[i], long + 1); + if (error) + return "classifications." + error; + } + } + return null; + }; + + /** + * Creates a VideoClassificationPredictionResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult} VideoClassificationPredictionResult + */ + VideoClassificationPredictionResult.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult(); + if (object.segmentStartTime != null) { + if (typeof object.segmentStartTime !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult.segmentStartTime: object expected"); + message.segmentStartTime = $root.google.protobuf.Timestamp.fromObject(object.segmentStartTime, long + 1); + } + if (object.segmentEndTime != null) { + if (typeof object.segmentEndTime !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult.segmentEndTime: object expected"); + message.segmentEndTime = $root.google.protobuf.Timestamp.fromObject(object.segmentEndTime, long + 1); + } + if (object.classifications) { + if (!Array.isArray(object.classifications)) + throw TypeError(".google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult.classifications: array expected"); + message.classifications = []; + for (var i = 0; i < object.classifications.length; ++i) { + if (typeof object.classifications[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult.classifications: object expected"); + message.classifications[i] = $root.google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult.IdentifiedClassification.fromObject(object.classifications[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a VideoClassificationPredictionResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult + * @static + * @param {google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult} message VideoClassificationPredictionResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VideoClassificationPredictionResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.classifications = []; + if (options.defaults) { + object.segmentStartTime = null; + object.segmentEndTime = null; + } + if (message.segmentStartTime != null && message.hasOwnProperty("segmentStartTime")) + object.segmentStartTime = $root.google.protobuf.Timestamp.toObject(message.segmentStartTime, options); + if (message.segmentEndTime != null && message.hasOwnProperty("segmentEndTime")) + object.segmentEndTime = $root.google.protobuf.Timestamp.toObject(message.segmentEndTime, options); + if (message.classifications && message.classifications.length) { + object.classifications = []; + for (var j = 0; j < message.classifications.length; ++j) + object.classifications[j] = $root.google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult.IdentifiedClassification.toObject(message.classifications[j], options); + } + return object; + }; + + /** + * Converts this VideoClassificationPredictionResult to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult + * @instance + * @returns {Object.} JSON object + */ + VideoClassificationPredictionResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VideoClassificationPredictionResult + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VideoClassificationPredictionResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult"; + }; + + VideoClassificationPredictionResult.IdentifiedClassification = (function() { + + /** + * Properties of an IdentifiedClassification. + * @memberof google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult + * @interface IIdentifiedClassification + * @property {string|null} [id] IdentifiedClassification id + * @property {string|null} [displayName] IdentifiedClassification displayName + * @property {number|null} [confidence] IdentifiedClassification confidence + */ + + /** + * Constructs a new IdentifiedClassification. + * @memberof google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult + * @classdesc Represents an IdentifiedClassification. + * @implements IIdentifiedClassification + * @constructor + * @param {google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult.IIdentifiedClassification=} [properties] Properties to set + */ + function IdentifiedClassification(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * IdentifiedClassification id. + * @member {string} id + * @memberof google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult.IdentifiedClassification + * @instance + */ + IdentifiedClassification.prototype.id = ""; + + /** + * IdentifiedClassification displayName. + * @member {string} displayName + * @memberof google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult.IdentifiedClassification + * @instance + */ + IdentifiedClassification.prototype.displayName = ""; + + /** + * IdentifiedClassification confidence. + * @member {number} confidence + * @memberof google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult.IdentifiedClassification + * @instance + */ + IdentifiedClassification.prototype.confidence = 0; + + /** + * Creates a new IdentifiedClassification instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult.IdentifiedClassification + * @static + * @param {google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult.IIdentifiedClassification=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult.IdentifiedClassification} IdentifiedClassification instance + */ + IdentifiedClassification.create = function create(properties) { + return new IdentifiedClassification(properties); + }; + + /** + * Encodes the specified IdentifiedClassification message. Does not implicitly {@link google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult.IdentifiedClassification.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult.IdentifiedClassification + * @static + * @param {google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult.IIdentifiedClassification} message IdentifiedClassification message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentifiedClassification.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified IdentifiedClassification message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult.IdentifiedClassification.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult.IdentifiedClassification + * @static + * @param {google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult.IIdentifiedClassification} message IdentifiedClassification message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentifiedClassification.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IdentifiedClassification message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult.IdentifiedClassification + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult.IdentifiedClassification} IdentifiedClassification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentifiedClassification.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult.IdentifiedClassification(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.confidence = reader.float(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an IdentifiedClassification message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult.IdentifiedClassification + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult.IdentifiedClassification} IdentifiedClassification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentifiedClassification.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IdentifiedClassification message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult.IdentifiedClassification + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IdentifiedClassification.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates an IdentifiedClassification message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult.IdentifiedClassification + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult.IdentifiedClassification} IdentifiedClassification + */ + IdentifiedClassification.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult.IdentifiedClassification) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult.IdentifiedClassification(); + if (object.id != null) + message.id = String(object.id); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from an IdentifiedClassification message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult.IdentifiedClassification + * @static + * @param {google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult.IdentifiedClassification} message IdentifiedClassification + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IdentifiedClassification.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.displayName = ""; + object.confidence = 0; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this IdentifiedClassification to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult.IdentifiedClassification + * @instance + * @returns {Object.} JSON object + */ + IdentifiedClassification.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IdentifiedClassification + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult.IdentifiedClassification + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IdentifiedClassification.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.VideoClassificationPredictionResult.IdentifiedClassification"; + }; + + return IdentifiedClassification; + })(); + + return VideoClassificationPredictionResult; + })(); + + v1alpha1.OccupancyCountingPredictionResult = (function() { + + /** + * Properties of an OccupancyCountingPredictionResult. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IOccupancyCountingPredictionResult + * @property {google.protobuf.ITimestamp|null} [currentTime] OccupancyCountingPredictionResult currentTime + * @property {Array.|null} [identifiedBoxes] OccupancyCountingPredictionResult identifiedBoxes + * @property {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IStats|null} [stats] OccupancyCountingPredictionResult stats + * @property {Array.|null} [trackInfo] OccupancyCountingPredictionResult trackInfo + * @property {Array.|null} [dwellTimeInfo] OccupancyCountingPredictionResult dwellTimeInfo + */ + + /** + * Constructs a new OccupancyCountingPredictionResult. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents an OccupancyCountingPredictionResult. + * @implements IOccupancyCountingPredictionResult + * @constructor + * @param {google.cloud.visionai.v1alpha1.IOccupancyCountingPredictionResult=} [properties] Properties to set + */ + function OccupancyCountingPredictionResult(properties) { + this.identifiedBoxes = []; + this.trackInfo = []; + this.dwellTimeInfo = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * OccupancyCountingPredictionResult currentTime. + * @member {google.protobuf.ITimestamp|null|undefined} currentTime + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult + * @instance + */ + OccupancyCountingPredictionResult.prototype.currentTime = null; + + /** + * OccupancyCountingPredictionResult identifiedBoxes. + * @member {Array.} identifiedBoxes + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult + * @instance + */ + OccupancyCountingPredictionResult.prototype.identifiedBoxes = $util.emptyArray; + + /** + * OccupancyCountingPredictionResult stats. + * @member {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IStats|null|undefined} stats + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult + * @instance + */ + OccupancyCountingPredictionResult.prototype.stats = null; + + /** + * OccupancyCountingPredictionResult trackInfo. + * @member {Array.} trackInfo + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult + * @instance + */ + OccupancyCountingPredictionResult.prototype.trackInfo = $util.emptyArray; + + /** + * OccupancyCountingPredictionResult dwellTimeInfo. + * @member {Array.} dwellTimeInfo + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult + * @instance + */ + OccupancyCountingPredictionResult.prototype.dwellTimeInfo = $util.emptyArray; + + /** + * Creates a new OccupancyCountingPredictionResult instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult + * @static + * @param {google.cloud.visionai.v1alpha1.IOccupancyCountingPredictionResult=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult} OccupancyCountingPredictionResult instance + */ + OccupancyCountingPredictionResult.create = function create(properties) { + return new OccupancyCountingPredictionResult(properties); + }; + + /** + * Encodes the specified OccupancyCountingPredictionResult message. Does not implicitly {@link google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult + * @static + * @param {google.cloud.visionai.v1alpha1.IOccupancyCountingPredictionResult} message OccupancyCountingPredictionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OccupancyCountingPredictionResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.currentTime != null && Object.hasOwnProperty.call(message, "currentTime")) + $root.google.protobuf.Timestamp.encode(message.currentTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.identifiedBoxes != null && message.identifiedBoxes.length) + for (var i = 0; i < message.identifiedBoxes.length; ++i) + $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.encode(message.identifiedBoxes[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.stats != null && Object.hasOwnProperty.call(message, "stats")) + $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.encode(message.stats, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.trackInfo != null && message.trackInfo.length) + for (var i = 0; i < message.trackInfo.length; ++i) + $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.TrackInfo.encode(message.trackInfo[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.dwellTimeInfo != null && message.dwellTimeInfo.length) + for (var i = 0; i < message.dwellTimeInfo.length; ++i) + $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.DwellTimeInfo.encode(message.dwellTimeInfo[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OccupancyCountingPredictionResult message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult + * @static + * @param {google.cloud.visionai.v1alpha1.IOccupancyCountingPredictionResult} message OccupancyCountingPredictionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OccupancyCountingPredictionResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OccupancyCountingPredictionResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult} OccupancyCountingPredictionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OccupancyCountingPredictionResult.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.currentTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + if (!(message.identifiedBoxes && message.identifiedBoxes.length)) + message.identifiedBoxes = []; + message.identifiedBoxes.push($root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 3: { + message.stats = $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + if (!(message.trackInfo && message.trackInfo.length)) + message.trackInfo = []; + message.trackInfo.push($root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.TrackInfo.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 5: { + if (!(message.dwellTimeInfo && message.dwellTimeInfo.length)) + message.dwellTimeInfo = []; + message.dwellTimeInfo.push($root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.DwellTimeInfo.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an OccupancyCountingPredictionResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult} OccupancyCountingPredictionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OccupancyCountingPredictionResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OccupancyCountingPredictionResult message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OccupancyCountingPredictionResult.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.currentTime != null && message.hasOwnProperty("currentTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.currentTime, long + 1); + if (error) + return "currentTime." + error; + } + if (message.identifiedBoxes != null && message.hasOwnProperty("identifiedBoxes")) { + if (!Array.isArray(message.identifiedBoxes)) + return "identifiedBoxes: array expected"; + for (var i = 0; i < message.identifiedBoxes.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.verify(message.identifiedBoxes[i], long + 1); + if (error) + return "identifiedBoxes." + error; + } + } + if (message.stats != null && message.hasOwnProperty("stats")) { + var error = $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.verify(message.stats, long + 1); + if (error) + return "stats." + error; + } + if (message.trackInfo != null && message.hasOwnProperty("trackInfo")) { + if (!Array.isArray(message.trackInfo)) + return "trackInfo: array expected"; + for (var i = 0; i < message.trackInfo.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.TrackInfo.verify(message.trackInfo[i], long + 1); + if (error) + return "trackInfo." + error; + } + } + if (message.dwellTimeInfo != null && message.hasOwnProperty("dwellTimeInfo")) { + if (!Array.isArray(message.dwellTimeInfo)) + return "dwellTimeInfo: array expected"; + for (var i = 0; i < message.dwellTimeInfo.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.DwellTimeInfo.verify(message.dwellTimeInfo[i], long + 1); + if (error) + return "dwellTimeInfo." + error; + } + } + return null; + }; + + /** + * Creates an OccupancyCountingPredictionResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult} OccupancyCountingPredictionResult + */ + OccupancyCountingPredictionResult.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult(); + if (object.currentTime != null) { + if (typeof object.currentTime !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.currentTime: object expected"); + message.currentTime = $root.google.protobuf.Timestamp.fromObject(object.currentTime, long + 1); + } + if (object.identifiedBoxes) { + if (!Array.isArray(object.identifiedBoxes)) + throw TypeError(".google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.identifiedBoxes: array expected"); + message.identifiedBoxes = []; + for (var i = 0; i < object.identifiedBoxes.length; ++i) { + if (typeof object.identifiedBoxes[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.identifiedBoxes: object expected"); + message.identifiedBoxes[i] = $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.fromObject(object.identifiedBoxes[i], long + 1); + } + } + if (object.stats != null) { + if (typeof object.stats !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.stats: object expected"); + message.stats = $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.fromObject(object.stats, long + 1); + } + if (object.trackInfo) { + if (!Array.isArray(object.trackInfo)) + throw TypeError(".google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.trackInfo: array expected"); + message.trackInfo = []; + for (var i = 0; i < object.trackInfo.length; ++i) { + if (typeof object.trackInfo[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.trackInfo: object expected"); + message.trackInfo[i] = $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.TrackInfo.fromObject(object.trackInfo[i], long + 1); + } + } + if (object.dwellTimeInfo) { + if (!Array.isArray(object.dwellTimeInfo)) + throw TypeError(".google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.dwellTimeInfo: array expected"); + message.dwellTimeInfo = []; + for (var i = 0; i < object.dwellTimeInfo.length; ++i) { + if (typeof object.dwellTimeInfo[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.dwellTimeInfo: object expected"); + message.dwellTimeInfo[i] = $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.DwellTimeInfo.fromObject(object.dwellTimeInfo[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from an OccupancyCountingPredictionResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult + * @static + * @param {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult} message OccupancyCountingPredictionResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OccupancyCountingPredictionResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.identifiedBoxes = []; + object.trackInfo = []; + object.dwellTimeInfo = []; + } + if (options.defaults) { + object.currentTime = null; + object.stats = null; + } + if (message.currentTime != null && message.hasOwnProperty("currentTime")) + object.currentTime = $root.google.protobuf.Timestamp.toObject(message.currentTime, options); + if (message.identifiedBoxes && message.identifiedBoxes.length) { + object.identifiedBoxes = []; + for (var j = 0; j < message.identifiedBoxes.length; ++j) + object.identifiedBoxes[j] = $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.toObject(message.identifiedBoxes[j], options); + } + if (message.stats != null && message.hasOwnProperty("stats")) + object.stats = $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.toObject(message.stats, options); + if (message.trackInfo && message.trackInfo.length) { + object.trackInfo = []; + for (var j = 0; j < message.trackInfo.length; ++j) + object.trackInfo[j] = $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.TrackInfo.toObject(message.trackInfo[j], options); + } + if (message.dwellTimeInfo && message.dwellTimeInfo.length) { + object.dwellTimeInfo = []; + for (var j = 0; j < message.dwellTimeInfo.length; ++j) + object.dwellTimeInfo[j] = $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.DwellTimeInfo.toObject(message.dwellTimeInfo[j], options); + } + return object; + }; + + /** + * Converts this OccupancyCountingPredictionResult to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult + * @instance + * @returns {Object.} JSON object + */ + OccupancyCountingPredictionResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OccupancyCountingPredictionResult + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OccupancyCountingPredictionResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult"; + }; + + OccupancyCountingPredictionResult.Entity = (function() { + + /** + * Properties of an Entity. + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult + * @interface IEntity + * @property {number|Long|null} [labelId] Entity labelId + * @property {string|null} [labelString] Entity labelString + */ + + /** + * Constructs a new Entity. + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult + * @classdesc Represents an Entity. + * @implements IEntity + * @constructor + * @param {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IEntity=} [properties] Properties to set + */ + function Entity(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Entity labelId. + * @member {number|Long} labelId + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Entity + * @instance + */ + Entity.prototype.labelId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Entity labelString. + * @member {string} labelString + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Entity + * @instance + */ + Entity.prototype.labelString = ""; + + /** + * Creates a new Entity instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Entity + * @static + * @param {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IEntity=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Entity} Entity instance + */ + Entity.create = function create(properties) { + return new Entity(properties); + }; + + /** + * Encodes the specified Entity message. Does not implicitly {@link google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Entity.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Entity + * @static + * @param {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IEntity} message Entity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.labelId != null && Object.hasOwnProperty.call(message, "labelId")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.labelId); + if (message.labelString != null && Object.hasOwnProperty.call(message, "labelString")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.labelString); + return writer; + }; + + /** + * Encodes the specified Entity message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Entity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Entity + * @static + * @param {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IEntity} message Entity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Entity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Entity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Entity} Entity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entity.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Entity(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.labelId = reader.int64(); + break; + } + case 2: { + message.labelString = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an Entity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Entity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Entity} Entity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Entity message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Entity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Entity.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.labelId != null && message.hasOwnProperty("labelId")) + if (!$util.isInteger(message.labelId) && !(message.labelId && $util.isInteger(message.labelId.low) && $util.isInteger(message.labelId.high))) + return "labelId: integer|Long expected"; + if (message.labelString != null && message.hasOwnProperty("labelString")) + if (!$util.isString(message.labelString)) + return "labelString: string expected"; + return null; + }; + + /** + * Creates an Entity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Entity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Entity} Entity + */ + Entity.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Entity) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Entity(); + if (object.labelId != null) + if ($util.Long) + (message.labelId = $util.Long.fromValue(object.labelId)).unsigned = false; + else if (typeof object.labelId === "string") + message.labelId = parseInt(object.labelId, 10); + else if (typeof object.labelId === "number") + message.labelId = object.labelId; + else if (typeof object.labelId === "object") + message.labelId = new $util.LongBits(object.labelId.low >>> 0, object.labelId.high >>> 0).toNumber(); + if (object.labelString != null) + message.labelString = String(object.labelString); + return message; + }; + + /** + * Creates a plain object from an Entity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Entity + * @static + * @param {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Entity} message Entity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Entity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.labelId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.labelId = options.longs === String ? "0" : 0; + object.labelString = ""; + } + if (message.labelId != null && message.hasOwnProperty("labelId")) + if (typeof message.labelId === "number") + object.labelId = options.longs === String ? String(message.labelId) : message.labelId; + else + object.labelId = options.longs === String ? $util.Long.prototype.toString.call(message.labelId) : options.longs === Number ? new $util.LongBits(message.labelId.low >>> 0, message.labelId.high >>> 0).toNumber() : message.labelId; + if (message.labelString != null && message.hasOwnProperty("labelString")) + object.labelString = message.labelString; + return object; + }; + + /** + * Converts this Entity to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Entity + * @instance + * @returns {Object.} JSON object + */ + Entity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Entity + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Entity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Entity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Entity"; + }; + + return Entity; + })(); + + OccupancyCountingPredictionResult.IdentifiedBox = (function() { + + /** + * Properties of an IdentifiedBox. + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult + * @interface IIdentifiedBox + * @property {number|Long|null} [boxId] IdentifiedBox boxId + * @property {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.INormalizedBoundingBox|null} [normalizedBoundingBox] IdentifiedBox normalizedBoundingBox + * @property {number|null} [score] IdentifiedBox score + * @property {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IEntity|null} [entity] IdentifiedBox entity + * @property {number|Long|null} [trackId] IdentifiedBox trackId + */ + + /** + * Constructs a new IdentifiedBox. + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult + * @classdesc Represents an IdentifiedBox. + * @implements IIdentifiedBox + * @constructor + * @param {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IIdentifiedBox=} [properties] Properties to set + */ + function IdentifiedBox(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * IdentifiedBox boxId. + * @member {number|Long} boxId + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox + * @instance + */ + IdentifiedBox.prototype.boxId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * IdentifiedBox normalizedBoundingBox. + * @member {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.INormalizedBoundingBox|null|undefined} normalizedBoundingBox + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox + * @instance + */ + IdentifiedBox.prototype.normalizedBoundingBox = null; + + /** + * IdentifiedBox score. + * @member {number} score + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox + * @instance + */ + IdentifiedBox.prototype.score = 0; + + /** + * IdentifiedBox entity. + * @member {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IEntity|null|undefined} entity + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox + * @instance + */ + IdentifiedBox.prototype.entity = null; + + /** + * IdentifiedBox trackId. + * @member {number|Long} trackId + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox + * @instance + */ + IdentifiedBox.prototype.trackId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new IdentifiedBox instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox + * @static + * @param {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IIdentifiedBox=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox} IdentifiedBox instance + */ + IdentifiedBox.create = function create(properties) { + return new IdentifiedBox(properties); + }; + + /** + * Encodes the specified IdentifiedBox message. Does not implicitly {@link google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox + * @static + * @param {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IIdentifiedBox} message IdentifiedBox message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentifiedBox.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.boxId != null && Object.hasOwnProperty.call(message, "boxId")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.boxId); + if (message.normalizedBoundingBox != null && Object.hasOwnProperty.call(message, "normalizedBoundingBox")) + $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.NormalizedBoundingBox.encode(message.normalizedBoundingBox, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.score != null && Object.hasOwnProperty.call(message, "score")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.score); + if (message.entity != null && Object.hasOwnProperty.call(message, "entity")) + $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Entity.encode(message.entity, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.trackId != null && Object.hasOwnProperty.call(message, "trackId")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.trackId); + return writer; + }; + + /** + * Encodes the specified IdentifiedBox message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox + * @static + * @param {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IIdentifiedBox} message IdentifiedBox message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentifiedBox.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IdentifiedBox message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox} IdentifiedBox + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentifiedBox.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.boxId = reader.int64(); + break; + } + case 2: { + message.normalizedBoundingBox = $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.NormalizedBoundingBox.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.score = reader.float(); + break; + } + case 4: { + message.entity = $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Entity.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.trackId = reader.int64(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an IdentifiedBox message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox} IdentifiedBox + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentifiedBox.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IdentifiedBox message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IdentifiedBox.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.boxId != null && message.hasOwnProperty("boxId")) + if (!$util.isInteger(message.boxId) && !(message.boxId && $util.isInteger(message.boxId.low) && $util.isInteger(message.boxId.high))) + return "boxId: integer|Long expected"; + if (message.normalizedBoundingBox != null && message.hasOwnProperty("normalizedBoundingBox")) { + var error = $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.NormalizedBoundingBox.verify(message.normalizedBoundingBox, long + 1); + if (error) + return "normalizedBoundingBox." + error; + } + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + if (message.entity != null && message.hasOwnProperty("entity")) { + var error = $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Entity.verify(message.entity, long + 1); + if (error) + return "entity." + error; + } + if (message.trackId != null && message.hasOwnProperty("trackId")) + if (!$util.isInteger(message.trackId) && !(message.trackId && $util.isInteger(message.trackId.low) && $util.isInteger(message.trackId.high))) + return "trackId: integer|Long expected"; + return null; + }; + + /** + * Creates an IdentifiedBox message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox} IdentifiedBox + */ + IdentifiedBox.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox(); + if (object.boxId != null) + if ($util.Long) + (message.boxId = $util.Long.fromValue(object.boxId)).unsigned = false; + else if (typeof object.boxId === "string") + message.boxId = parseInt(object.boxId, 10); + else if (typeof object.boxId === "number") + message.boxId = object.boxId; + else if (typeof object.boxId === "object") + message.boxId = new $util.LongBits(object.boxId.low >>> 0, object.boxId.high >>> 0).toNumber(); + if (object.normalizedBoundingBox != null) { + if (typeof object.normalizedBoundingBox !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.normalizedBoundingBox: object expected"); + message.normalizedBoundingBox = $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.NormalizedBoundingBox.fromObject(object.normalizedBoundingBox, long + 1); + } + if (object.score != null) + message.score = Number(object.score); + if (object.entity != null) { + if (typeof object.entity !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.entity: object expected"); + message.entity = $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Entity.fromObject(object.entity, long + 1); + } + if (object.trackId != null) + if ($util.Long) + (message.trackId = $util.Long.fromValue(object.trackId)).unsigned = false; + else if (typeof object.trackId === "string") + message.trackId = parseInt(object.trackId, 10); + else if (typeof object.trackId === "number") + message.trackId = object.trackId; + else if (typeof object.trackId === "object") + message.trackId = new $util.LongBits(object.trackId.low >>> 0, object.trackId.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an IdentifiedBox message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox + * @static + * @param {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox} message IdentifiedBox + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IdentifiedBox.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.boxId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.boxId = options.longs === String ? "0" : 0; + object.normalizedBoundingBox = null; + object.score = 0; + object.entity = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.trackId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.trackId = options.longs === String ? "0" : 0; + } + if (message.boxId != null && message.hasOwnProperty("boxId")) + if (typeof message.boxId === "number") + object.boxId = options.longs === String ? String(message.boxId) : message.boxId; + else + object.boxId = options.longs === String ? $util.Long.prototype.toString.call(message.boxId) : options.longs === Number ? new $util.LongBits(message.boxId.low >>> 0, message.boxId.high >>> 0).toNumber() : message.boxId; + if (message.normalizedBoundingBox != null && message.hasOwnProperty("normalizedBoundingBox")) + object.normalizedBoundingBox = $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.NormalizedBoundingBox.toObject(message.normalizedBoundingBox, options); + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (message.entity != null && message.hasOwnProperty("entity")) + object.entity = $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Entity.toObject(message.entity, options); + if (message.trackId != null && message.hasOwnProperty("trackId")) + if (typeof message.trackId === "number") + object.trackId = options.longs === String ? String(message.trackId) : message.trackId; + else + object.trackId = options.longs === String ? $util.Long.prototype.toString.call(message.trackId) : options.longs === Number ? new $util.LongBits(message.trackId.low >>> 0, message.trackId.high >>> 0).toNumber() : message.trackId; + return object; + }; + + /** + * Converts this IdentifiedBox to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox + * @instance + * @returns {Object.} JSON object + */ + IdentifiedBox.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IdentifiedBox + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IdentifiedBox.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox"; + }; + + IdentifiedBox.NormalizedBoundingBox = (function() { + + /** + * Properties of a NormalizedBoundingBox. + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox + * @interface INormalizedBoundingBox + * @property {number|null} [xmin] NormalizedBoundingBox xmin + * @property {number|null} [ymin] NormalizedBoundingBox ymin + * @property {number|null} [width] NormalizedBoundingBox width + * @property {number|null} [height] NormalizedBoundingBox height + */ + + /** + * Constructs a new NormalizedBoundingBox. + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox + * @classdesc Represents a NormalizedBoundingBox. + * @implements INormalizedBoundingBox + * @constructor + * @param {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.INormalizedBoundingBox=} [properties] Properties to set + */ + function NormalizedBoundingBox(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * NormalizedBoundingBox xmin. + * @member {number} xmin + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.NormalizedBoundingBox + * @instance + */ + NormalizedBoundingBox.prototype.xmin = 0; + + /** + * NormalizedBoundingBox ymin. + * @member {number} ymin + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.NormalizedBoundingBox + * @instance + */ + NormalizedBoundingBox.prototype.ymin = 0; + + /** + * NormalizedBoundingBox width. + * @member {number} width + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.NormalizedBoundingBox + * @instance + */ + NormalizedBoundingBox.prototype.width = 0; + + /** + * NormalizedBoundingBox height. + * @member {number} height + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.NormalizedBoundingBox + * @instance + */ + NormalizedBoundingBox.prototype.height = 0; + + /** + * Creates a new NormalizedBoundingBox instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.NormalizedBoundingBox + * @static + * @param {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.INormalizedBoundingBox=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.NormalizedBoundingBox} NormalizedBoundingBox instance + */ + NormalizedBoundingBox.create = function create(properties) { + return new NormalizedBoundingBox(properties); + }; + + /** + * Encodes the specified NormalizedBoundingBox message. Does not implicitly {@link google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.NormalizedBoundingBox.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.NormalizedBoundingBox + * @static + * @param {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.INormalizedBoundingBox} message NormalizedBoundingBox message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NormalizedBoundingBox.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.xmin != null && Object.hasOwnProperty.call(message, "xmin")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.xmin); + if (message.ymin != null && Object.hasOwnProperty.call(message, "ymin")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.ymin); + if (message.width != null && Object.hasOwnProperty.call(message, "width")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.width); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.height); + return writer; + }; + + /** + * Encodes the specified NormalizedBoundingBox message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.NormalizedBoundingBox.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.NormalizedBoundingBox + * @static + * @param {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.INormalizedBoundingBox} message NormalizedBoundingBox message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NormalizedBoundingBox.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NormalizedBoundingBox message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.NormalizedBoundingBox + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.NormalizedBoundingBox} NormalizedBoundingBox + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NormalizedBoundingBox.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.NormalizedBoundingBox(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.xmin = reader.float(); + break; + } + case 2: { + message.ymin = reader.float(); + break; + } + case 3: { + message.width = reader.float(); + break; + } + case 4: { + message.height = reader.float(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a NormalizedBoundingBox message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.NormalizedBoundingBox + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.NormalizedBoundingBox} NormalizedBoundingBox + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NormalizedBoundingBox.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NormalizedBoundingBox message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.NormalizedBoundingBox + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NormalizedBoundingBox.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.xmin != null && message.hasOwnProperty("xmin")) + if (typeof message.xmin !== "number") + return "xmin: number expected"; + if (message.ymin != null && message.hasOwnProperty("ymin")) + if (typeof message.ymin !== "number") + return "ymin: number expected"; + if (message.width != null && message.hasOwnProperty("width")) + if (typeof message.width !== "number") + return "width: number expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (typeof message.height !== "number") + return "height: number expected"; + return null; + }; + + /** + * Creates a NormalizedBoundingBox message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.NormalizedBoundingBox + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.NormalizedBoundingBox} NormalizedBoundingBox + */ + NormalizedBoundingBox.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.NormalizedBoundingBox) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.NormalizedBoundingBox(); + if (object.xmin != null) + message.xmin = Number(object.xmin); + if (object.ymin != null) + message.ymin = Number(object.ymin); + if (object.width != null) + message.width = Number(object.width); + if (object.height != null) + message.height = Number(object.height); + return message; + }; + + /** + * Creates a plain object from a NormalizedBoundingBox message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.NormalizedBoundingBox + * @static + * @param {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.NormalizedBoundingBox} message NormalizedBoundingBox + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NormalizedBoundingBox.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.xmin = 0; + object.ymin = 0; + object.width = 0; + object.height = 0; + } + if (message.xmin != null && message.hasOwnProperty("xmin")) + object.xmin = options.json && !isFinite(message.xmin) ? String(message.xmin) : message.xmin; + if (message.ymin != null && message.hasOwnProperty("ymin")) + object.ymin = options.json && !isFinite(message.ymin) ? String(message.ymin) : message.ymin; + if (message.width != null && message.hasOwnProperty("width")) + object.width = options.json && !isFinite(message.width) ? String(message.width) : message.width; + if (message.height != null && message.hasOwnProperty("height")) + object.height = options.json && !isFinite(message.height) ? String(message.height) : message.height; + return object; + }; + + /** + * Converts this NormalizedBoundingBox to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.NormalizedBoundingBox + * @instance + * @returns {Object.} JSON object + */ + NormalizedBoundingBox.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NormalizedBoundingBox + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.NormalizedBoundingBox + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NormalizedBoundingBox.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IdentifiedBox.NormalizedBoundingBox"; + }; + + return NormalizedBoundingBox; + })(); + + return IdentifiedBox; + })(); + + OccupancyCountingPredictionResult.Stats = (function() { + + /** + * Properties of a Stats. + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult + * @interface IStats + * @property {Array.|null} [fullFrameCount] Stats fullFrameCount + * @property {Array.|null} [crossingLineCounts] Stats crossingLineCounts + * @property {Array.|null} [activeZoneCounts] Stats activeZoneCounts + */ + + /** + * Constructs a new Stats. + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult + * @classdesc Represents a Stats. + * @implements IStats + * @constructor + * @param {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IStats=} [properties] Properties to set + */ + function Stats(properties) { + this.fullFrameCount = []; + this.crossingLineCounts = []; + this.activeZoneCounts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Stats fullFrameCount. + * @member {Array.} fullFrameCount + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats + * @instance + */ + Stats.prototype.fullFrameCount = $util.emptyArray; + + /** + * Stats crossingLineCounts. + * @member {Array.} crossingLineCounts + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats + * @instance + */ + Stats.prototype.crossingLineCounts = $util.emptyArray; + + /** + * Stats activeZoneCounts. + * @member {Array.} activeZoneCounts + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats + * @instance + */ + Stats.prototype.activeZoneCounts = $util.emptyArray; + + /** + * Creates a new Stats instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats + * @static + * @param {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IStats=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats} Stats instance + */ + Stats.create = function create(properties) { + return new Stats(properties); + }; + + /** + * Encodes the specified Stats message. Does not implicitly {@link google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats + * @static + * @param {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IStats} message Stats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Stats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fullFrameCount != null && message.fullFrameCount.length) + for (var i = 0; i < message.fullFrameCount.length; ++i) + $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ObjectCount.encode(message.fullFrameCount[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.crossingLineCounts != null && message.crossingLineCounts.length) + for (var i = 0; i < message.crossingLineCounts.length; ++i) + $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.CrossingLineCount.encode(message.crossingLineCounts[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.activeZoneCounts != null && message.activeZoneCounts.length) + for (var i = 0; i < message.activeZoneCounts.length; ++i) + $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ActiveZoneCount.encode(message.activeZoneCounts[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Stats message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats + * @static + * @param {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IStats} message Stats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Stats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Stats message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats} Stats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Stats.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.fullFrameCount && message.fullFrameCount.length)) + message.fullFrameCount = []; + message.fullFrameCount.push($root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ObjectCount.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + if (!(message.crossingLineCounts && message.crossingLineCounts.length)) + message.crossingLineCounts = []; + message.crossingLineCounts.push($root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.CrossingLineCount.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 3: { + if (!(message.activeZoneCounts && message.activeZoneCounts.length)) + message.activeZoneCounts = []; + message.activeZoneCounts.push($root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ActiveZoneCount.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Stats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats} Stats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Stats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Stats message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Stats.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.fullFrameCount != null && message.hasOwnProperty("fullFrameCount")) { + if (!Array.isArray(message.fullFrameCount)) + return "fullFrameCount: array expected"; + for (var i = 0; i < message.fullFrameCount.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ObjectCount.verify(message.fullFrameCount[i], long + 1); + if (error) + return "fullFrameCount." + error; + } + } + if (message.crossingLineCounts != null && message.hasOwnProperty("crossingLineCounts")) { + if (!Array.isArray(message.crossingLineCounts)) + return "crossingLineCounts: array expected"; + for (var i = 0; i < message.crossingLineCounts.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.CrossingLineCount.verify(message.crossingLineCounts[i], long + 1); + if (error) + return "crossingLineCounts." + error; + } + } + if (message.activeZoneCounts != null && message.hasOwnProperty("activeZoneCounts")) { + if (!Array.isArray(message.activeZoneCounts)) + return "activeZoneCounts: array expected"; + for (var i = 0; i < message.activeZoneCounts.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ActiveZoneCount.verify(message.activeZoneCounts[i], long + 1); + if (error) + return "activeZoneCounts." + error; + } + } + return null; + }; + + /** + * Creates a Stats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats} Stats + */ + Stats.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats(); + if (object.fullFrameCount) { + if (!Array.isArray(object.fullFrameCount)) + throw TypeError(".google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.fullFrameCount: array expected"); + message.fullFrameCount = []; + for (var i = 0; i < object.fullFrameCount.length; ++i) { + if (typeof object.fullFrameCount[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.fullFrameCount: object expected"); + message.fullFrameCount[i] = $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ObjectCount.fromObject(object.fullFrameCount[i], long + 1); + } + } + if (object.crossingLineCounts) { + if (!Array.isArray(object.crossingLineCounts)) + throw TypeError(".google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.crossingLineCounts: array expected"); + message.crossingLineCounts = []; + for (var i = 0; i < object.crossingLineCounts.length; ++i) { + if (typeof object.crossingLineCounts[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.crossingLineCounts: object expected"); + message.crossingLineCounts[i] = $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.CrossingLineCount.fromObject(object.crossingLineCounts[i], long + 1); + } + } + if (object.activeZoneCounts) { + if (!Array.isArray(object.activeZoneCounts)) + throw TypeError(".google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.activeZoneCounts: array expected"); + message.activeZoneCounts = []; + for (var i = 0; i < object.activeZoneCounts.length; ++i) { + if (typeof object.activeZoneCounts[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.activeZoneCounts: object expected"); + message.activeZoneCounts[i] = $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ActiveZoneCount.fromObject(object.activeZoneCounts[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a Stats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats + * @static + * @param {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats} message Stats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Stats.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.fullFrameCount = []; + object.crossingLineCounts = []; + object.activeZoneCounts = []; + } + if (message.fullFrameCount && message.fullFrameCount.length) { + object.fullFrameCount = []; + for (var j = 0; j < message.fullFrameCount.length; ++j) + object.fullFrameCount[j] = $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ObjectCount.toObject(message.fullFrameCount[j], options); + } + if (message.crossingLineCounts && message.crossingLineCounts.length) { + object.crossingLineCounts = []; + for (var j = 0; j < message.crossingLineCounts.length; ++j) + object.crossingLineCounts[j] = $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.CrossingLineCount.toObject(message.crossingLineCounts[j], options); + } + if (message.activeZoneCounts && message.activeZoneCounts.length) { + object.activeZoneCounts = []; + for (var j = 0; j < message.activeZoneCounts.length; ++j) + object.activeZoneCounts[j] = $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ActiveZoneCount.toObject(message.activeZoneCounts[j], options); + } + return object; + }; + + /** + * Converts this Stats to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats + * @instance + * @returns {Object.} JSON object + */ + Stats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Stats + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Stats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats"; + }; + + Stats.ObjectCount = (function() { + + /** + * Properties of an ObjectCount. + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats + * @interface IObjectCount + * @property {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IEntity|null} [entity] ObjectCount entity + * @property {number|null} [count] ObjectCount count + */ + + /** + * Constructs a new ObjectCount. + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats + * @classdesc Represents an ObjectCount. + * @implements IObjectCount + * @constructor + * @param {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.IObjectCount=} [properties] Properties to set + */ + function ObjectCount(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ObjectCount entity. + * @member {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IEntity|null|undefined} entity + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ObjectCount + * @instance + */ + ObjectCount.prototype.entity = null; + + /** + * ObjectCount count. + * @member {number} count + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ObjectCount + * @instance + */ + ObjectCount.prototype.count = 0; + + /** + * Creates a new ObjectCount instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ObjectCount + * @static + * @param {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.IObjectCount=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ObjectCount} ObjectCount instance + */ + ObjectCount.create = function create(properties) { + return new ObjectCount(properties); + }; + + /** + * Encodes the specified ObjectCount message. Does not implicitly {@link google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ObjectCount.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ObjectCount + * @static + * @param {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.IObjectCount} message ObjectCount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObjectCount.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entity != null && Object.hasOwnProperty.call(message, "entity")) + $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Entity.encode(message.entity, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.count); + return writer; + }; + + /** + * Encodes the specified ObjectCount message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ObjectCount.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ObjectCount + * @static + * @param {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.IObjectCount} message ObjectCount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObjectCount.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ObjectCount message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ObjectCount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ObjectCount} ObjectCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObjectCount.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ObjectCount(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.entity = $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Entity.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.count = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ObjectCount message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ObjectCount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ObjectCount} ObjectCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObjectCount.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ObjectCount message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ObjectCount + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ObjectCount.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.entity != null && message.hasOwnProperty("entity")) { + var error = $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Entity.verify(message.entity, long + 1); + if (error) + return "entity." + error; + } + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count)) + return "count: integer expected"; + return null; + }; + + /** + * Creates an ObjectCount message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ObjectCount + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ObjectCount} ObjectCount + */ + ObjectCount.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ObjectCount) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ObjectCount(); + if (object.entity != null) { + if (typeof object.entity !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ObjectCount.entity: object expected"); + message.entity = $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Entity.fromObject(object.entity, long + 1); + } + if (object.count != null) + message.count = object.count | 0; + return message; + }; + + /** + * Creates a plain object from an ObjectCount message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ObjectCount + * @static + * @param {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ObjectCount} message ObjectCount + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ObjectCount.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.entity = null; + object.count = 0; + } + if (message.entity != null && message.hasOwnProperty("entity")) + object.entity = $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Entity.toObject(message.entity, options); + if (message.count != null && message.hasOwnProperty("count")) + object.count = message.count; + return object; + }; + + /** + * Converts this ObjectCount to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ObjectCount + * @instance + * @returns {Object.} JSON object + */ + ObjectCount.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ObjectCount + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ObjectCount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ObjectCount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ObjectCount"; + }; + + return ObjectCount; + })(); + + Stats.AccumulatedObjectCount = (function() { + + /** + * Properties of an AccumulatedObjectCount. + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats + * @interface IAccumulatedObjectCount + * @property {google.protobuf.ITimestamp|null} [startTime] AccumulatedObjectCount startTime + * @property {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.IObjectCount|null} [objectCount] AccumulatedObjectCount objectCount + */ + + /** + * Constructs a new AccumulatedObjectCount. + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats + * @classdesc Represents an AccumulatedObjectCount. + * @implements IAccumulatedObjectCount + * @constructor + * @param {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.IAccumulatedObjectCount=} [properties] Properties to set + */ + function AccumulatedObjectCount(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * AccumulatedObjectCount startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.AccumulatedObjectCount + * @instance + */ + AccumulatedObjectCount.prototype.startTime = null; + + /** + * AccumulatedObjectCount objectCount. + * @member {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.IObjectCount|null|undefined} objectCount + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.AccumulatedObjectCount + * @instance + */ + AccumulatedObjectCount.prototype.objectCount = null; + + /** + * Creates a new AccumulatedObjectCount instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.AccumulatedObjectCount + * @static + * @param {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.IAccumulatedObjectCount=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.AccumulatedObjectCount} AccumulatedObjectCount instance + */ + AccumulatedObjectCount.create = function create(properties) { + return new AccumulatedObjectCount(properties); + }; + + /** + * Encodes the specified AccumulatedObjectCount message. Does not implicitly {@link google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.AccumulatedObjectCount.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.AccumulatedObjectCount + * @static + * @param {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.IAccumulatedObjectCount} message AccumulatedObjectCount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccumulatedObjectCount.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.objectCount != null && Object.hasOwnProperty.call(message, "objectCount")) + $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ObjectCount.encode(message.objectCount, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AccumulatedObjectCount message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.AccumulatedObjectCount.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.AccumulatedObjectCount + * @static + * @param {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.IAccumulatedObjectCount} message AccumulatedObjectCount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccumulatedObjectCount.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AccumulatedObjectCount message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.AccumulatedObjectCount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.AccumulatedObjectCount} AccumulatedObjectCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccumulatedObjectCount.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.AccumulatedObjectCount(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.objectCount = $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ObjectCount.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an AccumulatedObjectCount message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.AccumulatedObjectCount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.AccumulatedObjectCount} AccumulatedObjectCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccumulatedObjectCount.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AccumulatedObjectCount message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.AccumulatedObjectCount + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AccumulatedObjectCount.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime, long + 1); + if (error) + return "startTime." + error; + } + if (message.objectCount != null && message.hasOwnProperty("objectCount")) { + var error = $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ObjectCount.verify(message.objectCount, long + 1); + if (error) + return "objectCount." + error; + } + return null; + }; + + /** + * Creates an AccumulatedObjectCount message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.AccumulatedObjectCount + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.AccumulatedObjectCount} AccumulatedObjectCount + */ + AccumulatedObjectCount.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.AccumulatedObjectCount) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.AccumulatedObjectCount(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.AccumulatedObjectCount.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime, long + 1); + } + if (object.objectCount != null) { + if (typeof object.objectCount !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.AccumulatedObjectCount.objectCount: object expected"); + message.objectCount = $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ObjectCount.fromObject(object.objectCount, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an AccumulatedObjectCount message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.AccumulatedObjectCount + * @static + * @param {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.AccumulatedObjectCount} message AccumulatedObjectCount + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AccumulatedObjectCount.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startTime = null; + object.objectCount = null; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.objectCount != null && message.hasOwnProperty("objectCount")) + object.objectCount = $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ObjectCount.toObject(message.objectCount, options); + return object; + }; + + /** + * Converts this AccumulatedObjectCount to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.AccumulatedObjectCount + * @instance + * @returns {Object.} JSON object + */ + AccumulatedObjectCount.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AccumulatedObjectCount + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.AccumulatedObjectCount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccumulatedObjectCount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.AccumulatedObjectCount"; + }; + + return AccumulatedObjectCount; + })(); + + Stats.CrossingLineCount = (function() { + + /** + * Properties of a CrossingLineCount. + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats + * @interface ICrossingLineCount + * @property {google.cloud.visionai.v1alpha1.IStreamAnnotation|null} [annotation] CrossingLineCount annotation + * @property {Array.|null} [positiveDirectionCounts] CrossingLineCount positiveDirectionCounts + * @property {Array.|null} [negativeDirectionCounts] CrossingLineCount negativeDirectionCounts + * @property {Array.|null} [accumulatedPositiveDirectionCounts] CrossingLineCount accumulatedPositiveDirectionCounts + * @property {Array.|null} [accumulatedNegativeDirectionCounts] CrossingLineCount accumulatedNegativeDirectionCounts + */ + + /** + * Constructs a new CrossingLineCount. + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats + * @classdesc Represents a CrossingLineCount. + * @implements ICrossingLineCount + * @constructor + * @param {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ICrossingLineCount=} [properties] Properties to set + */ + function CrossingLineCount(properties) { + this.positiveDirectionCounts = []; + this.negativeDirectionCounts = []; + this.accumulatedPositiveDirectionCounts = []; + this.accumulatedNegativeDirectionCounts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CrossingLineCount annotation. + * @member {google.cloud.visionai.v1alpha1.IStreamAnnotation|null|undefined} annotation + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.CrossingLineCount + * @instance + */ + CrossingLineCount.prototype.annotation = null; + + /** + * CrossingLineCount positiveDirectionCounts. + * @member {Array.} positiveDirectionCounts + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.CrossingLineCount + * @instance + */ + CrossingLineCount.prototype.positiveDirectionCounts = $util.emptyArray; + + /** + * CrossingLineCount negativeDirectionCounts. + * @member {Array.} negativeDirectionCounts + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.CrossingLineCount + * @instance + */ + CrossingLineCount.prototype.negativeDirectionCounts = $util.emptyArray; + + /** + * CrossingLineCount accumulatedPositiveDirectionCounts. + * @member {Array.} accumulatedPositiveDirectionCounts + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.CrossingLineCount + * @instance + */ + CrossingLineCount.prototype.accumulatedPositiveDirectionCounts = $util.emptyArray; + + /** + * CrossingLineCount accumulatedNegativeDirectionCounts. + * @member {Array.} accumulatedNegativeDirectionCounts + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.CrossingLineCount + * @instance + */ + CrossingLineCount.prototype.accumulatedNegativeDirectionCounts = $util.emptyArray; + + /** + * Creates a new CrossingLineCount instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.CrossingLineCount + * @static + * @param {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ICrossingLineCount=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.CrossingLineCount} CrossingLineCount instance + */ + CrossingLineCount.create = function create(properties) { + return new CrossingLineCount(properties); + }; + + /** + * Encodes the specified CrossingLineCount message. Does not implicitly {@link google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.CrossingLineCount.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.CrossingLineCount + * @static + * @param {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ICrossingLineCount} message CrossingLineCount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CrossingLineCount.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && Object.hasOwnProperty.call(message, "annotation")) + $root.google.cloud.visionai.v1alpha1.StreamAnnotation.encode(message.annotation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.positiveDirectionCounts != null && message.positiveDirectionCounts.length) + for (var i = 0; i < message.positiveDirectionCounts.length; ++i) + $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ObjectCount.encode(message.positiveDirectionCounts[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.negativeDirectionCounts != null && message.negativeDirectionCounts.length) + for (var i = 0; i < message.negativeDirectionCounts.length; ++i) + $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ObjectCount.encode(message.negativeDirectionCounts[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.accumulatedPositiveDirectionCounts != null && message.accumulatedPositiveDirectionCounts.length) + for (var i = 0; i < message.accumulatedPositiveDirectionCounts.length; ++i) + $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.AccumulatedObjectCount.encode(message.accumulatedPositiveDirectionCounts[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.accumulatedNegativeDirectionCounts != null && message.accumulatedNegativeDirectionCounts.length) + for (var i = 0; i < message.accumulatedNegativeDirectionCounts.length; ++i) + $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.AccumulatedObjectCount.encode(message.accumulatedNegativeDirectionCounts[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CrossingLineCount message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.CrossingLineCount.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.CrossingLineCount + * @static + * @param {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ICrossingLineCount} message CrossingLineCount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CrossingLineCount.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CrossingLineCount message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.CrossingLineCount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.CrossingLineCount} CrossingLineCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CrossingLineCount.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.CrossingLineCount(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.annotation = $root.google.cloud.visionai.v1alpha1.StreamAnnotation.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + if (!(message.positiveDirectionCounts && message.positiveDirectionCounts.length)) + message.positiveDirectionCounts = []; + message.positiveDirectionCounts.push($root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ObjectCount.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 3: { + if (!(message.negativeDirectionCounts && message.negativeDirectionCounts.length)) + message.negativeDirectionCounts = []; + message.negativeDirectionCounts.push($root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ObjectCount.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 4: { + if (!(message.accumulatedPositiveDirectionCounts && message.accumulatedPositiveDirectionCounts.length)) + message.accumulatedPositiveDirectionCounts = []; + message.accumulatedPositiveDirectionCounts.push($root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.AccumulatedObjectCount.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 5: { + if (!(message.accumulatedNegativeDirectionCounts && message.accumulatedNegativeDirectionCounts.length)) + message.accumulatedNegativeDirectionCounts = []; + message.accumulatedNegativeDirectionCounts.push($root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.AccumulatedObjectCount.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CrossingLineCount message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.CrossingLineCount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.CrossingLineCount} CrossingLineCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CrossingLineCount.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CrossingLineCount message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.CrossingLineCount + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CrossingLineCount.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + var error = $root.google.cloud.visionai.v1alpha1.StreamAnnotation.verify(message.annotation, long + 1); + if (error) + return "annotation." + error; + } + if (message.positiveDirectionCounts != null && message.hasOwnProperty("positiveDirectionCounts")) { + if (!Array.isArray(message.positiveDirectionCounts)) + return "positiveDirectionCounts: array expected"; + for (var i = 0; i < message.positiveDirectionCounts.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ObjectCount.verify(message.positiveDirectionCounts[i], long + 1); + if (error) + return "positiveDirectionCounts." + error; + } + } + if (message.negativeDirectionCounts != null && message.hasOwnProperty("negativeDirectionCounts")) { + if (!Array.isArray(message.negativeDirectionCounts)) + return "negativeDirectionCounts: array expected"; + for (var i = 0; i < message.negativeDirectionCounts.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ObjectCount.verify(message.negativeDirectionCounts[i], long + 1); + if (error) + return "negativeDirectionCounts." + error; + } + } + if (message.accumulatedPositiveDirectionCounts != null && message.hasOwnProperty("accumulatedPositiveDirectionCounts")) { + if (!Array.isArray(message.accumulatedPositiveDirectionCounts)) + return "accumulatedPositiveDirectionCounts: array expected"; + for (var i = 0; i < message.accumulatedPositiveDirectionCounts.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.AccumulatedObjectCount.verify(message.accumulatedPositiveDirectionCounts[i], long + 1); + if (error) + return "accumulatedPositiveDirectionCounts." + error; + } + } + if (message.accumulatedNegativeDirectionCounts != null && message.hasOwnProperty("accumulatedNegativeDirectionCounts")) { + if (!Array.isArray(message.accumulatedNegativeDirectionCounts)) + return "accumulatedNegativeDirectionCounts: array expected"; + for (var i = 0; i < message.accumulatedNegativeDirectionCounts.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.AccumulatedObjectCount.verify(message.accumulatedNegativeDirectionCounts[i], long + 1); + if (error) + return "accumulatedNegativeDirectionCounts." + error; + } + } + return null; + }; + + /** + * Creates a CrossingLineCount message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.CrossingLineCount + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.CrossingLineCount} CrossingLineCount + */ + CrossingLineCount.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.CrossingLineCount) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.CrossingLineCount(); + if (object.annotation != null) { + if (typeof object.annotation !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.CrossingLineCount.annotation: object expected"); + message.annotation = $root.google.cloud.visionai.v1alpha1.StreamAnnotation.fromObject(object.annotation, long + 1); + } + if (object.positiveDirectionCounts) { + if (!Array.isArray(object.positiveDirectionCounts)) + throw TypeError(".google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.CrossingLineCount.positiveDirectionCounts: array expected"); + message.positiveDirectionCounts = []; + for (var i = 0; i < object.positiveDirectionCounts.length; ++i) { + if (typeof object.positiveDirectionCounts[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.CrossingLineCount.positiveDirectionCounts: object expected"); + message.positiveDirectionCounts[i] = $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ObjectCount.fromObject(object.positiveDirectionCounts[i], long + 1); + } + } + if (object.negativeDirectionCounts) { + if (!Array.isArray(object.negativeDirectionCounts)) + throw TypeError(".google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.CrossingLineCount.negativeDirectionCounts: array expected"); + message.negativeDirectionCounts = []; + for (var i = 0; i < object.negativeDirectionCounts.length; ++i) { + if (typeof object.negativeDirectionCounts[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.CrossingLineCount.negativeDirectionCounts: object expected"); + message.negativeDirectionCounts[i] = $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ObjectCount.fromObject(object.negativeDirectionCounts[i], long + 1); + } + } + if (object.accumulatedPositiveDirectionCounts) { + if (!Array.isArray(object.accumulatedPositiveDirectionCounts)) + throw TypeError(".google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.CrossingLineCount.accumulatedPositiveDirectionCounts: array expected"); + message.accumulatedPositiveDirectionCounts = []; + for (var i = 0; i < object.accumulatedPositiveDirectionCounts.length; ++i) { + if (typeof object.accumulatedPositiveDirectionCounts[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.CrossingLineCount.accumulatedPositiveDirectionCounts: object expected"); + message.accumulatedPositiveDirectionCounts[i] = $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.AccumulatedObjectCount.fromObject(object.accumulatedPositiveDirectionCounts[i], long + 1); + } + } + if (object.accumulatedNegativeDirectionCounts) { + if (!Array.isArray(object.accumulatedNegativeDirectionCounts)) + throw TypeError(".google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.CrossingLineCount.accumulatedNegativeDirectionCounts: array expected"); + message.accumulatedNegativeDirectionCounts = []; + for (var i = 0; i < object.accumulatedNegativeDirectionCounts.length; ++i) { + if (typeof object.accumulatedNegativeDirectionCounts[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.CrossingLineCount.accumulatedNegativeDirectionCounts: object expected"); + message.accumulatedNegativeDirectionCounts[i] = $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.AccumulatedObjectCount.fromObject(object.accumulatedNegativeDirectionCounts[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a CrossingLineCount message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.CrossingLineCount + * @static + * @param {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.CrossingLineCount} message CrossingLineCount + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CrossingLineCount.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.positiveDirectionCounts = []; + object.negativeDirectionCounts = []; + object.accumulatedPositiveDirectionCounts = []; + object.accumulatedNegativeDirectionCounts = []; + } + if (options.defaults) + object.annotation = null; + if (message.annotation != null && message.hasOwnProperty("annotation")) + object.annotation = $root.google.cloud.visionai.v1alpha1.StreamAnnotation.toObject(message.annotation, options); + if (message.positiveDirectionCounts && message.positiveDirectionCounts.length) { + object.positiveDirectionCounts = []; + for (var j = 0; j < message.positiveDirectionCounts.length; ++j) + object.positiveDirectionCounts[j] = $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ObjectCount.toObject(message.positiveDirectionCounts[j], options); + } + if (message.negativeDirectionCounts && message.negativeDirectionCounts.length) { + object.negativeDirectionCounts = []; + for (var j = 0; j < message.negativeDirectionCounts.length; ++j) + object.negativeDirectionCounts[j] = $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ObjectCount.toObject(message.negativeDirectionCounts[j], options); + } + if (message.accumulatedPositiveDirectionCounts && message.accumulatedPositiveDirectionCounts.length) { + object.accumulatedPositiveDirectionCounts = []; + for (var j = 0; j < message.accumulatedPositiveDirectionCounts.length; ++j) + object.accumulatedPositiveDirectionCounts[j] = $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.AccumulatedObjectCount.toObject(message.accumulatedPositiveDirectionCounts[j], options); + } + if (message.accumulatedNegativeDirectionCounts && message.accumulatedNegativeDirectionCounts.length) { + object.accumulatedNegativeDirectionCounts = []; + for (var j = 0; j < message.accumulatedNegativeDirectionCounts.length; ++j) + object.accumulatedNegativeDirectionCounts[j] = $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.AccumulatedObjectCount.toObject(message.accumulatedNegativeDirectionCounts[j], options); + } + return object; + }; + + /** + * Converts this CrossingLineCount to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.CrossingLineCount + * @instance + * @returns {Object.} JSON object + */ + CrossingLineCount.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CrossingLineCount + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.CrossingLineCount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CrossingLineCount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.CrossingLineCount"; + }; + + return CrossingLineCount; + })(); + + Stats.ActiveZoneCount = (function() { + + /** + * Properties of an ActiveZoneCount. + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats + * @interface IActiveZoneCount + * @property {google.cloud.visionai.v1alpha1.IStreamAnnotation|null} [annotation] ActiveZoneCount annotation + * @property {Array.|null} [counts] ActiveZoneCount counts + */ + + /** + * Constructs a new ActiveZoneCount. + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats + * @classdesc Represents an ActiveZoneCount. + * @implements IActiveZoneCount + * @constructor + * @param {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.IActiveZoneCount=} [properties] Properties to set + */ + function ActiveZoneCount(properties) { + this.counts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ActiveZoneCount annotation. + * @member {google.cloud.visionai.v1alpha1.IStreamAnnotation|null|undefined} annotation + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ActiveZoneCount + * @instance + */ + ActiveZoneCount.prototype.annotation = null; + + /** + * ActiveZoneCount counts. + * @member {Array.} counts + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ActiveZoneCount + * @instance + */ + ActiveZoneCount.prototype.counts = $util.emptyArray; + + /** + * Creates a new ActiveZoneCount instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ActiveZoneCount + * @static + * @param {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.IActiveZoneCount=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ActiveZoneCount} ActiveZoneCount instance + */ + ActiveZoneCount.create = function create(properties) { + return new ActiveZoneCount(properties); + }; + + /** + * Encodes the specified ActiveZoneCount message. Does not implicitly {@link google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ActiveZoneCount.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ActiveZoneCount + * @static + * @param {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.IActiveZoneCount} message ActiveZoneCount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ActiveZoneCount.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && Object.hasOwnProperty.call(message, "annotation")) + $root.google.cloud.visionai.v1alpha1.StreamAnnotation.encode(message.annotation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.counts != null && message.counts.length) + for (var i = 0; i < message.counts.length; ++i) + $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ObjectCount.encode(message.counts[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ActiveZoneCount message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ActiveZoneCount.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ActiveZoneCount + * @static + * @param {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.IActiveZoneCount} message ActiveZoneCount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ActiveZoneCount.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ActiveZoneCount message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ActiveZoneCount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ActiveZoneCount} ActiveZoneCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ActiveZoneCount.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ActiveZoneCount(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.annotation = $root.google.cloud.visionai.v1alpha1.StreamAnnotation.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + if (!(message.counts && message.counts.length)) + message.counts = []; + message.counts.push($root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ObjectCount.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ActiveZoneCount message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ActiveZoneCount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ActiveZoneCount} ActiveZoneCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ActiveZoneCount.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ActiveZoneCount message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ActiveZoneCount + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ActiveZoneCount.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + var error = $root.google.cloud.visionai.v1alpha1.StreamAnnotation.verify(message.annotation, long + 1); + if (error) + return "annotation." + error; + } + if (message.counts != null && message.hasOwnProperty("counts")) { + if (!Array.isArray(message.counts)) + return "counts: array expected"; + for (var i = 0; i < message.counts.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ObjectCount.verify(message.counts[i], long + 1); + if (error) + return "counts." + error; + } + } + return null; + }; + + /** + * Creates an ActiveZoneCount message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ActiveZoneCount + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ActiveZoneCount} ActiveZoneCount + */ + ActiveZoneCount.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ActiveZoneCount) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ActiveZoneCount(); + if (object.annotation != null) { + if (typeof object.annotation !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ActiveZoneCount.annotation: object expected"); + message.annotation = $root.google.cloud.visionai.v1alpha1.StreamAnnotation.fromObject(object.annotation, long + 1); + } + if (object.counts) { + if (!Array.isArray(object.counts)) + throw TypeError(".google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ActiveZoneCount.counts: array expected"); + message.counts = []; + for (var i = 0; i < object.counts.length; ++i) { + if (typeof object.counts[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ActiveZoneCount.counts: object expected"); + message.counts[i] = $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ObjectCount.fromObject(object.counts[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from an ActiveZoneCount message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ActiveZoneCount + * @static + * @param {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ActiveZoneCount} message ActiveZoneCount + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ActiveZoneCount.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.counts = []; + if (options.defaults) + object.annotation = null; + if (message.annotation != null && message.hasOwnProperty("annotation")) + object.annotation = $root.google.cloud.visionai.v1alpha1.StreamAnnotation.toObject(message.annotation, options); + if (message.counts && message.counts.length) { + object.counts = []; + for (var j = 0; j < message.counts.length; ++j) + object.counts[j] = $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ObjectCount.toObject(message.counts[j], options); + } + return object; + }; + + /** + * Converts this ActiveZoneCount to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ActiveZoneCount + * @instance + * @returns {Object.} JSON object + */ + ActiveZoneCount.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ActiveZoneCount + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ActiveZoneCount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ActiveZoneCount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.Stats.ActiveZoneCount"; + }; + + return ActiveZoneCount; + })(); + + return Stats; + })(); + + OccupancyCountingPredictionResult.TrackInfo = (function() { + + /** + * Properties of a TrackInfo. + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult + * @interface ITrackInfo + * @property {string|null} [trackId] TrackInfo trackId + * @property {google.protobuf.ITimestamp|null} [startTime] TrackInfo startTime + */ + + /** + * Constructs a new TrackInfo. + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult + * @classdesc Represents a TrackInfo. + * @implements ITrackInfo + * @constructor + * @param {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.ITrackInfo=} [properties] Properties to set + */ + function TrackInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TrackInfo trackId. + * @member {string} trackId + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.TrackInfo + * @instance + */ + TrackInfo.prototype.trackId = ""; + + /** + * TrackInfo startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.TrackInfo + * @instance + */ + TrackInfo.prototype.startTime = null; + + /** + * Creates a new TrackInfo instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.TrackInfo + * @static + * @param {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.ITrackInfo=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.TrackInfo} TrackInfo instance + */ + TrackInfo.create = function create(properties) { + return new TrackInfo(properties); + }; + + /** + * Encodes the specified TrackInfo message. Does not implicitly {@link google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.TrackInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.TrackInfo + * @static + * @param {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.ITrackInfo} message TrackInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrackInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.trackId != null && Object.hasOwnProperty.call(message, "trackId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.trackId); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TrackInfo message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.TrackInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.TrackInfo + * @static + * @param {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.ITrackInfo} message TrackInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrackInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TrackInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.TrackInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.TrackInfo} TrackInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrackInfo.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.TrackInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.trackId = reader.string(); + break; + } + case 2: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TrackInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.TrackInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.TrackInfo} TrackInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrackInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TrackInfo message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.TrackInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TrackInfo.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.trackId != null && message.hasOwnProperty("trackId")) + if (!$util.isString(message.trackId)) + return "trackId: string expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime, long + 1); + if (error) + return "startTime." + error; + } + return null; + }; + + /** + * Creates a TrackInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.TrackInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.TrackInfo} TrackInfo + */ + TrackInfo.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.TrackInfo) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.TrackInfo(); + if (object.trackId != null) + message.trackId = String(object.trackId); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.TrackInfo.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a TrackInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.TrackInfo + * @static + * @param {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.TrackInfo} message TrackInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TrackInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.trackId = ""; + object.startTime = null; + } + if (message.trackId != null && message.hasOwnProperty("trackId")) + object.trackId = message.trackId; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + return object; + }; + + /** + * Converts this TrackInfo to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.TrackInfo + * @instance + * @returns {Object.} JSON object + */ + TrackInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TrackInfo + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.TrackInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TrackInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.TrackInfo"; + }; + + return TrackInfo; + })(); + + OccupancyCountingPredictionResult.DwellTimeInfo = (function() { + + /** + * Properties of a DwellTimeInfo. + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult + * @interface IDwellTimeInfo + * @property {string|null} [trackId] DwellTimeInfo trackId + * @property {string|null} [zoneId] DwellTimeInfo zoneId + * @property {google.protobuf.ITimestamp|null} [dwellStartTime] DwellTimeInfo dwellStartTime + * @property {google.protobuf.ITimestamp|null} [dwellEndTime] DwellTimeInfo dwellEndTime + */ + + /** + * Constructs a new DwellTimeInfo. + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult + * @classdesc Represents a DwellTimeInfo. + * @implements IDwellTimeInfo + * @constructor + * @param {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IDwellTimeInfo=} [properties] Properties to set + */ + function DwellTimeInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DwellTimeInfo trackId. + * @member {string} trackId + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.DwellTimeInfo + * @instance + */ + DwellTimeInfo.prototype.trackId = ""; + + /** + * DwellTimeInfo zoneId. + * @member {string} zoneId + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.DwellTimeInfo + * @instance + */ + DwellTimeInfo.prototype.zoneId = ""; + + /** + * DwellTimeInfo dwellStartTime. + * @member {google.protobuf.ITimestamp|null|undefined} dwellStartTime + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.DwellTimeInfo + * @instance + */ + DwellTimeInfo.prototype.dwellStartTime = null; + + /** + * DwellTimeInfo dwellEndTime. + * @member {google.protobuf.ITimestamp|null|undefined} dwellEndTime + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.DwellTimeInfo + * @instance + */ + DwellTimeInfo.prototype.dwellEndTime = null; + + /** + * Creates a new DwellTimeInfo instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.DwellTimeInfo + * @static + * @param {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IDwellTimeInfo=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.DwellTimeInfo} DwellTimeInfo instance + */ + DwellTimeInfo.create = function create(properties) { + return new DwellTimeInfo(properties); + }; + + /** + * Encodes the specified DwellTimeInfo message. Does not implicitly {@link google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.DwellTimeInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.DwellTimeInfo + * @static + * @param {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IDwellTimeInfo} message DwellTimeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DwellTimeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.trackId != null && Object.hasOwnProperty.call(message, "trackId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.trackId); + if (message.zoneId != null && Object.hasOwnProperty.call(message, "zoneId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.zoneId); + if (message.dwellStartTime != null && Object.hasOwnProperty.call(message, "dwellStartTime")) + $root.google.protobuf.Timestamp.encode(message.dwellStartTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.dwellEndTime != null && Object.hasOwnProperty.call(message, "dwellEndTime")) + $root.google.protobuf.Timestamp.encode(message.dwellEndTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DwellTimeInfo message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.DwellTimeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.DwellTimeInfo + * @static + * @param {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.IDwellTimeInfo} message DwellTimeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DwellTimeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DwellTimeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.DwellTimeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.DwellTimeInfo} DwellTimeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DwellTimeInfo.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.DwellTimeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.trackId = reader.string(); + break; + } + case 2: { + message.zoneId = reader.string(); + break; + } + case 3: { + message.dwellStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.dwellEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DwellTimeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.DwellTimeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.DwellTimeInfo} DwellTimeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DwellTimeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DwellTimeInfo message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.DwellTimeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DwellTimeInfo.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.trackId != null && message.hasOwnProperty("trackId")) + if (!$util.isString(message.trackId)) + return "trackId: string expected"; + if (message.zoneId != null && message.hasOwnProperty("zoneId")) + if (!$util.isString(message.zoneId)) + return "zoneId: string expected"; + if (message.dwellStartTime != null && message.hasOwnProperty("dwellStartTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.dwellStartTime, long + 1); + if (error) + return "dwellStartTime." + error; + } + if (message.dwellEndTime != null && message.hasOwnProperty("dwellEndTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.dwellEndTime, long + 1); + if (error) + return "dwellEndTime." + error; + } + return null; + }; + + /** + * Creates a DwellTimeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.DwellTimeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.DwellTimeInfo} DwellTimeInfo + */ + DwellTimeInfo.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.DwellTimeInfo) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.DwellTimeInfo(); + if (object.trackId != null) + message.trackId = String(object.trackId); + if (object.zoneId != null) + message.zoneId = String(object.zoneId); + if (object.dwellStartTime != null) { + if (typeof object.dwellStartTime !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.DwellTimeInfo.dwellStartTime: object expected"); + message.dwellStartTime = $root.google.protobuf.Timestamp.fromObject(object.dwellStartTime, long + 1); + } + if (object.dwellEndTime != null) { + if (typeof object.dwellEndTime !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.DwellTimeInfo.dwellEndTime: object expected"); + message.dwellEndTime = $root.google.protobuf.Timestamp.fromObject(object.dwellEndTime, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a DwellTimeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.DwellTimeInfo + * @static + * @param {google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.DwellTimeInfo} message DwellTimeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DwellTimeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.trackId = ""; + object.zoneId = ""; + object.dwellStartTime = null; + object.dwellEndTime = null; + } + if (message.trackId != null && message.hasOwnProperty("trackId")) + object.trackId = message.trackId; + if (message.zoneId != null && message.hasOwnProperty("zoneId")) + object.zoneId = message.zoneId; + if (message.dwellStartTime != null && message.hasOwnProperty("dwellStartTime")) + object.dwellStartTime = $root.google.protobuf.Timestamp.toObject(message.dwellStartTime, options); + if (message.dwellEndTime != null && message.hasOwnProperty("dwellEndTime")) + object.dwellEndTime = $root.google.protobuf.Timestamp.toObject(message.dwellEndTime, options); + return object; + }; + + /** + * Converts this DwellTimeInfo to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.DwellTimeInfo + * @instance + * @returns {Object.} JSON object + */ + DwellTimeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DwellTimeInfo + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.DwellTimeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DwellTimeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.OccupancyCountingPredictionResult.DwellTimeInfo"; + }; + + return DwellTimeInfo; + })(); + + return OccupancyCountingPredictionResult; + })(); + + v1alpha1.StreamAnnotation = (function() { + + /** + * Properties of a StreamAnnotation. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IStreamAnnotation + * @property {google.cloud.visionai.v1alpha1.INormalizedPolygon|null} [activeZone] StreamAnnotation activeZone + * @property {google.cloud.visionai.v1alpha1.INormalizedPolyline|null} [crossingLine] StreamAnnotation crossingLine + * @property {string|null} [id] StreamAnnotation id + * @property {string|null} [displayName] StreamAnnotation displayName + * @property {string|null} [sourceStream] StreamAnnotation sourceStream + * @property {google.cloud.visionai.v1alpha1.StreamAnnotationType|null} [type] StreamAnnotation type + */ + + /** + * Constructs a new StreamAnnotation. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a StreamAnnotation. + * @implements IStreamAnnotation + * @constructor + * @param {google.cloud.visionai.v1alpha1.IStreamAnnotation=} [properties] Properties to set + */ + function StreamAnnotation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamAnnotation activeZone. + * @member {google.cloud.visionai.v1alpha1.INormalizedPolygon|null|undefined} activeZone + * @memberof google.cloud.visionai.v1alpha1.StreamAnnotation + * @instance + */ + StreamAnnotation.prototype.activeZone = null; + + /** + * StreamAnnotation crossingLine. + * @member {google.cloud.visionai.v1alpha1.INormalizedPolyline|null|undefined} crossingLine + * @memberof google.cloud.visionai.v1alpha1.StreamAnnotation + * @instance + */ + StreamAnnotation.prototype.crossingLine = null; + + /** + * StreamAnnotation id. + * @member {string} id + * @memberof google.cloud.visionai.v1alpha1.StreamAnnotation + * @instance + */ + StreamAnnotation.prototype.id = ""; + + /** + * StreamAnnotation displayName. + * @member {string} displayName + * @memberof google.cloud.visionai.v1alpha1.StreamAnnotation + * @instance + */ + StreamAnnotation.prototype.displayName = ""; + + /** + * StreamAnnotation sourceStream. + * @member {string} sourceStream + * @memberof google.cloud.visionai.v1alpha1.StreamAnnotation + * @instance + */ + StreamAnnotation.prototype.sourceStream = ""; + + /** + * StreamAnnotation type. + * @member {google.cloud.visionai.v1alpha1.StreamAnnotationType} type + * @memberof google.cloud.visionai.v1alpha1.StreamAnnotation + * @instance + */ + StreamAnnotation.prototype.type = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * StreamAnnotation annotationPayload. + * @member {"activeZone"|"crossingLine"|undefined} annotationPayload + * @memberof google.cloud.visionai.v1alpha1.StreamAnnotation + * @instance + */ + Object.defineProperty(StreamAnnotation.prototype, "annotationPayload", { + get: $util.oneOfGetter($oneOfFields = ["activeZone", "crossingLine"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StreamAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.StreamAnnotation + * @static + * @param {google.cloud.visionai.v1alpha1.IStreamAnnotation=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.StreamAnnotation} StreamAnnotation instance + */ + StreamAnnotation.create = function create(properties) { + return new StreamAnnotation(properties); + }; + + /** + * Encodes the specified StreamAnnotation message. Does not implicitly {@link google.cloud.visionai.v1alpha1.StreamAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.StreamAnnotation + * @static + * @param {google.cloud.visionai.v1alpha1.IStreamAnnotation} message StreamAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.sourceStream != null && Object.hasOwnProperty.call(message, "sourceStream")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.sourceStream); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.type); + if (message.activeZone != null && Object.hasOwnProperty.call(message, "activeZone")) + $root.google.cloud.visionai.v1alpha1.NormalizedPolygon.encode(message.activeZone, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.crossingLine != null && Object.hasOwnProperty.call(message, "crossingLine")) + $root.google.cloud.visionai.v1alpha1.NormalizedPolyline.encode(message.crossingLine, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StreamAnnotation message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.StreamAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.StreamAnnotation + * @static + * @param {google.cloud.visionai.v1alpha1.IStreamAnnotation} message StreamAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.StreamAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.StreamAnnotation} StreamAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamAnnotation.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.StreamAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 5: { + message.activeZone = $root.google.cloud.visionai.v1alpha1.NormalizedPolygon.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.crossingLine = $root.google.cloud.visionai.v1alpha1.NormalizedPolyline.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.sourceStream = reader.string(); + break; + } + case 4: { + message.type = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a StreamAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.StreamAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.StreamAnnotation} StreamAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamAnnotation message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.StreamAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamAnnotation.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.activeZone != null && message.hasOwnProperty("activeZone")) { + properties.annotationPayload = 1; + { + var error = $root.google.cloud.visionai.v1alpha1.NormalizedPolygon.verify(message.activeZone, long + 1); + if (error) + return "activeZone." + error; + } + } + if (message.crossingLine != null && message.hasOwnProperty("crossingLine")) { + if (properties.annotationPayload === 1) + return "annotationPayload: multiple values"; + properties.annotationPayload = 1; + { + var error = $root.google.cloud.visionai.v1alpha1.NormalizedPolyline.verify(message.crossingLine, long + 1); + if (error) + return "crossingLine." + error; + } + } + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.sourceStream != null && message.hasOwnProperty("sourceStream")) + if (!$util.isString(message.sourceStream)) + return "sourceStream: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a StreamAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.StreamAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.StreamAnnotation} StreamAnnotation + */ + StreamAnnotation.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.StreamAnnotation) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.StreamAnnotation(); + if (object.activeZone != null) { + if (typeof object.activeZone !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.StreamAnnotation.activeZone: object expected"); + message.activeZone = $root.google.cloud.visionai.v1alpha1.NormalizedPolygon.fromObject(object.activeZone, long + 1); + } + if (object.crossingLine != null) { + if (typeof object.crossingLine !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.StreamAnnotation.crossingLine: object expected"); + message.crossingLine = $root.google.cloud.visionai.v1alpha1.NormalizedPolyline.fromObject(object.crossingLine, long + 1); + } + if (object.id != null) + message.id = String(object.id); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.sourceStream != null) + message.sourceStream = String(object.sourceStream); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "STREAM_ANNOTATION_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "STREAM_ANNOTATION_TYPE_ACTIVE_ZONE": + case 1: + message.type = 1; + break; + case "STREAM_ANNOTATION_TYPE_CROSSING_LINE": + case 2: + message.type = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a StreamAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.StreamAnnotation + * @static + * @param {google.cloud.visionai.v1alpha1.StreamAnnotation} message StreamAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.displayName = ""; + object.sourceStream = ""; + object.type = options.enums === String ? "STREAM_ANNOTATION_TYPE_UNSPECIFIED" : 0; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.sourceStream != null && message.hasOwnProperty("sourceStream")) + object.sourceStream = message.sourceStream; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.visionai.v1alpha1.StreamAnnotationType[message.type] === undefined ? message.type : $root.google.cloud.visionai.v1alpha1.StreamAnnotationType[message.type] : message.type; + if (message.activeZone != null && message.hasOwnProperty("activeZone")) { + object.activeZone = $root.google.cloud.visionai.v1alpha1.NormalizedPolygon.toObject(message.activeZone, options); + if (options.oneofs) + object.annotationPayload = "activeZone"; + } + if (message.crossingLine != null && message.hasOwnProperty("crossingLine")) { + object.crossingLine = $root.google.cloud.visionai.v1alpha1.NormalizedPolyline.toObject(message.crossingLine, options); + if (options.oneofs) + object.annotationPayload = "crossingLine"; + } + return object; + }; + + /** + * Converts this StreamAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.StreamAnnotation + * @instance + * @returns {Object.} JSON object + */ + StreamAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamAnnotation + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.StreamAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.StreamAnnotation"; + }; + + return StreamAnnotation; + })(); + + v1alpha1.StreamAnnotations = (function() { + + /** + * Properties of a StreamAnnotations. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IStreamAnnotations + * @property {Array.|null} [streamAnnotations] StreamAnnotations streamAnnotations + */ + + /** + * Constructs a new StreamAnnotations. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a StreamAnnotations. + * @implements IStreamAnnotations + * @constructor + * @param {google.cloud.visionai.v1alpha1.IStreamAnnotations=} [properties] Properties to set + */ + function StreamAnnotations(properties) { + this.streamAnnotations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamAnnotations streamAnnotations. + * @member {Array.} streamAnnotations + * @memberof google.cloud.visionai.v1alpha1.StreamAnnotations + * @instance + */ + StreamAnnotations.prototype.streamAnnotations = $util.emptyArray; + + /** + * Creates a new StreamAnnotations instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.StreamAnnotations + * @static + * @param {google.cloud.visionai.v1alpha1.IStreamAnnotations=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.StreamAnnotations} StreamAnnotations instance + */ + StreamAnnotations.create = function create(properties) { + return new StreamAnnotations(properties); + }; + + /** + * Encodes the specified StreamAnnotations message. Does not implicitly {@link google.cloud.visionai.v1alpha1.StreamAnnotations.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.StreamAnnotations + * @static + * @param {google.cloud.visionai.v1alpha1.IStreamAnnotations} message StreamAnnotations message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamAnnotations.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.streamAnnotations != null && message.streamAnnotations.length) + for (var i = 0; i < message.streamAnnotations.length; ++i) + $root.google.cloud.visionai.v1alpha1.StreamAnnotation.encode(message.streamAnnotations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StreamAnnotations message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.StreamAnnotations.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.StreamAnnotations + * @static + * @param {google.cloud.visionai.v1alpha1.IStreamAnnotations} message StreamAnnotations message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamAnnotations.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamAnnotations message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.StreamAnnotations + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.StreamAnnotations} StreamAnnotations + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamAnnotations.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.StreamAnnotations(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.streamAnnotations && message.streamAnnotations.length)) + message.streamAnnotations = []; + message.streamAnnotations.push($root.google.cloud.visionai.v1alpha1.StreamAnnotation.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a StreamAnnotations message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.StreamAnnotations + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.StreamAnnotations} StreamAnnotations + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamAnnotations.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamAnnotations message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.StreamAnnotations + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamAnnotations.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.streamAnnotations != null && message.hasOwnProperty("streamAnnotations")) { + if (!Array.isArray(message.streamAnnotations)) + return "streamAnnotations: array expected"; + for (var i = 0; i < message.streamAnnotations.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.StreamAnnotation.verify(message.streamAnnotations[i], long + 1); + if (error) + return "streamAnnotations." + error; + } + } + return null; + }; + + /** + * Creates a StreamAnnotations message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.StreamAnnotations + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.StreamAnnotations} StreamAnnotations + */ + StreamAnnotations.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.StreamAnnotations) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.StreamAnnotations(); + if (object.streamAnnotations) { + if (!Array.isArray(object.streamAnnotations)) + throw TypeError(".google.cloud.visionai.v1alpha1.StreamAnnotations.streamAnnotations: array expected"); + message.streamAnnotations = []; + for (var i = 0; i < object.streamAnnotations.length; ++i) { + if (typeof object.streamAnnotations[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.StreamAnnotations.streamAnnotations: object expected"); + message.streamAnnotations[i] = $root.google.cloud.visionai.v1alpha1.StreamAnnotation.fromObject(object.streamAnnotations[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a StreamAnnotations message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.StreamAnnotations + * @static + * @param {google.cloud.visionai.v1alpha1.StreamAnnotations} message StreamAnnotations + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamAnnotations.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.streamAnnotations = []; + if (message.streamAnnotations && message.streamAnnotations.length) { + object.streamAnnotations = []; + for (var j = 0; j < message.streamAnnotations.length; ++j) + object.streamAnnotations[j] = $root.google.cloud.visionai.v1alpha1.StreamAnnotation.toObject(message.streamAnnotations[j], options); + } + return object; + }; + + /** + * Converts this StreamAnnotations to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.StreamAnnotations + * @instance + * @returns {Object.} JSON object + */ + StreamAnnotations.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamAnnotations + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.StreamAnnotations + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamAnnotations.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.StreamAnnotations"; + }; + + return StreamAnnotations; + })(); + + v1alpha1.NormalizedPolygon = (function() { + + /** + * Properties of a NormalizedPolygon. + * @memberof google.cloud.visionai.v1alpha1 + * @interface INormalizedPolygon + * @property {Array.|null} [normalizedVertices] NormalizedPolygon normalizedVertices + */ + + /** + * Constructs a new NormalizedPolygon. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a NormalizedPolygon. + * @implements INormalizedPolygon + * @constructor + * @param {google.cloud.visionai.v1alpha1.INormalizedPolygon=} [properties] Properties to set + */ + function NormalizedPolygon(properties) { + this.normalizedVertices = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * NormalizedPolygon normalizedVertices. + * @member {Array.} normalizedVertices + * @memberof google.cloud.visionai.v1alpha1.NormalizedPolygon + * @instance + */ + NormalizedPolygon.prototype.normalizedVertices = $util.emptyArray; + + /** + * Creates a new NormalizedPolygon instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.NormalizedPolygon + * @static + * @param {google.cloud.visionai.v1alpha1.INormalizedPolygon=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.NormalizedPolygon} NormalizedPolygon instance + */ + NormalizedPolygon.create = function create(properties) { + return new NormalizedPolygon(properties); + }; + + /** + * Encodes the specified NormalizedPolygon message. Does not implicitly {@link google.cloud.visionai.v1alpha1.NormalizedPolygon.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.NormalizedPolygon + * @static + * @param {google.cloud.visionai.v1alpha1.INormalizedPolygon} message NormalizedPolygon message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NormalizedPolygon.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.normalizedVertices != null && message.normalizedVertices.length) + for (var i = 0; i < message.normalizedVertices.length; ++i) + $root.google.cloud.visionai.v1alpha1.NormalizedVertex.encode(message.normalizedVertices[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NormalizedPolygon message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.NormalizedPolygon.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.NormalizedPolygon + * @static + * @param {google.cloud.visionai.v1alpha1.INormalizedPolygon} message NormalizedPolygon message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NormalizedPolygon.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NormalizedPolygon message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.NormalizedPolygon + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.NormalizedPolygon} NormalizedPolygon + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NormalizedPolygon.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.NormalizedPolygon(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.normalizedVertices && message.normalizedVertices.length)) + message.normalizedVertices = []; + message.normalizedVertices.push($root.google.cloud.visionai.v1alpha1.NormalizedVertex.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a NormalizedPolygon message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.NormalizedPolygon + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.NormalizedPolygon} NormalizedPolygon + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NormalizedPolygon.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NormalizedPolygon message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.NormalizedPolygon + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NormalizedPolygon.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.normalizedVertices != null && message.hasOwnProperty("normalizedVertices")) { + if (!Array.isArray(message.normalizedVertices)) + return "normalizedVertices: array expected"; + for (var i = 0; i < message.normalizedVertices.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.NormalizedVertex.verify(message.normalizedVertices[i], long + 1); + if (error) + return "normalizedVertices." + error; + } + } + return null; + }; + + /** + * Creates a NormalizedPolygon message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.NormalizedPolygon + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.NormalizedPolygon} NormalizedPolygon + */ + NormalizedPolygon.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.NormalizedPolygon) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.NormalizedPolygon(); + if (object.normalizedVertices) { + if (!Array.isArray(object.normalizedVertices)) + throw TypeError(".google.cloud.visionai.v1alpha1.NormalizedPolygon.normalizedVertices: array expected"); + message.normalizedVertices = []; + for (var i = 0; i < object.normalizedVertices.length; ++i) { + if (typeof object.normalizedVertices[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.NormalizedPolygon.normalizedVertices: object expected"); + message.normalizedVertices[i] = $root.google.cloud.visionai.v1alpha1.NormalizedVertex.fromObject(object.normalizedVertices[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a NormalizedPolygon message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.NormalizedPolygon + * @static + * @param {google.cloud.visionai.v1alpha1.NormalizedPolygon} message NormalizedPolygon + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NormalizedPolygon.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.normalizedVertices = []; + if (message.normalizedVertices && message.normalizedVertices.length) { + object.normalizedVertices = []; + for (var j = 0; j < message.normalizedVertices.length; ++j) + object.normalizedVertices[j] = $root.google.cloud.visionai.v1alpha1.NormalizedVertex.toObject(message.normalizedVertices[j], options); + } + return object; + }; + + /** + * Converts this NormalizedPolygon to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.NormalizedPolygon + * @instance + * @returns {Object.} JSON object + */ + NormalizedPolygon.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NormalizedPolygon + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.NormalizedPolygon + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NormalizedPolygon.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.NormalizedPolygon"; + }; + + return NormalizedPolygon; + })(); + + v1alpha1.NormalizedPolyline = (function() { + + /** + * Properties of a NormalizedPolyline. + * @memberof google.cloud.visionai.v1alpha1 + * @interface INormalizedPolyline + * @property {Array.|null} [normalizedVertices] NormalizedPolyline normalizedVertices + */ + + /** + * Constructs a new NormalizedPolyline. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a NormalizedPolyline. + * @implements INormalizedPolyline + * @constructor + * @param {google.cloud.visionai.v1alpha1.INormalizedPolyline=} [properties] Properties to set + */ + function NormalizedPolyline(properties) { + this.normalizedVertices = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * NormalizedPolyline normalizedVertices. + * @member {Array.} normalizedVertices + * @memberof google.cloud.visionai.v1alpha1.NormalizedPolyline + * @instance + */ + NormalizedPolyline.prototype.normalizedVertices = $util.emptyArray; + + /** + * Creates a new NormalizedPolyline instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.NormalizedPolyline + * @static + * @param {google.cloud.visionai.v1alpha1.INormalizedPolyline=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.NormalizedPolyline} NormalizedPolyline instance + */ + NormalizedPolyline.create = function create(properties) { + return new NormalizedPolyline(properties); + }; + + /** + * Encodes the specified NormalizedPolyline message. Does not implicitly {@link google.cloud.visionai.v1alpha1.NormalizedPolyline.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.NormalizedPolyline + * @static + * @param {google.cloud.visionai.v1alpha1.INormalizedPolyline} message NormalizedPolyline message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NormalizedPolyline.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.normalizedVertices != null && message.normalizedVertices.length) + for (var i = 0; i < message.normalizedVertices.length; ++i) + $root.google.cloud.visionai.v1alpha1.NormalizedVertex.encode(message.normalizedVertices[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NormalizedPolyline message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.NormalizedPolyline.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.NormalizedPolyline + * @static + * @param {google.cloud.visionai.v1alpha1.INormalizedPolyline} message NormalizedPolyline message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NormalizedPolyline.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NormalizedPolyline message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.NormalizedPolyline + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.NormalizedPolyline} NormalizedPolyline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NormalizedPolyline.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.NormalizedPolyline(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.normalizedVertices && message.normalizedVertices.length)) + message.normalizedVertices = []; + message.normalizedVertices.push($root.google.cloud.visionai.v1alpha1.NormalizedVertex.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a NormalizedPolyline message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.NormalizedPolyline + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.NormalizedPolyline} NormalizedPolyline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NormalizedPolyline.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NormalizedPolyline message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.NormalizedPolyline + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NormalizedPolyline.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.normalizedVertices != null && message.hasOwnProperty("normalizedVertices")) { + if (!Array.isArray(message.normalizedVertices)) + return "normalizedVertices: array expected"; + for (var i = 0; i < message.normalizedVertices.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.NormalizedVertex.verify(message.normalizedVertices[i], long + 1); + if (error) + return "normalizedVertices." + error; + } + } + return null; + }; + + /** + * Creates a NormalizedPolyline message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.NormalizedPolyline + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.NormalizedPolyline} NormalizedPolyline + */ + NormalizedPolyline.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.NormalizedPolyline) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.NormalizedPolyline(); + if (object.normalizedVertices) { + if (!Array.isArray(object.normalizedVertices)) + throw TypeError(".google.cloud.visionai.v1alpha1.NormalizedPolyline.normalizedVertices: array expected"); + message.normalizedVertices = []; + for (var i = 0; i < object.normalizedVertices.length; ++i) { + if (typeof object.normalizedVertices[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.NormalizedPolyline.normalizedVertices: object expected"); + message.normalizedVertices[i] = $root.google.cloud.visionai.v1alpha1.NormalizedVertex.fromObject(object.normalizedVertices[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a NormalizedPolyline message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.NormalizedPolyline + * @static + * @param {google.cloud.visionai.v1alpha1.NormalizedPolyline} message NormalizedPolyline + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NormalizedPolyline.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.normalizedVertices = []; + if (message.normalizedVertices && message.normalizedVertices.length) { + object.normalizedVertices = []; + for (var j = 0; j < message.normalizedVertices.length; ++j) + object.normalizedVertices[j] = $root.google.cloud.visionai.v1alpha1.NormalizedVertex.toObject(message.normalizedVertices[j], options); + } + return object; + }; + + /** + * Converts this NormalizedPolyline to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.NormalizedPolyline + * @instance + * @returns {Object.} JSON object + */ + NormalizedPolyline.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NormalizedPolyline + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.NormalizedPolyline + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NormalizedPolyline.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.NormalizedPolyline"; + }; + + return NormalizedPolyline; + })(); + + v1alpha1.NormalizedVertex = (function() { + + /** + * Properties of a NormalizedVertex. + * @memberof google.cloud.visionai.v1alpha1 + * @interface INormalizedVertex + * @property {number|null} [x] NormalizedVertex x + * @property {number|null} [y] NormalizedVertex y + */ + + /** + * Constructs a new NormalizedVertex. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a NormalizedVertex. + * @implements INormalizedVertex + * @constructor + * @param {google.cloud.visionai.v1alpha1.INormalizedVertex=} [properties] Properties to set + */ + function NormalizedVertex(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * NormalizedVertex x. + * @member {number} x + * @memberof google.cloud.visionai.v1alpha1.NormalizedVertex + * @instance + */ + NormalizedVertex.prototype.x = 0; + + /** + * NormalizedVertex y. + * @member {number} y + * @memberof google.cloud.visionai.v1alpha1.NormalizedVertex + * @instance + */ + NormalizedVertex.prototype.y = 0; + + /** + * Creates a new NormalizedVertex instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.NormalizedVertex + * @static + * @param {google.cloud.visionai.v1alpha1.INormalizedVertex=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.NormalizedVertex} NormalizedVertex instance + */ + NormalizedVertex.create = function create(properties) { + return new NormalizedVertex(properties); + }; + + /** + * Encodes the specified NormalizedVertex message. Does not implicitly {@link google.cloud.visionai.v1alpha1.NormalizedVertex.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.NormalizedVertex + * @static + * @param {google.cloud.visionai.v1alpha1.INormalizedVertex} message NormalizedVertex message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NormalizedVertex.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.x != null && Object.hasOwnProperty.call(message, "x")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.x); + if (message.y != null && Object.hasOwnProperty.call(message, "y")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.y); + return writer; + }; + + /** + * Encodes the specified NormalizedVertex message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.NormalizedVertex.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.NormalizedVertex + * @static + * @param {google.cloud.visionai.v1alpha1.INormalizedVertex} message NormalizedVertex message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NormalizedVertex.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NormalizedVertex message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.NormalizedVertex + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.NormalizedVertex} NormalizedVertex + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NormalizedVertex.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.NormalizedVertex(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.x = reader.float(); + break; + } + case 2: { + message.y = reader.float(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a NormalizedVertex message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.NormalizedVertex + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.NormalizedVertex} NormalizedVertex + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NormalizedVertex.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NormalizedVertex message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.NormalizedVertex + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NormalizedVertex.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.x != null && message.hasOwnProperty("x")) + if (typeof message.x !== "number") + return "x: number expected"; + if (message.y != null && message.hasOwnProperty("y")) + if (typeof message.y !== "number") + return "y: number expected"; + return null; + }; + + /** + * Creates a NormalizedVertex message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.NormalizedVertex + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.NormalizedVertex} NormalizedVertex + */ + NormalizedVertex.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.NormalizedVertex) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.NormalizedVertex(); + if (object.x != null) + message.x = Number(object.x); + if (object.y != null) + message.y = Number(object.y); + return message; + }; + + /** + * Creates a plain object from a NormalizedVertex message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.NormalizedVertex + * @static + * @param {google.cloud.visionai.v1alpha1.NormalizedVertex} message NormalizedVertex + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NormalizedVertex.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.x = 0; + object.y = 0; + } + if (message.x != null && message.hasOwnProperty("x")) + object.x = options.json && !isFinite(message.x) ? String(message.x) : message.x; + if (message.y != null && message.hasOwnProperty("y")) + object.y = options.json && !isFinite(message.y) ? String(message.y) : message.y; + return object; + }; + + /** + * Converts this NormalizedVertex to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.NormalizedVertex + * @instance + * @returns {Object.} JSON object + */ + NormalizedVertex.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NormalizedVertex + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.NormalizedVertex + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NormalizedVertex.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.NormalizedVertex"; + }; + + return NormalizedVertex; + })(); + + v1alpha1.AppPlatformMetadata = (function() { + + /** + * Properties of an AppPlatformMetadata. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IAppPlatformMetadata + * @property {string|null} [application] AppPlatformMetadata application + * @property {string|null} [instanceId] AppPlatformMetadata instanceId + * @property {string|null} [node] AppPlatformMetadata node + * @property {string|null} [processor] AppPlatformMetadata processor + */ + + /** + * Constructs a new AppPlatformMetadata. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents an AppPlatformMetadata. + * @implements IAppPlatformMetadata + * @constructor + * @param {google.cloud.visionai.v1alpha1.IAppPlatformMetadata=} [properties] Properties to set + */ + function AppPlatformMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * AppPlatformMetadata application. + * @member {string} application + * @memberof google.cloud.visionai.v1alpha1.AppPlatformMetadata + * @instance + */ + AppPlatformMetadata.prototype.application = ""; + + /** + * AppPlatformMetadata instanceId. + * @member {string} instanceId + * @memberof google.cloud.visionai.v1alpha1.AppPlatformMetadata + * @instance + */ + AppPlatformMetadata.prototype.instanceId = ""; + + /** + * AppPlatformMetadata node. + * @member {string} node + * @memberof google.cloud.visionai.v1alpha1.AppPlatformMetadata + * @instance + */ + AppPlatformMetadata.prototype.node = ""; + + /** + * AppPlatformMetadata processor. + * @member {string} processor + * @memberof google.cloud.visionai.v1alpha1.AppPlatformMetadata + * @instance + */ + AppPlatformMetadata.prototype.processor = ""; + + /** + * Creates a new AppPlatformMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.AppPlatformMetadata + * @static + * @param {google.cloud.visionai.v1alpha1.IAppPlatformMetadata=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.AppPlatformMetadata} AppPlatformMetadata instance + */ + AppPlatformMetadata.create = function create(properties) { + return new AppPlatformMetadata(properties); + }; + + /** + * Encodes the specified AppPlatformMetadata message. Does not implicitly {@link google.cloud.visionai.v1alpha1.AppPlatformMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.AppPlatformMetadata + * @static + * @param {google.cloud.visionai.v1alpha1.IAppPlatformMetadata} message AppPlatformMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AppPlatformMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.application != null && Object.hasOwnProperty.call(message, "application")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.application); + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); + if (message.node != null && Object.hasOwnProperty.call(message, "node")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.node); + if (message.processor != null && Object.hasOwnProperty.call(message, "processor")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.processor); + return writer; + }; + + /** + * Encodes the specified AppPlatformMetadata message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.AppPlatformMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.AppPlatformMetadata + * @static + * @param {google.cloud.visionai.v1alpha1.IAppPlatformMetadata} message AppPlatformMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AppPlatformMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AppPlatformMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.AppPlatformMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.AppPlatformMetadata} AppPlatformMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AppPlatformMetadata.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.AppPlatformMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.application = reader.string(); + break; + } + case 2: { + message.instanceId = reader.string(); + break; + } + case 3: { + message.node = reader.string(); + break; + } + case 4: { + message.processor = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an AppPlatformMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.AppPlatformMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.AppPlatformMetadata} AppPlatformMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AppPlatformMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AppPlatformMetadata message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.AppPlatformMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AppPlatformMetadata.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.application != null && message.hasOwnProperty("application")) + if (!$util.isString(message.application)) + return "application: string expected"; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (!$util.isString(message.instanceId)) + return "instanceId: string expected"; + if (message.node != null && message.hasOwnProperty("node")) + if (!$util.isString(message.node)) + return "node: string expected"; + if (message.processor != null && message.hasOwnProperty("processor")) + if (!$util.isString(message.processor)) + return "processor: string expected"; + return null; + }; + + /** + * Creates an AppPlatformMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.AppPlatformMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.AppPlatformMetadata} AppPlatformMetadata + */ + AppPlatformMetadata.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.AppPlatformMetadata) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.AppPlatformMetadata(); + if (object.application != null) + message.application = String(object.application); + if (object.instanceId != null) + message.instanceId = String(object.instanceId); + if (object.node != null) + message.node = String(object.node); + if (object.processor != null) + message.processor = String(object.processor); + return message; + }; + + /** + * Creates a plain object from an AppPlatformMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.AppPlatformMetadata + * @static + * @param {google.cloud.visionai.v1alpha1.AppPlatformMetadata} message AppPlatformMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AppPlatformMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.application = ""; + object.instanceId = ""; + object.node = ""; + object.processor = ""; + } + if (message.application != null && message.hasOwnProperty("application")) + object.application = message.application; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + object.instanceId = message.instanceId; + if (message.node != null && message.hasOwnProperty("node")) + object.node = message.node; + if (message.processor != null && message.hasOwnProperty("processor")) + object.processor = message.processor; + return object; + }; + + /** + * Converts this AppPlatformMetadata to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.AppPlatformMetadata + * @instance + * @returns {Object.} JSON object + */ + AppPlatformMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AppPlatformMetadata + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.AppPlatformMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AppPlatformMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.AppPlatformMetadata"; + }; + + return AppPlatformMetadata; + })(); + + v1alpha1.AppPlatformCloudFunctionRequest = (function() { + + /** + * Properties of an AppPlatformCloudFunctionRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IAppPlatformCloudFunctionRequest + * @property {google.cloud.visionai.v1alpha1.IAppPlatformMetadata|null} [appPlatformMetadata] AppPlatformCloudFunctionRequest appPlatformMetadata + * @property {Array.|null} [annotations] AppPlatformCloudFunctionRequest annotations + */ + + /** + * Constructs a new AppPlatformCloudFunctionRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents an AppPlatformCloudFunctionRequest. + * @implements IAppPlatformCloudFunctionRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IAppPlatformCloudFunctionRequest=} [properties] Properties to set + */ + function AppPlatformCloudFunctionRequest(properties) { + this.annotations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * AppPlatformCloudFunctionRequest appPlatformMetadata. + * @member {google.cloud.visionai.v1alpha1.IAppPlatformMetadata|null|undefined} appPlatformMetadata + * @memberof google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest + * @instance + */ + AppPlatformCloudFunctionRequest.prototype.appPlatformMetadata = null; + + /** + * AppPlatformCloudFunctionRequest annotations. + * @member {Array.} annotations + * @memberof google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest + * @instance + */ + AppPlatformCloudFunctionRequest.prototype.annotations = $util.emptyArray; + + /** + * Creates a new AppPlatformCloudFunctionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IAppPlatformCloudFunctionRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest} AppPlatformCloudFunctionRequest instance + */ + AppPlatformCloudFunctionRequest.create = function create(properties) { + return new AppPlatformCloudFunctionRequest(properties); + }; + + /** + * Encodes the specified AppPlatformCloudFunctionRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IAppPlatformCloudFunctionRequest} message AppPlatformCloudFunctionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AppPlatformCloudFunctionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.appPlatformMetadata != null && Object.hasOwnProperty.call(message, "appPlatformMetadata")) + $root.google.cloud.visionai.v1alpha1.AppPlatformMetadata.encode(message.appPlatformMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.annotations != null && message.annotations.length) + for (var i = 0; i < message.annotations.length; ++i) + $root.google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest.StructedInputAnnotation.encode(message.annotations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AppPlatformCloudFunctionRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IAppPlatformCloudFunctionRequest} message AppPlatformCloudFunctionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AppPlatformCloudFunctionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AppPlatformCloudFunctionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest} AppPlatformCloudFunctionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AppPlatformCloudFunctionRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.appPlatformMetadata = $root.google.cloud.visionai.v1alpha1.AppPlatformMetadata.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + if (!(message.annotations && message.annotations.length)) + message.annotations = []; + message.annotations.push($root.google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest.StructedInputAnnotation.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an AppPlatformCloudFunctionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest} AppPlatformCloudFunctionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AppPlatformCloudFunctionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AppPlatformCloudFunctionRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AppPlatformCloudFunctionRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.appPlatformMetadata != null && message.hasOwnProperty("appPlatformMetadata")) { + var error = $root.google.cloud.visionai.v1alpha1.AppPlatformMetadata.verify(message.appPlatformMetadata, long + 1); + if (error) + return "appPlatformMetadata." + error; + } + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!Array.isArray(message.annotations)) + return "annotations: array expected"; + for (var i = 0; i < message.annotations.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest.StructedInputAnnotation.verify(message.annotations[i], long + 1); + if (error) + return "annotations." + error; + } + } + return null; + }; + + /** + * Creates an AppPlatformCloudFunctionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest} AppPlatformCloudFunctionRequest + */ + AppPlatformCloudFunctionRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest(); + if (object.appPlatformMetadata != null) { + if (typeof object.appPlatformMetadata !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest.appPlatformMetadata: object expected"); + message.appPlatformMetadata = $root.google.cloud.visionai.v1alpha1.AppPlatformMetadata.fromObject(object.appPlatformMetadata, long + 1); + } + if (object.annotations) { + if (!Array.isArray(object.annotations)) + throw TypeError(".google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest.annotations: array expected"); + message.annotations = []; + for (var i = 0; i < object.annotations.length; ++i) { + if (typeof object.annotations[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest.annotations: object expected"); + message.annotations[i] = $root.google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest.StructedInputAnnotation.fromObject(object.annotations[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from an AppPlatformCloudFunctionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest + * @static + * @param {google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest} message AppPlatformCloudFunctionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AppPlatformCloudFunctionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotations = []; + if (options.defaults) + object.appPlatformMetadata = null; + if (message.appPlatformMetadata != null && message.hasOwnProperty("appPlatformMetadata")) + object.appPlatformMetadata = $root.google.cloud.visionai.v1alpha1.AppPlatformMetadata.toObject(message.appPlatformMetadata, options); + if (message.annotations && message.annotations.length) { + object.annotations = []; + for (var j = 0; j < message.annotations.length; ++j) + object.annotations[j] = $root.google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest.StructedInputAnnotation.toObject(message.annotations[j], options); + } + return object; + }; + + /** + * Converts this AppPlatformCloudFunctionRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest + * @instance + * @returns {Object.} JSON object + */ + AppPlatformCloudFunctionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AppPlatformCloudFunctionRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AppPlatformCloudFunctionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest"; + }; + + AppPlatformCloudFunctionRequest.StructedInputAnnotation = (function() { + + /** + * Properties of a StructedInputAnnotation. + * @memberof google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest + * @interface IStructedInputAnnotation + * @property {number|Long|null} [ingestionTimeMicros] StructedInputAnnotation ingestionTimeMicros + * @property {google.protobuf.IStruct|null} [annotation] StructedInputAnnotation annotation + */ + + /** + * Constructs a new StructedInputAnnotation. + * @memberof google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest + * @classdesc Represents a StructedInputAnnotation. + * @implements IStructedInputAnnotation + * @constructor + * @param {google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest.IStructedInputAnnotation=} [properties] Properties to set + */ + function StructedInputAnnotation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * StructedInputAnnotation ingestionTimeMicros. + * @member {number|Long} ingestionTimeMicros + * @memberof google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest.StructedInputAnnotation + * @instance + */ + StructedInputAnnotation.prototype.ingestionTimeMicros = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * StructedInputAnnotation annotation. + * @member {google.protobuf.IStruct|null|undefined} annotation + * @memberof google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest.StructedInputAnnotation + * @instance + */ + StructedInputAnnotation.prototype.annotation = null; + + /** + * Creates a new StructedInputAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest.StructedInputAnnotation + * @static + * @param {google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest.IStructedInputAnnotation=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest.StructedInputAnnotation} StructedInputAnnotation instance + */ + StructedInputAnnotation.create = function create(properties) { + return new StructedInputAnnotation(properties); + }; + + /** + * Encodes the specified StructedInputAnnotation message. Does not implicitly {@link google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest.StructedInputAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest.StructedInputAnnotation + * @static + * @param {google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest.IStructedInputAnnotation} message StructedInputAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StructedInputAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ingestionTimeMicros != null && Object.hasOwnProperty.call(message, "ingestionTimeMicros")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.ingestionTimeMicros); + if (message.annotation != null && Object.hasOwnProperty.call(message, "annotation")) + $root.google.protobuf.Struct.encode(message.annotation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StructedInputAnnotation message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest.StructedInputAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest.StructedInputAnnotation + * @static + * @param {google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest.IStructedInputAnnotation} message StructedInputAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StructedInputAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StructedInputAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest.StructedInputAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest.StructedInputAnnotation} StructedInputAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StructedInputAnnotation.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest.StructedInputAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.ingestionTimeMicros = reader.int64(); + break; + } + case 2: { + message.annotation = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a StructedInputAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest.StructedInputAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest.StructedInputAnnotation} StructedInputAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StructedInputAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StructedInputAnnotation message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest.StructedInputAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StructedInputAnnotation.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.ingestionTimeMicros != null && message.hasOwnProperty("ingestionTimeMicros")) + if (!$util.isInteger(message.ingestionTimeMicros) && !(message.ingestionTimeMicros && $util.isInteger(message.ingestionTimeMicros.low) && $util.isInteger(message.ingestionTimeMicros.high))) + return "ingestionTimeMicros: integer|Long expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + var error = $root.google.protobuf.Struct.verify(message.annotation, long + 1); + if (error) + return "annotation." + error; + } + return null; + }; + + /** + * Creates a StructedInputAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest.StructedInputAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest.StructedInputAnnotation} StructedInputAnnotation + */ + StructedInputAnnotation.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest.StructedInputAnnotation) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest.StructedInputAnnotation(); + if (object.ingestionTimeMicros != null) + if ($util.Long) + (message.ingestionTimeMicros = $util.Long.fromValue(object.ingestionTimeMicros)).unsigned = false; + else if (typeof object.ingestionTimeMicros === "string") + message.ingestionTimeMicros = parseInt(object.ingestionTimeMicros, 10); + else if (typeof object.ingestionTimeMicros === "number") + message.ingestionTimeMicros = object.ingestionTimeMicros; + else if (typeof object.ingestionTimeMicros === "object") + message.ingestionTimeMicros = new $util.LongBits(object.ingestionTimeMicros.low >>> 0, object.ingestionTimeMicros.high >>> 0).toNumber(); + if (object.annotation != null) { + if (typeof object.annotation !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest.StructedInputAnnotation.annotation: object expected"); + message.annotation = $root.google.protobuf.Struct.fromObject(object.annotation, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a StructedInputAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest.StructedInputAnnotation + * @static + * @param {google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest.StructedInputAnnotation} message StructedInputAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StructedInputAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.ingestionTimeMicros = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.ingestionTimeMicros = options.longs === String ? "0" : 0; + object.annotation = null; + } + if (message.ingestionTimeMicros != null && message.hasOwnProperty("ingestionTimeMicros")) + if (typeof message.ingestionTimeMicros === "number") + object.ingestionTimeMicros = options.longs === String ? String(message.ingestionTimeMicros) : message.ingestionTimeMicros; + else + object.ingestionTimeMicros = options.longs === String ? $util.Long.prototype.toString.call(message.ingestionTimeMicros) : options.longs === Number ? new $util.LongBits(message.ingestionTimeMicros.low >>> 0, message.ingestionTimeMicros.high >>> 0).toNumber() : message.ingestionTimeMicros; + if (message.annotation != null && message.hasOwnProperty("annotation")) + object.annotation = $root.google.protobuf.Struct.toObject(message.annotation, options); + return object; + }; + + /** + * Converts this StructedInputAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest.StructedInputAnnotation + * @instance + * @returns {Object.} JSON object + */ + StructedInputAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StructedInputAnnotation + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest.StructedInputAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StructedInputAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionRequest.StructedInputAnnotation"; + }; + + return StructedInputAnnotation; + })(); + + return AppPlatformCloudFunctionRequest; + })(); + + v1alpha1.AppPlatformCloudFunctionResponse = (function() { + + /** + * Properties of an AppPlatformCloudFunctionResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IAppPlatformCloudFunctionResponse + * @property {Array.|null} [annotations] AppPlatformCloudFunctionResponse annotations + * @property {boolean|null} [annotationPassthrough] AppPlatformCloudFunctionResponse annotationPassthrough + * @property {Array.|null} [events] AppPlatformCloudFunctionResponse events + */ + + /** + * Constructs a new AppPlatformCloudFunctionResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents an AppPlatformCloudFunctionResponse. + * @implements IAppPlatformCloudFunctionResponse + * @constructor + * @param {google.cloud.visionai.v1alpha1.IAppPlatformCloudFunctionResponse=} [properties] Properties to set + */ + function AppPlatformCloudFunctionResponse(properties) { + this.annotations = []; + this.events = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * AppPlatformCloudFunctionResponse annotations. + * @member {Array.} annotations + * @memberof google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse + * @instance + */ + AppPlatformCloudFunctionResponse.prototype.annotations = $util.emptyArray; + + /** + * AppPlatformCloudFunctionResponse annotationPassthrough. + * @member {boolean} annotationPassthrough + * @memberof google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse + * @instance + */ + AppPlatformCloudFunctionResponse.prototype.annotationPassthrough = false; + + /** + * AppPlatformCloudFunctionResponse events. + * @member {Array.} events + * @memberof google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse + * @instance + */ + AppPlatformCloudFunctionResponse.prototype.events = $util.emptyArray; + + /** + * Creates a new AppPlatformCloudFunctionResponse instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IAppPlatformCloudFunctionResponse=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse} AppPlatformCloudFunctionResponse instance + */ + AppPlatformCloudFunctionResponse.create = function create(properties) { + return new AppPlatformCloudFunctionResponse(properties); + }; + + /** + * Encodes the specified AppPlatformCloudFunctionResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IAppPlatformCloudFunctionResponse} message AppPlatformCloudFunctionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AppPlatformCloudFunctionResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotations != null && message.annotations.length) + for (var i = 0; i < message.annotations.length; ++i) + $root.google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse.StructedOutputAnnotation.encode(message.annotations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.annotationPassthrough != null && Object.hasOwnProperty.call(message, "annotationPassthrough")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.annotationPassthrough); + if (message.events != null && message.events.length) + for (var i = 0; i < message.events.length; ++i) + $root.google.cloud.visionai.v1alpha1.AppPlatformEventBody.encode(message.events[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AppPlatformCloudFunctionResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IAppPlatformCloudFunctionResponse} message AppPlatformCloudFunctionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AppPlatformCloudFunctionResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AppPlatformCloudFunctionResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse} AppPlatformCloudFunctionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AppPlatformCloudFunctionResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.annotations && message.annotations.length)) + message.annotations = []; + message.annotations.push($root.google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse.StructedOutputAnnotation.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 3: { + message.annotationPassthrough = reader.bool(); + break; + } + case 4: { + if (!(message.events && message.events.length)) + message.events = []; + message.events.push($root.google.cloud.visionai.v1alpha1.AppPlatformEventBody.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an AppPlatformCloudFunctionResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse} AppPlatformCloudFunctionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AppPlatformCloudFunctionResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AppPlatformCloudFunctionResponse message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AppPlatformCloudFunctionResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!Array.isArray(message.annotations)) + return "annotations: array expected"; + for (var i = 0; i < message.annotations.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse.StructedOutputAnnotation.verify(message.annotations[i], long + 1); + if (error) + return "annotations." + error; + } + } + if (message.annotationPassthrough != null && message.hasOwnProperty("annotationPassthrough")) + if (typeof message.annotationPassthrough !== "boolean") + return "annotationPassthrough: boolean expected"; + if (message.events != null && message.hasOwnProperty("events")) { + if (!Array.isArray(message.events)) + return "events: array expected"; + for (var i = 0; i < message.events.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.AppPlatformEventBody.verify(message.events[i], long + 1); + if (error) + return "events." + error; + } + } + return null; + }; + + /** + * Creates an AppPlatformCloudFunctionResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse} AppPlatformCloudFunctionResponse + */ + AppPlatformCloudFunctionResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse(); + if (object.annotations) { + if (!Array.isArray(object.annotations)) + throw TypeError(".google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse.annotations: array expected"); + message.annotations = []; + for (var i = 0; i < object.annotations.length; ++i) { + if (typeof object.annotations[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse.annotations: object expected"); + message.annotations[i] = $root.google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse.StructedOutputAnnotation.fromObject(object.annotations[i], long + 1); + } + } + if (object.annotationPassthrough != null) + message.annotationPassthrough = Boolean(object.annotationPassthrough); + if (object.events) { + if (!Array.isArray(object.events)) + throw TypeError(".google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse.events: array expected"); + message.events = []; + for (var i = 0; i < object.events.length; ++i) { + if (typeof object.events[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse.events: object expected"); + message.events[i] = $root.google.cloud.visionai.v1alpha1.AppPlatformEventBody.fromObject(object.events[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from an AppPlatformCloudFunctionResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse + * @static + * @param {google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse} message AppPlatformCloudFunctionResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AppPlatformCloudFunctionResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.annotations = []; + object.events = []; + } + if (options.defaults) + object.annotationPassthrough = false; + if (message.annotations && message.annotations.length) { + object.annotations = []; + for (var j = 0; j < message.annotations.length; ++j) + object.annotations[j] = $root.google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse.StructedOutputAnnotation.toObject(message.annotations[j], options); + } + if (message.annotationPassthrough != null && message.hasOwnProperty("annotationPassthrough")) + object.annotationPassthrough = message.annotationPassthrough; + if (message.events && message.events.length) { + object.events = []; + for (var j = 0; j < message.events.length; ++j) + object.events[j] = $root.google.cloud.visionai.v1alpha1.AppPlatformEventBody.toObject(message.events[j], options); + } + return object; + }; + + /** + * Converts this AppPlatformCloudFunctionResponse to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse + * @instance + * @returns {Object.} JSON object + */ + AppPlatformCloudFunctionResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AppPlatformCloudFunctionResponse + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AppPlatformCloudFunctionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse"; + }; + + AppPlatformCloudFunctionResponse.StructedOutputAnnotation = (function() { + + /** + * Properties of a StructedOutputAnnotation. + * @memberof google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse + * @interface IStructedOutputAnnotation + * @property {google.protobuf.IStruct|null} [annotation] StructedOutputAnnotation annotation + */ + + /** + * Constructs a new StructedOutputAnnotation. + * @memberof google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse + * @classdesc Represents a StructedOutputAnnotation. + * @implements IStructedOutputAnnotation + * @constructor + * @param {google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse.IStructedOutputAnnotation=} [properties] Properties to set + */ + function StructedOutputAnnotation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * StructedOutputAnnotation annotation. + * @member {google.protobuf.IStruct|null|undefined} annotation + * @memberof google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse.StructedOutputAnnotation + * @instance + */ + StructedOutputAnnotation.prototype.annotation = null; + + /** + * Creates a new StructedOutputAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse.StructedOutputAnnotation + * @static + * @param {google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse.IStructedOutputAnnotation=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse.StructedOutputAnnotation} StructedOutputAnnotation instance + */ + StructedOutputAnnotation.create = function create(properties) { + return new StructedOutputAnnotation(properties); + }; + + /** + * Encodes the specified StructedOutputAnnotation message. Does not implicitly {@link google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse.StructedOutputAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse.StructedOutputAnnotation + * @static + * @param {google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse.IStructedOutputAnnotation} message StructedOutputAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StructedOutputAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && Object.hasOwnProperty.call(message, "annotation")) + $root.google.protobuf.Struct.encode(message.annotation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StructedOutputAnnotation message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse.StructedOutputAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse.StructedOutputAnnotation + * @static + * @param {google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse.IStructedOutputAnnotation} message StructedOutputAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StructedOutputAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StructedOutputAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse.StructedOutputAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse.StructedOutputAnnotation} StructedOutputAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StructedOutputAnnotation.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse.StructedOutputAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.annotation = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a StructedOutputAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse.StructedOutputAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse.StructedOutputAnnotation} StructedOutputAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StructedOutputAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StructedOutputAnnotation message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse.StructedOutputAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StructedOutputAnnotation.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + var error = $root.google.protobuf.Struct.verify(message.annotation, long + 1); + if (error) + return "annotation." + error; + } + return null; + }; + + /** + * Creates a StructedOutputAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse.StructedOutputAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse.StructedOutputAnnotation} StructedOutputAnnotation + */ + StructedOutputAnnotation.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse.StructedOutputAnnotation) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse.StructedOutputAnnotation(); + if (object.annotation != null) { + if (typeof object.annotation !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse.StructedOutputAnnotation.annotation: object expected"); + message.annotation = $root.google.protobuf.Struct.fromObject(object.annotation, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a StructedOutputAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse.StructedOutputAnnotation + * @static + * @param {google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse.StructedOutputAnnotation} message StructedOutputAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StructedOutputAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.annotation = null; + if (message.annotation != null && message.hasOwnProperty("annotation")) + object.annotation = $root.google.protobuf.Struct.toObject(message.annotation, options); + return object; + }; + + /** + * Converts this StructedOutputAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse.StructedOutputAnnotation + * @instance + * @returns {Object.} JSON object + */ + StructedOutputAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StructedOutputAnnotation + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse.StructedOutputAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StructedOutputAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.AppPlatformCloudFunctionResponse.StructedOutputAnnotation"; + }; + + return StructedOutputAnnotation; + })(); + + return AppPlatformCloudFunctionResponse; + })(); + + v1alpha1.AppPlatformEventBody = (function() { + + /** + * Properties of an AppPlatformEventBody. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IAppPlatformEventBody + * @property {string|null} [eventMessage] AppPlatformEventBody eventMessage + * @property {google.protobuf.IStruct|null} [payload] AppPlatformEventBody payload + * @property {string|null} [eventId] AppPlatformEventBody eventId + */ + + /** + * Constructs a new AppPlatformEventBody. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents an AppPlatformEventBody. + * @implements IAppPlatformEventBody + * @constructor + * @param {google.cloud.visionai.v1alpha1.IAppPlatformEventBody=} [properties] Properties to set + */ + function AppPlatformEventBody(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * AppPlatformEventBody eventMessage. + * @member {string} eventMessage + * @memberof google.cloud.visionai.v1alpha1.AppPlatformEventBody + * @instance + */ + AppPlatformEventBody.prototype.eventMessage = ""; + + /** + * AppPlatformEventBody payload. + * @member {google.protobuf.IStruct|null|undefined} payload + * @memberof google.cloud.visionai.v1alpha1.AppPlatformEventBody + * @instance + */ + AppPlatformEventBody.prototype.payload = null; + + /** + * AppPlatformEventBody eventId. + * @member {string} eventId + * @memberof google.cloud.visionai.v1alpha1.AppPlatformEventBody + * @instance + */ + AppPlatformEventBody.prototype.eventId = ""; + + /** + * Creates a new AppPlatformEventBody instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.AppPlatformEventBody + * @static + * @param {google.cloud.visionai.v1alpha1.IAppPlatformEventBody=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.AppPlatformEventBody} AppPlatformEventBody instance + */ + AppPlatformEventBody.create = function create(properties) { + return new AppPlatformEventBody(properties); + }; + + /** + * Encodes the specified AppPlatformEventBody message. Does not implicitly {@link google.cloud.visionai.v1alpha1.AppPlatformEventBody.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.AppPlatformEventBody + * @static + * @param {google.cloud.visionai.v1alpha1.IAppPlatformEventBody} message AppPlatformEventBody message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AppPlatformEventBody.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.eventMessage != null && Object.hasOwnProperty.call(message, "eventMessage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.eventMessage); + if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) + $root.google.protobuf.Struct.encode(message.payload, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.eventId != null && Object.hasOwnProperty.call(message, "eventId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.eventId); + return writer; + }; + + /** + * Encodes the specified AppPlatformEventBody message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.AppPlatformEventBody.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.AppPlatformEventBody + * @static + * @param {google.cloud.visionai.v1alpha1.IAppPlatformEventBody} message AppPlatformEventBody message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AppPlatformEventBody.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AppPlatformEventBody message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.AppPlatformEventBody + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.AppPlatformEventBody} AppPlatformEventBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AppPlatformEventBody.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.AppPlatformEventBody(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.eventMessage = reader.string(); + break; + } + case 2: { + message.payload = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.eventId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an AppPlatformEventBody message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.AppPlatformEventBody + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.AppPlatformEventBody} AppPlatformEventBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AppPlatformEventBody.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AppPlatformEventBody message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.AppPlatformEventBody + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AppPlatformEventBody.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.eventMessage != null && message.hasOwnProperty("eventMessage")) + if (!$util.isString(message.eventMessage)) + return "eventMessage: string expected"; + if (message.payload != null && message.hasOwnProperty("payload")) { + var error = $root.google.protobuf.Struct.verify(message.payload, long + 1); + if (error) + return "payload." + error; + } + if (message.eventId != null && message.hasOwnProperty("eventId")) + if (!$util.isString(message.eventId)) + return "eventId: string expected"; + return null; + }; + + /** + * Creates an AppPlatformEventBody message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.AppPlatformEventBody + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.AppPlatformEventBody} AppPlatformEventBody + */ + AppPlatformEventBody.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.AppPlatformEventBody) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.AppPlatformEventBody(); + if (object.eventMessage != null) + message.eventMessage = String(object.eventMessage); + if (object.payload != null) { + if (typeof object.payload !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.AppPlatformEventBody.payload: object expected"); + message.payload = $root.google.protobuf.Struct.fromObject(object.payload, long + 1); + } + if (object.eventId != null) + message.eventId = String(object.eventId); + return message; + }; + + /** + * Creates a plain object from an AppPlatformEventBody message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.AppPlatformEventBody + * @static + * @param {google.cloud.visionai.v1alpha1.AppPlatformEventBody} message AppPlatformEventBody + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AppPlatformEventBody.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.eventMessage = ""; + object.payload = null; + object.eventId = ""; + } + if (message.eventMessage != null && message.hasOwnProperty("eventMessage")) + object.eventMessage = message.eventMessage; + if (message.payload != null && message.hasOwnProperty("payload")) + object.payload = $root.google.protobuf.Struct.toObject(message.payload, options); + if (message.eventId != null && message.hasOwnProperty("eventId")) + object.eventId = message.eventId; + return object; + }; + + /** + * Converts this AppPlatformEventBody to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.AppPlatformEventBody + * @instance + * @returns {Object.} JSON object + */ + AppPlatformEventBody.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AppPlatformEventBody + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.AppPlatformEventBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AppPlatformEventBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.AppPlatformEventBody"; + }; + + return AppPlatformEventBody; + })(); + + v1alpha1.Cluster = (function() { + + /** + * Properties of a Cluster. + * @memberof google.cloud.visionai.v1alpha1 + * @interface ICluster + * @property {string|null} [name] Cluster name + * @property {google.protobuf.ITimestamp|null} [createTime] Cluster createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Cluster updateTime + * @property {Object.|null} [labels] Cluster labels + * @property {Object.|null} [annotations] Cluster annotations + * @property {string|null} [dataplaneServiceEndpoint] Cluster dataplaneServiceEndpoint + * @property {google.cloud.visionai.v1alpha1.Cluster.State|null} [state] Cluster state + * @property {string|null} [pscTarget] Cluster pscTarget + */ + + /** + * Constructs a new Cluster. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a Cluster. + * @implements ICluster + * @constructor + * @param {google.cloud.visionai.v1alpha1.ICluster=} [properties] Properties to set + */ + function Cluster(properties) { + this.labels = {}; + this.annotations = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Cluster name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.Cluster + * @instance + */ + Cluster.prototype.name = ""; + + /** + * Cluster createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.visionai.v1alpha1.Cluster + * @instance + */ + Cluster.prototype.createTime = null; + + /** + * Cluster updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.visionai.v1alpha1.Cluster + * @instance + */ + Cluster.prototype.updateTime = null; + + /** + * Cluster labels. + * @member {Object.} labels + * @memberof google.cloud.visionai.v1alpha1.Cluster + * @instance + */ + Cluster.prototype.labels = $util.emptyObject; + + /** + * Cluster annotations. + * @member {Object.} annotations + * @memberof google.cloud.visionai.v1alpha1.Cluster + * @instance + */ + Cluster.prototype.annotations = $util.emptyObject; + + /** + * Cluster dataplaneServiceEndpoint. + * @member {string} dataplaneServiceEndpoint + * @memberof google.cloud.visionai.v1alpha1.Cluster + * @instance + */ + Cluster.prototype.dataplaneServiceEndpoint = ""; + + /** + * Cluster state. + * @member {google.cloud.visionai.v1alpha1.Cluster.State} state + * @memberof google.cloud.visionai.v1alpha1.Cluster + * @instance + */ + Cluster.prototype.state = 0; + + /** + * Cluster pscTarget. + * @member {string} pscTarget + * @memberof google.cloud.visionai.v1alpha1.Cluster + * @instance + */ + Cluster.prototype.pscTarget = ""; + + /** + * Creates a new Cluster instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.Cluster + * @static + * @param {google.cloud.visionai.v1alpha1.ICluster=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.Cluster} Cluster instance + */ + Cluster.create = function create(properties) { + return new Cluster(properties); + }; + + /** + * Encodes the specified Cluster message. Does not implicitly {@link google.cloud.visionai.v1alpha1.Cluster.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.Cluster + * @static + * @param {google.cloud.visionai.v1alpha1.ICluster} message Cluster message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Cluster.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + if (message.dataplaneServiceEndpoint != null && Object.hasOwnProperty.call(message, "dataplaneServiceEndpoint")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.dataplaneServiceEndpoint); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); + if (message.pscTarget != null && Object.hasOwnProperty.call(message, "pscTarget")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.pscTarget); + return writer; + }; + + /** + * Encodes the specified Cluster message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.Cluster.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.Cluster + * @static + * @param {google.cloud.visionai.v1alpha1.ICluster} message Cluster message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Cluster.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Cluster message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.Cluster + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.Cluster} Cluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Cluster.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.Cluster(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.labels, key); + message.labels[key] = value; + break; + } + case 5: { + if (message.annotations === $util.emptyObject) + message.annotations = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.annotations, key); + message.annotations[key] = value; + break; + } + case 6: { + message.dataplaneServiceEndpoint = reader.string(); + break; + } + case 7: { + message.state = reader.int32(); + break; + } + case 8: { + message.pscTarget = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Cluster message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.Cluster + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.Cluster} Cluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Cluster.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Cluster message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.Cluster + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Cluster.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime, long + 1); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime, long + 1); + if (error) + return "updateTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!$util.isObject(message.annotations)) + return "annotations: object expected"; + var key = Object.keys(message.annotations); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.annotations[key[i]])) + return "annotations: string{k:string} expected"; + } + if (message.dataplaneServiceEndpoint != null && message.hasOwnProperty("dataplaneServiceEndpoint")) + if (!$util.isString(message.dataplaneServiceEndpoint)) + return "dataplaneServiceEndpoint: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.pscTarget != null && message.hasOwnProperty("pscTarget")) + if (!$util.isString(message.pscTarget)) + return "pscTarget: string expected"; + return null; + }; + + /** + * Creates a Cluster message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.Cluster + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.Cluster} Cluster + */ + Cluster.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.Cluster) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.Cluster(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Cluster.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime, long + 1); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Cluster.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime, long + 1); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Cluster.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.labels, keys[i]); + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + } + if (object.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Cluster.annotations: object expected"); + message.annotations = {}; + for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.annotations, keys[i]); + message.annotations[keys[i]] = String(object.annotations[keys[i]]); + } + } + if (object.dataplaneServiceEndpoint != null) + message.dataplaneServiceEndpoint = String(object.dataplaneServiceEndpoint); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "PROVISIONING": + case 1: + message.state = 1; + break; + case "RUNNING": + case 2: + message.state = 2; + break; + case "STOPPING": + case 3: + message.state = 3; + break; + case "ERROR": + case 4: + message.state = 4; + break; + } + if (object.pscTarget != null) + message.pscTarget = String(object.pscTarget); + return message; + }; + + /** + * Creates a plain object from a Cluster message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.Cluster + * @static + * @param {google.cloud.visionai.v1alpha1.Cluster} message Cluster + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Cluster.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.labels = {}; + object.annotations = {}; + } + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.dataplaneServiceEndpoint = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.pscTarget = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.labels, keys2[j]); + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + } + if (message.annotations && (keys2 = Object.keys(message.annotations)).length) { + object.annotations = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.annotations, keys2[j]); + object.annotations[keys2[j]] = message.annotations[keys2[j]]; + } + } + if (message.dataplaneServiceEndpoint != null && message.hasOwnProperty("dataplaneServiceEndpoint")) + object.dataplaneServiceEndpoint = message.dataplaneServiceEndpoint; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.visionai.v1alpha1.Cluster.State[message.state] === undefined ? message.state : $root.google.cloud.visionai.v1alpha1.Cluster.State[message.state] : message.state; + if (message.pscTarget != null && message.hasOwnProperty("pscTarget")) + object.pscTarget = message.pscTarget; + return object; + }; + + /** + * Converts this Cluster to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.Cluster + * @instance + * @returns {Object.} JSON object + */ + Cluster.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Cluster + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.Cluster + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Cluster.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.Cluster"; + }; + + /** + * State enum. + * @name google.cloud.visionai.v1alpha1.Cluster.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} PROVISIONING=1 PROVISIONING value + * @property {number} RUNNING=2 RUNNING value + * @property {number} STOPPING=3 STOPPING value + * @property {number} ERROR=4 ERROR value + */ + Cluster.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PROVISIONING"] = 1; + values[valuesById[2] = "RUNNING"] = 2; + values[valuesById[3] = "STOPPING"] = 3; + values[valuesById[4] = "ERROR"] = 4; + return values; + })(); + + return Cluster; + })(); + + v1alpha1.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IOperationMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime + * @property {string|null} [target] OperationMetadata target + * @property {string|null} [verb] OperationMetadata verb + * @property {string|null} [statusMessage] OperationMetadata statusMessage + * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation + * @property {string|null} [apiVersion] OperationMetadata apiVersion + */ + + /** + * Constructs a new OperationMetadata. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.visionai.v1alpha1.IOperationMetadata=} [properties] Properties to set + */ + function OperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.visionai.v1alpha1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.visionai.v1alpha1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.endTime = null; + + /** + * OperationMetadata target. + * @member {string} target + * @memberof google.cloud.visionai.v1alpha1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.target = ""; + + /** + * OperationMetadata verb. + * @member {string} verb + * @memberof google.cloud.visionai.v1alpha1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.verb = ""; + + /** + * OperationMetadata statusMessage. + * @member {string} statusMessage + * @memberof google.cloud.visionai.v1alpha1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.statusMessage = ""; + + /** + * OperationMetadata requestedCancellation. + * @member {boolean} requestedCancellation + * @memberof google.cloud.visionai.v1alpha1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.requestedCancellation = false; + + /** + * OperationMetadata apiVersion. + * @member {string} apiVersion + * @memberof google.cloud.visionai.v1alpha1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.apiVersion = ""; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.OperationMetadata + * @static + * @param {google.cloud.visionai.v1alpha1.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.visionai.v1alpha1.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.OperationMetadata + * @static + * @param {google.cloud.visionai.v1alpha1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); + if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); + if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusMessage); + if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requestedCancellation); + if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.apiVersion); + return writer; + }; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.OperationMetadata + * @static + * @param {google.cloud.visionai.v1alpha1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.OperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.target = reader.string(); + break; + } + case 4: { + message.verb = reader.string(); + break; + } + case 5: { + message.statusMessage = reader.string(); + break; + } + case 6: { + message.requestedCancellation = reader.bool(); + break; + } + case 7: { + message.apiVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationMetadata message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.OperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationMetadata.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime, long + 1); + if (error) + return "createTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime, long + 1); + if (error) + return "endTime." + error; + } + if (message.target != null && message.hasOwnProperty("target")) + if (!$util.isString(message.target)) + return "target: string expected"; + if (message.verb != null && message.hasOwnProperty("verb")) + if (!$util.isString(message.verb)) + return "verb: string expected"; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + if (!$util.isString(message.statusMessage)) + return "statusMessage: string expected"; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + if (typeof message.requestedCancellation !== "boolean") + return "requestedCancellation: boolean expected"; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + if (!$util.isString(message.apiVersion)) + return "apiVersion: string expected"; + return null; + }; + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.OperationMetadata) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.OperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.OperationMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime, long + 1); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.OperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime, long + 1); + } + if (object.target != null) + message.target = String(object.target); + if (object.verb != null) + message.verb = String(object.verb); + if (object.statusMessage != null) + message.statusMessage = String(object.statusMessage); + if (object.requestedCancellation != null) + message.requestedCancellation = Boolean(object.requestedCancellation); + if (object.apiVersion != null) + message.apiVersion = String(object.apiVersion); + return message; + }; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.OperationMetadata + * @static + * @param {google.cloud.visionai.v1alpha1.OperationMetadata} message OperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.createTime = null; + object.endTime = null; + object.target = ""; + object.verb = ""; + object.statusMessage = ""; + object.requestedCancellation = false; + object.apiVersion = ""; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.target != null && message.hasOwnProperty("target")) + object.target = message.target; + if (message.verb != null && message.hasOwnProperty("verb")) + object.verb = message.verb; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + object.statusMessage = message.statusMessage; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + object.requestedCancellation = message.requestedCancellation; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + object.apiVersion = message.apiVersion; + return object; + }; + + /** + * Converts this OperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.OperationMetadata + * @instance + * @returns {Object.} JSON object + */ + OperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationMetadata + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.OperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.OperationMetadata"; + }; + + return OperationMetadata; + })(); + + v1alpha1.GcsSource = (function() { + + /** + * Properties of a GcsSource. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IGcsSource + * @property {Array.|null} [uris] GcsSource uris + */ + + /** + * Constructs a new GcsSource. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a GcsSource. + * @implements IGcsSource + * @constructor + * @param {google.cloud.visionai.v1alpha1.IGcsSource=} [properties] Properties to set + */ + function GcsSource(properties) { + this.uris = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GcsSource uris. + * @member {Array.} uris + * @memberof google.cloud.visionai.v1alpha1.GcsSource + * @instance + */ + GcsSource.prototype.uris = $util.emptyArray; + + /** + * Creates a new GcsSource instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.GcsSource + * @static + * @param {google.cloud.visionai.v1alpha1.IGcsSource=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.GcsSource} GcsSource instance + */ + GcsSource.create = function create(properties) { + return new GcsSource(properties); + }; + + /** + * Encodes the specified GcsSource message. Does not implicitly {@link google.cloud.visionai.v1alpha1.GcsSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.GcsSource + * @static + * @param {google.cloud.visionai.v1alpha1.IGcsSource} message GcsSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uris != null && message.uris.length) + for (var i = 0; i < message.uris.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uris[i]); + return writer; + }; + + /** + * Encodes the specified GcsSource message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.GcsSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.GcsSource + * @static + * @param {google.cloud.visionai.v1alpha1.IGcsSource} message GcsSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcsSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.GcsSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.GcsSource} GcsSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsSource.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.GcsSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.uris && message.uris.length)) + message.uris = []; + message.uris.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GcsSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.GcsSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.GcsSource} GcsSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcsSource message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.GcsSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcsSource.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.uris != null && message.hasOwnProperty("uris")) { + if (!Array.isArray(message.uris)) + return "uris: array expected"; + for (var i = 0; i < message.uris.length; ++i) + if (!$util.isString(message.uris[i])) + return "uris: string[] expected"; + } + return null; + }; + + /** + * Creates a GcsSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.GcsSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.GcsSource} GcsSource + */ + GcsSource.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.GcsSource) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.GcsSource(); + if (object.uris) { + if (!Array.isArray(object.uris)) + throw TypeError(".google.cloud.visionai.v1alpha1.GcsSource.uris: array expected"); + message.uris = []; + for (var i = 0; i < object.uris.length; ++i) + message.uris[i] = String(object.uris[i]); + } + return message; + }; + + /** + * Creates a plain object from a GcsSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.GcsSource + * @static + * @param {google.cloud.visionai.v1alpha1.GcsSource} message GcsSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcsSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uris = []; + if (message.uris && message.uris.length) { + object.uris = []; + for (var j = 0; j < message.uris.length; ++j) + object.uris[j] = message.uris[j]; + } + return object; + }; + + /** + * Converts this GcsSource to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.GcsSource + * @instance + * @returns {Object.} JSON object + */ + GcsSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GcsSource + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.GcsSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcsSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.GcsSource"; + }; + + return GcsSource; + })(); + + v1alpha1.AttributeValue = (function() { + + /** + * Properties of an AttributeValue. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IAttributeValue + * @property {number|Long|null} [i] AttributeValue i + * @property {number|null} [f] AttributeValue f + * @property {boolean|null} [b] AttributeValue b + * @property {Uint8Array|null} [s] AttributeValue s + */ + + /** + * Constructs a new AttributeValue. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents an AttributeValue. + * @implements IAttributeValue + * @constructor + * @param {google.cloud.visionai.v1alpha1.IAttributeValue=} [properties] Properties to set + */ + function AttributeValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * AttributeValue i. + * @member {number|Long|null|undefined} i + * @memberof google.cloud.visionai.v1alpha1.AttributeValue + * @instance + */ + AttributeValue.prototype.i = null; + + /** + * AttributeValue f. + * @member {number|null|undefined} f + * @memberof google.cloud.visionai.v1alpha1.AttributeValue + * @instance + */ + AttributeValue.prototype.f = null; + + /** + * AttributeValue b. + * @member {boolean|null|undefined} b + * @memberof google.cloud.visionai.v1alpha1.AttributeValue + * @instance + */ + AttributeValue.prototype.b = null; + + /** + * AttributeValue s. + * @member {Uint8Array|null|undefined} s + * @memberof google.cloud.visionai.v1alpha1.AttributeValue + * @instance + */ + AttributeValue.prototype.s = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AttributeValue value. + * @member {"i"|"f"|"b"|"s"|undefined} value + * @memberof google.cloud.visionai.v1alpha1.AttributeValue + * @instance + */ + Object.defineProperty(AttributeValue.prototype, "value", { + get: $util.oneOfGetter($oneOfFields = ["i", "f", "b", "s"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AttributeValue instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.AttributeValue + * @static + * @param {google.cloud.visionai.v1alpha1.IAttributeValue=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.AttributeValue} AttributeValue instance + */ + AttributeValue.create = function create(properties) { + return new AttributeValue(properties); + }; + + /** + * Encodes the specified AttributeValue message. Does not implicitly {@link google.cloud.visionai.v1alpha1.AttributeValue.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.AttributeValue + * @static + * @param {google.cloud.visionai.v1alpha1.IAttributeValue} message AttributeValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttributeValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.i != null && Object.hasOwnProperty.call(message, "i")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.i); + if (message.f != null && Object.hasOwnProperty.call(message, "f")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.f); + if (message.b != null && Object.hasOwnProperty.call(message, "b")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.b); + if (message.s != null && Object.hasOwnProperty.call(message, "s")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.s); + return writer; + }; + + /** + * Encodes the specified AttributeValue message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.AttributeValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.AttributeValue + * @static + * @param {google.cloud.visionai.v1alpha1.IAttributeValue} message AttributeValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttributeValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AttributeValue message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.AttributeValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.AttributeValue} AttributeValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttributeValue.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.AttributeValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.i = reader.int64(); + break; + } + case 2: { + message.f = reader.float(); + break; + } + case 3: { + message.b = reader.bool(); + break; + } + case 4: { + message.s = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an AttributeValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.AttributeValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.AttributeValue} AttributeValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttributeValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AttributeValue message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.AttributeValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AttributeValue.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.i != null && message.hasOwnProperty("i")) { + properties.value = 1; + if (!$util.isInteger(message.i) && !(message.i && $util.isInteger(message.i.low) && $util.isInteger(message.i.high))) + return "i: integer|Long expected"; + } + if (message.f != null && message.hasOwnProperty("f")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + if (typeof message.f !== "number") + return "f: number expected"; + } + if (message.b != null && message.hasOwnProperty("b")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + if (typeof message.b !== "boolean") + return "b: boolean expected"; + } + if (message.s != null && message.hasOwnProperty("s")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + if (!(message.s && typeof message.s.length === "number" || $util.isString(message.s))) + return "s: buffer expected"; + } + return null; + }; + + /** + * Creates an AttributeValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.AttributeValue + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.AttributeValue} AttributeValue + */ + AttributeValue.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.AttributeValue) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.AttributeValue(); + if (object.i != null) + if ($util.Long) + (message.i = $util.Long.fromValue(object.i)).unsigned = false; + else if (typeof object.i === "string") + message.i = parseInt(object.i, 10); + else if (typeof object.i === "number") + message.i = object.i; + else if (typeof object.i === "object") + message.i = new $util.LongBits(object.i.low >>> 0, object.i.high >>> 0).toNumber(); + if (object.f != null) + message.f = Number(object.f); + if (object.b != null) + message.b = Boolean(object.b); + if (object.s != null) + if (typeof object.s === "string") + $util.base64.decode(object.s, message.s = $util.newBuffer($util.base64.length(object.s)), 0); + else if (object.s.length >= 0) + message.s = object.s; + return message; + }; + + /** + * Creates a plain object from an AttributeValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.AttributeValue + * @static + * @param {google.cloud.visionai.v1alpha1.AttributeValue} message AttributeValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AttributeValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.i != null && message.hasOwnProperty("i")) { + if (typeof message.i === "number") + object.i = options.longs === String ? String(message.i) : message.i; + else + object.i = options.longs === String ? $util.Long.prototype.toString.call(message.i) : options.longs === Number ? new $util.LongBits(message.i.low >>> 0, message.i.high >>> 0).toNumber() : message.i; + if (options.oneofs) + object.value = "i"; + } + if (message.f != null && message.hasOwnProperty("f")) { + object.f = options.json && !isFinite(message.f) ? String(message.f) : message.f; + if (options.oneofs) + object.value = "f"; + } + if (message.b != null && message.hasOwnProperty("b")) { + object.b = message.b; + if (options.oneofs) + object.value = "b"; + } + if (message.s != null && message.hasOwnProperty("s")) { + object.s = options.bytes === String ? $util.base64.encode(message.s, 0, message.s.length) : options.bytes === Array ? Array.prototype.slice.call(message.s) : message.s; + if (options.oneofs) + object.value = "s"; + } + return object; + }; + + /** + * Converts this AttributeValue to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.AttributeValue + * @instance + * @returns {Object.} JSON object + */ + AttributeValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AttributeValue + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.AttributeValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AttributeValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.AttributeValue"; + }; + + return AttributeValue; + })(); + + v1alpha1.AnalyzerDefinition = (function() { + + /** + * Properties of an AnalyzerDefinition. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IAnalyzerDefinition + * @property {string|null} [analyzer] AnalyzerDefinition analyzer + * @property {string|null} [operator] AnalyzerDefinition operator + * @property {Array.|null} [inputs] AnalyzerDefinition inputs + * @property {Object.|null} [attrs] AnalyzerDefinition attrs + * @property {google.cloud.visionai.v1alpha1.AnalyzerDefinition.IDebugOptions|null} [debugOptions] AnalyzerDefinition debugOptions + */ + + /** + * Constructs a new AnalyzerDefinition. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents an AnalyzerDefinition. + * @implements IAnalyzerDefinition + * @constructor + * @param {google.cloud.visionai.v1alpha1.IAnalyzerDefinition=} [properties] Properties to set + */ + function AnalyzerDefinition(properties) { + this.inputs = []; + this.attrs = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnalyzerDefinition analyzer. + * @member {string} analyzer + * @memberof google.cloud.visionai.v1alpha1.AnalyzerDefinition + * @instance + */ + AnalyzerDefinition.prototype.analyzer = ""; + + /** + * AnalyzerDefinition operator. + * @member {string} operator + * @memberof google.cloud.visionai.v1alpha1.AnalyzerDefinition + * @instance + */ + AnalyzerDefinition.prototype.operator = ""; + + /** + * AnalyzerDefinition inputs. + * @member {Array.} inputs + * @memberof google.cloud.visionai.v1alpha1.AnalyzerDefinition + * @instance + */ + AnalyzerDefinition.prototype.inputs = $util.emptyArray; + + /** + * AnalyzerDefinition attrs. + * @member {Object.} attrs + * @memberof google.cloud.visionai.v1alpha1.AnalyzerDefinition + * @instance + */ + AnalyzerDefinition.prototype.attrs = $util.emptyObject; + + /** + * AnalyzerDefinition debugOptions. + * @member {google.cloud.visionai.v1alpha1.AnalyzerDefinition.IDebugOptions|null|undefined} debugOptions + * @memberof google.cloud.visionai.v1alpha1.AnalyzerDefinition + * @instance + */ + AnalyzerDefinition.prototype.debugOptions = null; + + /** + * Creates a new AnalyzerDefinition instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.AnalyzerDefinition + * @static + * @param {google.cloud.visionai.v1alpha1.IAnalyzerDefinition=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.AnalyzerDefinition} AnalyzerDefinition instance + */ + AnalyzerDefinition.create = function create(properties) { + return new AnalyzerDefinition(properties); + }; + + /** + * Encodes the specified AnalyzerDefinition message. Does not implicitly {@link google.cloud.visionai.v1alpha1.AnalyzerDefinition.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.AnalyzerDefinition + * @static + * @param {google.cloud.visionai.v1alpha1.IAnalyzerDefinition} message AnalyzerDefinition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzerDefinition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.analyzer != null && Object.hasOwnProperty.call(message, "analyzer")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.analyzer); + if (message.operator != null && Object.hasOwnProperty.call(message, "operator")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.operator); + if (message.inputs != null && message.inputs.length) + for (var i = 0; i < message.inputs.length; ++i) + $root.google.cloud.visionai.v1alpha1.AnalyzerDefinition.StreamInput.encode(message.inputs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.attrs != null && Object.hasOwnProperty.call(message, "attrs")) + for (var keys = Object.keys(message.attrs), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.visionai.v1alpha1.AttributeValue.encode(message.attrs[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.debugOptions != null && Object.hasOwnProperty.call(message, "debugOptions")) + $root.google.cloud.visionai.v1alpha1.AnalyzerDefinition.DebugOptions.encode(message.debugOptions, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnalyzerDefinition message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.AnalyzerDefinition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.AnalyzerDefinition + * @static + * @param {google.cloud.visionai.v1alpha1.IAnalyzerDefinition} message AnalyzerDefinition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzerDefinition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnalyzerDefinition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.AnalyzerDefinition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.AnalyzerDefinition} AnalyzerDefinition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzerDefinition.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.AnalyzerDefinition(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.analyzer = reader.string(); + break; + } + case 2: { + message.operator = reader.string(); + break; + } + case 3: { + if (!(message.inputs && message.inputs.length)) + message.inputs = []; + message.inputs.push($root.google.cloud.visionai.v1alpha1.AnalyzerDefinition.StreamInput.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 4: { + if (message.attrs === $util.emptyObject) + message.attrs = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.visionai.v1alpha1.AttributeValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.attrs, key); + message.attrs[key] = value; + break; + } + case 5: { + message.debugOptions = $root.google.cloud.visionai.v1alpha1.AnalyzerDefinition.DebugOptions.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an AnalyzerDefinition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.AnalyzerDefinition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.AnalyzerDefinition} AnalyzerDefinition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzerDefinition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnalyzerDefinition message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.AnalyzerDefinition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnalyzerDefinition.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.analyzer != null && message.hasOwnProperty("analyzer")) + if (!$util.isString(message.analyzer)) + return "analyzer: string expected"; + if (message.operator != null && message.hasOwnProperty("operator")) + if (!$util.isString(message.operator)) + return "operator: string expected"; + if (message.inputs != null && message.hasOwnProperty("inputs")) { + if (!Array.isArray(message.inputs)) + return "inputs: array expected"; + for (var i = 0; i < message.inputs.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.AnalyzerDefinition.StreamInput.verify(message.inputs[i], long + 1); + if (error) + return "inputs." + error; + } + } + if (message.attrs != null && message.hasOwnProperty("attrs")) { + if (!$util.isObject(message.attrs)) + return "attrs: object expected"; + var key = Object.keys(message.attrs); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.AttributeValue.verify(message.attrs[key[i]], long + 1); + if (error) + return "attrs." + error; + } + } + if (message.debugOptions != null && message.hasOwnProperty("debugOptions")) { + var error = $root.google.cloud.visionai.v1alpha1.AnalyzerDefinition.DebugOptions.verify(message.debugOptions, long + 1); + if (error) + return "debugOptions." + error; + } + return null; + }; + + /** + * Creates an AnalyzerDefinition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.AnalyzerDefinition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.AnalyzerDefinition} AnalyzerDefinition + */ + AnalyzerDefinition.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.AnalyzerDefinition) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.AnalyzerDefinition(); + if (object.analyzer != null) + message.analyzer = String(object.analyzer); + if (object.operator != null) + message.operator = String(object.operator); + if (object.inputs) { + if (!Array.isArray(object.inputs)) + throw TypeError(".google.cloud.visionai.v1alpha1.AnalyzerDefinition.inputs: array expected"); + message.inputs = []; + for (var i = 0; i < object.inputs.length; ++i) { + if (typeof object.inputs[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.AnalyzerDefinition.inputs: object expected"); + message.inputs[i] = $root.google.cloud.visionai.v1alpha1.AnalyzerDefinition.StreamInput.fromObject(object.inputs[i], long + 1); + } + } + if (object.attrs) { + if (typeof object.attrs !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.AnalyzerDefinition.attrs: object expected"); + message.attrs = {}; + for (var keys = Object.keys(object.attrs), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.attrs, keys[i]); + if (typeof object.attrs[keys[i]] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.AnalyzerDefinition.attrs: object expected"); + message.attrs[keys[i]] = $root.google.cloud.visionai.v1alpha1.AttributeValue.fromObject(object.attrs[keys[i]], long + 1); + } + } + if (object.debugOptions != null) { + if (typeof object.debugOptions !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.AnalyzerDefinition.debugOptions: object expected"); + message.debugOptions = $root.google.cloud.visionai.v1alpha1.AnalyzerDefinition.DebugOptions.fromObject(object.debugOptions, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an AnalyzerDefinition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.AnalyzerDefinition + * @static + * @param {google.cloud.visionai.v1alpha1.AnalyzerDefinition} message AnalyzerDefinition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnalyzerDefinition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.inputs = []; + if (options.objects || options.defaults) + object.attrs = {}; + if (options.defaults) { + object.analyzer = ""; + object.operator = ""; + object.debugOptions = null; + } + if (message.analyzer != null && message.hasOwnProperty("analyzer")) + object.analyzer = message.analyzer; + if (message.operator != null && message.hasOwnProperty("operator")) + object.operator = message.operator; + if (message.inputs && message.inputs.length) { + object.inputs = []; + for (var j = 0; j < message.inputs.length; ++j) + object.inputs[j] = $root.google.cloud.visionai.v1alpha1.AnalyzerDefinition.StreamInput.toObject(message.inputs[j], options); + } + var keys2; + if (message.attrs && (keys2 = Object.keys(message.attrs)).length) { + object.attrs = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.attrs, keys2[j]); + object.attrs[keys2[j]] = $root.google.cloud.visionai.v1alpha1.AttributeValue.toObject(message.attrs[keys2[j]], options); + } + } + if (message.debugOptions != null && message.hasOwnProperty("debugOptions")) + object.debugOptions = $root.google.cloud.visionai.v1alpha1.AnalyzerDefinition.DebugOptions.toObject(message.debugOptions, options); + return object; + }; + + /** + * Converts this AnalyzerDefinition to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.AnalyzerDefinition + * @instance + * @returns {Object.} JSON object + */ + AnalyzerDefinition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnalyzerDefinition + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.AnalyzerDefinition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnalyzerDefinition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.AnalyzerDefinition"; + }; + + AnalyzerDefinition.StreamInput = (function() { + + /** + * Properties of a StreamInput. + * @memberof google.cloud.visionai.v1alpha1.AnalyzerDefinition + * @interface IStreamInput + * @property {string|null} [input] StreamInput input + */ + + /** + * Constructs a new StreamInput. + * @memberof google.cloud.visionai.v1alpha1.AnalyzerDefinition + * @classdesc Represents a StreamInput. + * @implements IStreamInput + * @constructor + * @param {google.cloud.visionai.v1alpha1.AnalyzerDefinition.IStreamInput=} [properties] Properties to set + */ + function StreamInput(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamInput input. + * @member {string} input + * @memberof google.cloud.visionai.v1alpha1.AnalyzerDefinition.StreamInput + * @instance + */ + StreamInput.prototype.input = ""; + + /** + * Creates a new StreamInput instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.AnalyzerDefinition.StreamInput + * @static + * @param {google.cloud.visionai.v1alpha1.AnalyzerDefinition.IStreamInput=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.AnalyzerDefinition.StreamInput} StreamInput instance + */ + StreamInput.create = function create(properties) { + return new StreamInput(properties); + }; + + /** + * Encodes the specified StreamInput message. Does not implicitly {@link google.cloud.visionai.v1alpha1.AnalyzerDefinition.StreamInput.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.AnalyzerDefinition.StreamInput + * @static + * @param {google.cloud.visionai.v1alpha1.AnalyzerDefinition.IStreamInput} message StreamInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamInput.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.input != null && Object.hasOwnProperty.call(message, "input")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.input); + return writer; + }; + + /** + * Encodes the specified StreamInput message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.AnalyzerDefinition.StreamInput.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.AnalyzerDefinition.StreamInput + * @static + * @param {google.cloud.visionai.v1alpha1.AnalyzerDefinition.IStreamInput} message StreamInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamInput.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamInput message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.AnalyzerDefinition.StreamInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.AnalyzerDefinition.StreamInput} StreamInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamInput.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.AnalyzerDefinition.StreamInput(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.input = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a StreamInput message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.AnalyzerDefinition.StreamInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.AnalyzerDefinition.StreamInput} StreamInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamInput.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamInput message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.AnalyzerDefinition.StreamInput + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamInput.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.input != null && message.hasOwnProperty("input")) + if (!$util.isString(message.input)) + return "input: string expected"; + return null; + }; + + /** + * Creates a StreamInput message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.AnalyzerDefinition.StreamInput + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.AnalyzerDefinition.StreamInput} StreamInput + */ + StreamInput.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.AnalyzerDefinition.StreamInput) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.AnalyzerDefinition.StreamInput(); + if (object.input != null) + message.input = String(object.input); + return message; + }; + + /** + * Creates a plain object from a StreamInput message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.AnalyzerDefinition.StreamInput + * @static + * @param {google.cloud.visionai.v1alpha1.AnalyzerDefinition.StreamInput} message StreamInput + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamInput.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.input = ""; + if (message.input != null && message.hasOwnProperty("input")) + object.input = message.input; + return object; + }; + + /** + * Converts this StreamInput to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.AnalyzerDefinition.StreamInput + * @instance + * @returns {Object.} JSON object + */ + StreamInput.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamInput + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.AnalyzerDefinition.StreamInput + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamInput.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.AnalyzerDefinition.StreamInput"; + }; + + return StreamInput; + })(); + + AnalyzerDefinition.DebugOptions = (function() { + + /** + * Properties of a DebugOptions. + * @memberof google.cloud.visionai.v1alpha1.AnalyzerDefinition + * @interface IDebugOptions + * @property {Object.|null} [environmentVariables] DebugOptions environmentVariables + */ + + /** + * Constructs a new DebugOptions. + * @memberof google.cloud.visionai.v1alpha1.AnalyzerDefinition + * @classdesc Represents a DebugOptions. + * @implements IDebugOptions + * @constructor + * @param {google.cloud.visionai.v1alpha1.AnalyzerDefinition.IDebugOptions=} [properties] Properties to set + */ + function DebugOptions(properties) { + this.environmentVariables = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DebugOptions environmentVariables. + * @member {Object.} environmentVariables + * @memberof google.cloud.visionai.v1alpha1.AnalyzerDefinition.DebugOptions + * @instance + */ + DebugOptions.prototype.environmentVariables = $util.emptyObject; + + /** + * Creates a new DebugOptions instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.AnalyzerDefinition.DebugOptions + * @static + * @param {google.cloud.visionai.v1alpha1.AnalyzerDefinition.IDebugOptions=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.AnalyzerDefinition.DebugOptions} DebugOptions instance + */ + DebugOptions.create = function create(properties) { + return new DebugOptions(properties); + }; + + /** + * Encodes the specified DebugOptions message. Does not implicitly {@link google.cloud.visionai.v1alpha1.AnalyzerDefinition.DebugOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.AnalyzerDefinition.DebugOptions + * @static + * @param {google.cloud.visionai.v1alpha1.AnalyzerDefinition.IDebugOptions} message DebugOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DebugOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.environmentVariables != null && Object.hasOwnProperty.call(message, "environmentVariables")) + for (var keys = Object.keys(message.environmentVariables), i = 0; i < keys.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.environmentVariables[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified DebugOptions message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.AnalyzerDefinition.DebugOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.AnalyzerDefinition.DebugOptions + * @static + * @param {google.cloud.visionai.v1alpha1.AnalyzerDefinition.IDebugOptions} message DebugOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DebugOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DebugOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.AnalyzerDefinition.DebugOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.AnalyzerDefinition.DebugOptions} DebugOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DebugOptions.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.AnalyzerDefinition.DebugOptions(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (message.environmentVariables === $util.emptyObject) + message.environmentVariables = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.environmentVariables, key); + message.environmentVariables[key] = value; + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DebugOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.AnalyzerDefinition.DebugOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.AnalyzerDefinition.DebugOptions} DebugOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DebugOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DebugOptions message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.AnalyzerDefinition.DebugOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DebugOptions.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.environmentVariables != null && message.hasOwnProperty("environmentVariables")) { + if (!$util.isObject(message.environmentVariables)) + return "environmentVariables: object expected"; + var key = Object.keys(message.environmentVariables); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.environmentVariables[key[i]])) + return "environmentVariables: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a DebugOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.AnalyzerDefinition.DebugOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.AnalyzerDefinition.DebugOptions} DebugOptions + */ + DebugOptions.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.AnalyzerDefinition.DebugOptions) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.AnalyzerDefinition.DebugOptions(); + if (object.environmentVariables) { + if (typeof object.environmentVariables !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.AnalyzerDefinition.DebugOptions.environmentVariables: object expected"); + message.environmentVariables = {}; + for (var keys = Object.keys(object.environmentVariables), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.environmentVariables, keys[i]); + message.environmentVariables[keys[i]] = String(object.environmentVariables[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a DebugOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.AnalyzerDefinition.DebugOptions + * @static + * @param {google.cloud.visionai.v1alpha1.AnalyzerDefinition.DebugOptions} message DebugOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DebugOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.environmentVariables = {}; + var keys2; + if (message.environmentVariables && (keys2 = Object.keys(message.environmentVariables)).length) { + object.environmentVariables = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.environmentVariables, keys2[j]); + object.environmentVariables[keys2[j]] = message.environmentVariables[keys2[j]]; + } + } + return object; + }; + + /** + * Converts this DebugOptions to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.AnalyzerDefinition.DebugOptions + * @instance + * @returns {Object.} JSON object + */ + DebugOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DebugOptions + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.AnalyzerDefinition.DebugOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DebugOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.AnalyzerDefinition.DebugOptions"; + }; + + return DebugOptions; + })(); + + return AnalyzerDefinition; + })(); + + v1alpha1.AnalysisDefinition = (function() { + + /** + * Properties of an AnalysisDefinition. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IAnalysisDefinition + * @property {Array.|null} [analyzers] AnalysisDefinition analyzers + */ + + /** + * Constructs a new AnalysisDefinition. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents an AnalysisDefinition. + * @implements IAnalysisDefinition + * @constructor + * @param {google.cloud.visionai.v1alpha1.IAnalysisDefinition=} [properties] Properties to set + */ + function AnalysisDefinition(properties) { + this.analyzers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnalysisDefinition analyzers. + * @member {Array.} analyzers + * @memberof google.cloud.visionai.v1alpha1.AnalysisDefinition + * @instance + */ + AnalysisDefinition.prototype.analyzers = $util.emptyArray; + + /** + * Creates a new AnalysisDefinition instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.AnalysisDefinition + * @static + * @param {google.cloud.visionai.v1alpha1.IAnalysisDefinition=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.AnalysisDefinition} AnalysisDefinition instance + */ + AnalysisDefinition.create = function create(properties) { + return new AnalysisDefinition(properties); + }; + + /** + * Encodes the specified AnalysisDefinition message. Does not implicitly {@link google.cloud.visionai.v1alpha1.AnalysisDefinition.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.AnalysisDefinition + * @static + * @param {google.cloud.visionai.v1alpha1.IAnalysisDefinition} message AnalysisDefinition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalysisDefinition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.analyzers != null && message.analyzers.length) + for (var i = 0; i < message.analyzers.length; ++i) + $root.google.cloud.visionai.v1alpha1.AnalyzerDefinition.encode(message.analyzers[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnalysisDefinition message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.AnalysisDefinition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.AnalysisDefinition + * @static + * @param {google.cloud.visionai.v1alpha1.IAnalysisDefinition} message AnalysisDefinition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalysisDefinition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnalysisDefinition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.AnalysisDefinition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.AnalysisDefinition} AnalysisDefinition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalysisDefinition.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.AnalysisDefinition(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.analyzers && message.analyzers.length)) + message.analyzers = []; + message.analyzers.push($root.google.cloud.visionai.v1alpha1.AnalyzerDefinition.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an AnalysisDefinition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.AnalysisDefinition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.AnalysisDefinition} AnalysisDefinition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalysisDefinition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnalysisDefinition message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.AnalysisDefinition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnalysisDefinition.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.analyzers != null && message.hasOwnProperty("analyzers")) { + if (!Array.isArray(message.analyzers)) + return "analyzers: array expected"; + for (var i = 0; i < message.analyzers.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.AnalyzerDefinition.verify(message.analyzers[i], long + 1); + if (error) + return "analyzers." + error; + } + } + return null; + }; + + /** + * Creates an AnalysisDefinition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.AnalysisDefinition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.AnalysisDefinition} AnalysisDefinition + */ + AnalysisDefinition.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.AnalysisDefinition) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.AnalysisDefinition(); + if (object.analyzers) { + if (!Array.isArray(object.analyzers)) + throw TypeError(".google.cloud.visionai.v1alpha1.AnalysisDefinition.analyzers: array expected"); + message.analyzers = []; + for (var i = 0; i < object.analyzers.length; ++i) { + if (typeof object.analyzers[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.AnalysisDefinition.analyzers: object expected"); + message.analyzers[i] = $root.google.cloud.visionai.v1alpha1.AnalyzerDefinition.fromObject(object.analyzers[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from an AnalysisDefinition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.AnalysisDefinition + * @static + * @param {google.cloud.visionai.v1alpha1.AnalysisDefinition} message AnalysisDefinition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnalysisDefinition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.analyzers = []; + if (message.analyzers && message.analyzers.length) { + object.analyzers = []; + for (var j = 0; j < message.analyzers.length; ++j) + object.analyzers[j] = $root.google.cloud.visionai.v1alpha1.AnalyzerDefinition.toObject(message.analyzers[j], options); + } + return object; + }; + + /** + * Converts this AnalysisDefinition to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.AnalysisDefinition + * @instance + * @returns {Object.} JSON object + */ + AnalysisDefinition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnalysisDefinition + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.AnalysisDefinition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnalysisDefinition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.AnalysisDefinition"; + }; + + return AnalysisDefinition; + })(); + + v1alpha1.Analysis = (function() { + + /** + * Properties of an Analysis. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IAnalysis + * @property {string|null} [name] Analysis name + * @property {google.protobuf.ITimestamp|null} [createTime] Analysis createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Analysis updateTime + * @property {Object.|null} [labels] Analysis labels + * @property {google.cloud.visionai.v1alpha1.IAnalysisDefinition|null} [analysisDefinition] Analysis analysisDefinition + * @property {Object.|null} [inputStreamsMapping] Analysis inputStreamsMapping + * @property {Object.|null} [outputStreamsMapping] Analysis outputStreamsMapping + */ + + /** + * Constructs a new Analysis. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents an Analysis. + * @implements IAnalysis + * @constructor + * @param {google.cloud.visionai.v1alpha1.IAnalysis=} [properties] Properties to set + */ + function Analysis(properties) { + this.labels = {}; + this.inputStreamsMapping = {}; + this.outputStreamsMapping = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Analysis name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.Analysis + * @instance + */ + Analysis.prototype.name = ""; + + /** + * Analysis createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.visionai.v1alpha1.Analysis + * @instance + */ + Analysis.prototype.createTime = null; + + /** + * Analysis updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.visionai.v1alpha1.Analysis + * @instance + */ + Analysis.prototype.updateTime = null; + + /** + * Analysis labels. + * @member {Object.} labels + * @memberof google.cloud.visionai.v1alpha1.Analysis + * @instance + */ + Analysis.prototype.labels = $util.emptyObject; + + /** + * Analysis analysisDefinition. + * @member {google.cloud.visionai.v1alpha1.IAnalysisDefinition|null|undefined} analysisDefinition + * @memberof google.cloud.visionai.v1alpha1.Analysis + * @instance + */ + Analysis.prototype.analysisDefinition = null; + + /** + * Analysis inputStreamsMapping. + * @member {Object.} inputStreamsMapping + * @memberof google.cloud.visionai.v1alpha1.Analysis + * @instance + */ + Analysis.prototype.inputStreamsMapping = $util.emptyObject; + + /** + * Analysis outputStreamsMapping. + * @member {Object.} outputStreamsMapping + * @memberof google.cloud.visionai.v1alpha1.Analysis + * @instance + */ + Analysis.prototype.outputStreamsMapping = $util.emptyObject; + + /** + * Creates a new Analysis instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.Analysis + * @static + * @param {google.cloud.visionai.v1alpha1.IAnalysis=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.Analysis} Analysis instance + */ + Analysis.create = function create(properties) { + return new Analysis(properties); + }; + + /** + * Encodes the specified Analysis message. Does not implicitly {@link google.cloud.visionai.v1alpha1.Analysis.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.Analysis + * @static + * @param {google.cloud.visionai.v1alpha1.IAnalysis} message Analysis message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Analysis.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.analysisDefinition != null && Object.hasOwnProperty.call(message, "analysisDefinition")) + $root.google.cloud.visionai.v1alpha1.AnalysisDefinition.encode(message.analysisDefinition, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.inputStreamsMapping != null && Object.hasOwnProperty.call(message, "inputStreamsMapping")) + for (var keys = Object.keys(message.inputStreamsMapping), i = 0; i < keys.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.inputStreamsMapping[keys[i]]).ldelim(); + if (message.outputStreamsMapping != null && Object.hasOwnProperty.call(message, "outputStreamsMapping")) + for (var keys = Object.keys(message.outputStreamsMapping), i = 0; i < keys.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.outputStreamsMapping[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified Analysis message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.Analysis.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.Analysis + * @static + * @param {google.cloud.visionai.v1alpha1.IAnalysis} message Analysis message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Analysis.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Analysis message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.Analysis + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.Analysis} Analysis + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Analysis.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.Analysis(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.labels, key); + message.labels[key] = value; + break; + } + case 5: { + message.analysisDefinition = $root.google.cloud.visionai.v1alpha1.AnalysisDefinition.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + if (message.inputStreamsMapping === $util.emptyObject) + message.inputStreamsMapping = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.inputStreamsMapping, key); + message.inputStreamsMapping[key] = value; + break; + } + case 7: { + if (message.outputStreamsMapping === $util.emptyObject) + message.outputStreamsMapping = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.outputStreamsMapping, key); + message.outputStreamsMapping[key] = value; + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an Analysis message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.Analysis + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.Analysis} Analysis + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Analysis.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Analysis message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.Analysis + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Analysis.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime, long + 1); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime, long + 1); + if (error) + return "updateTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.analysisDefinition != null && message.hasOwnProperty("analysisDefinition")) { + var error = $root.google.cloud.visionai.v1alpha1.AnalysisDefinition.verify(message.analysisDefinition, long + 1); + if (error) + return "analysisDefinition." + error; + } + if (message.inputStreamsMapping != null && message.hasOwnProperty("inputStreamsMapping")) { + if (!$util.isObject(message.inputStreamsMapping)) + return "inputStreamsMapping: object expected"; + var key = Object.keys(message.inputStreamsMapping); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.inputStreamsMapping[key[i]])) + return "inputStreamsMapping: string{k:string} expected"; + } + if (message.outputStreamsMapping != null && message.hasOwnProperty("outputStreamsMapping")) { + if (!$util.isObject(message.outputStreamsMapping)) + return "outputStreamsMapping: object expected"; + var key = Object.keys(message.outputStreamsMapping); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.outputStreamsMapping[key[i]])) + return "outputStreamsMapping: string{k:string} expected"; + } + return null; + }; + + /** + * Creates an Analysis message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.Analysis + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.Analysis} Analysis + */ + Analysis.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.Analysis) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.Analysis(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Analysis.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime, long + 1); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Analysis.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime, long + 1); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Analysis.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.labels, keys[i]); + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + } + if (object.analysisDefinition != null) { + if (typeof object.analysisDefinition !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Analysis.analysisDefinition: object expected"); + message.analysisDefinition = $root.google.cloud.visionai.v1alpha1.AnalysisDefinition.fromObject(object.analysisDefinition, long + 1); + } + if (object.inputStreamsMapping) { + if (typeof object.inputStreamsMapping !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Analysis.inputStreamsMapping: object expected"); + message.inputStreamsMapping = {}; + for (var keys = Object.keys(object.inputStreamsMapping), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.inputStreamsMapping, keys[i]); + message.inputStreamsMapping[keys[i]] = String(object.inputStreamsMapping[keys[i]]); + } + } + if (object.outputStreamsMapping) { + if (typeof object.outputStreamsMapping !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Analysis.outputStreamsMapping: object expected"); + message.outputStreamsMapping = {}; + for (var keys = Object.keys(object.outputStreamsMapping), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.outputStreamsMapping, keys[i]); + message.outputStreamsMapping[keys[i]] = String(object.outputStreamsMapping[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from an Analysis message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.Analysis + * @static + * @param {google.cloud.visionai.v1alpha1.Analysis} message Analysis + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Analysis.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.labels = {}; + object.inputStreamsMapping = {}; + object.outputStreamsMapping = {}; + } + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.analysisDefinition = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.labels, keys2[j]); + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + } + if (message.analysisDefinition != null && message.hasOwnProperty("analysisDefinition")) + object.analysisDefinition = $root.google.cloud.visionai.v1alpha1.AnalysisDefinition.toObject(message.analysisDefinition, options); + if (message.inputStreamsMapping && (keys2 = Object.keys(message.inputStreamsMapping)).length) { + object.inputStreamsMapping = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.inputStreamsMapping, keys2[j]); + object.inputStreamsMapping[keys2[j]] = message.inputStreamsMapping[keys2[j]]; + } + } + if (message.outputStreamsMapping && (keys2 = Object.keys(message.outputStreamsMapping)).length) { + object.outputStreamsMapping = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.outputStreamsMapping, keys2[j]); + object.outputStreamsMapping[keys2[j]] = message.outputStreamsMapping[keys2[j]]; + } + } + return object; + }; + + /** + * Converts this Analysis to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.Analysis + * @instance + * @returns {Object.} JSON object + */ + Analysis.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Analysis + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.Analysis + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Analysis.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.Analysis"; + }; + + return Analysis; + })(); + + v1alpha1.LiveVideoAnalytics = (function() { + + /** + * Constructs a new LiveVideoAnalytics service. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a LiveVideoAnalytics + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function LiveVideoAnalytics(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (LiveVideoAnalytics.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = LiveVideoAnalytics; + + /** + * Creates new LiveVideoAnalytics service using the specified rpc implementation. + * @function create + * @memberof google.cloud.visionai.v1alpha1.LiveVideoAnalytics + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {LiveVideoAnalytics} RPC service. Useful where requests and/or responses are streamed. + */ + LiveVideoAnalytics.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.LiveVideoAnalytics|listAnalyses}. + * @memberof google.cloud.visionai.v1alpha1.LiveVideoAnalytics + * @typedef ListAnalysesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.visionai.v1alpha1.ListAnalysesResponse} [response] ListAnalysesResponse + */ + + /** + * Calls ListAnalyses. + * @function listAnalyses + * @memberof google.cloud.visionai.v1alpha1.LiveVideoAnalytics + * @instance + * @param {google.cloud.visionai.v1alpha1.IListAnalysesRequest} request ListAnalysesRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.LiveVideoAnalytics.ListAnalysesCallback} callback Node-style callback called with the error, if any, and ListAnalysesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LiveVideoAnalytics.prototype.listAnalyses = function listAnalyses(request, callback) { + return this.rpcCall(listAnalyses, $root.google.cloud.visionai.v1alpha1.ListAnalysesRequest, $root.google.cloud.visionai.v1alpha1.ListAnalysesResponse, request, callback); + }, "name", { value: "ListAnalyses" }); + + /** + * Calls ListAnalyses. + * @function listAnalyses + * @memberof google.cloud.visionai.v1alpha1.LiveVideoAnalytics + * @instance + * @param {google.cloud.visionai.v1alpha1.IListAnalysesRequest} request ListAnalysesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.LiveVideoAnalytics|getAnalysis}. + * @memberof google.cloud.visionai.v1alpha1.LiveVideoAnalytics + * @typedef GetAnalysisCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.visionai.v1alpha1.Analysis} [response] Analysis + */ + + /** + * Calls GetAnalysis. + * @function getAnalysis + * @memberof google.cloud.visionai.v1alpha1.LiveVideoAnalytics + * @instance + * @param {google.cloud.visionai.v1alpha1.IGetAnalysisRequest} request GetAnalysisRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.LiveVideoAnalytics.GetAnalysisCallback} callback Node-style callback called with the error, if any, and Analysis + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LiveVideoAnalytics.prototype.getAnalysis = function getAnalysis(request, callback) { + return this.rpcCall(getAnalysis, $root.google.cloud.visionai.v1alpha1.GetAnalysisRequest, $root.google.cloud.visionai.v1alpha1.Analysis, request, callback); + }, "name", { value: "GetAnalysis" }); + + /** + * Calls GetAnalysis. + * @function getAnalysis + * @memberof google.cloud.visionai.v1alpha1.LiveVideoAnalytics + * @instance + * @param {google.cloud.visionai.v1alpha1.IGetAnalysisRequest} request GetAnalysisRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.LiveVideoAnalytics|createAnalysis}. + * @memberof google.cloud.visionai.v1alpha1.LiveVideoAnalytics + * @typedef CreateAnalysisCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateAnalysis. + * @function createAnalysis + * @memberof google.cloud.visionai.v1alpha1.LiveVideoAnalytics + * @instance + * @param {google.cloud.visionai.v1alpha1.ICreateAnalysisRequest} request CreateAnalysisRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.LiveVideoAnalytics.CreateAnalysisCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LiveVideoAnalytics.prototype.createAnalysis = function createAnalysis(request, callback) { + return this.rpcCall(createAnalysis, $root.google.cloud.visionai.v1alpha1.CreateAnalysisRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateAnalysis" }); + + /** + * Calls CreateAnalysis. + * @function createAnalysis + * @memberof google.cloud.visionai.v1alpha1.LiveVideoAnalytics + * @instance + * @param {google.cloud.visionai.v1alpha1.ICreateAnalysisRequest} request CreateAnalysisRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.LiveVideoAnalytics|updateAnalysis}. + * @memberof google.cloud.visionai.v1alpha1.LiveVideoAnalytics + * @typedef UpdateAnalysisCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateAnalysis. + * @function updateAnalysis + * @memberof google.cloud.visionai.v1alpha1.LiveVideoAnalytics + * @instance + * @param {google.cloud.visionai.v1alpha1.IUpdateAnalysisRequest} request UpdateAnalysisRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.LiveVideoAnalytics.UpdateAnalysisCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LiveVideoAnalytics.prototype.updateAnalysis = function updateAnalysis(request, callback) { + return this.rpcCall(updateAnalysis, $root.google.cloud.visionai.v1alpha1.UpdateAnalysisRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateAnalysis" }); + + /** + * Calls UpdateAnalysis. + * @function updateAnalysis + * @memberof google.cloud.visionai.v1alpha1.LiveVideoAnalytics + * @instance + * @param {google.cloud.visionai.v1alpha1.IUpdateAnalysisRequest} request UpdateAnalysisRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.LiveVideoAnalytics|deleteAnalysis}. + * @memberof google.cloud.visionai.v1alpha1.LiveVideoAnalytics + * @typedef DeleteAnalysisCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteAnalysis. + * @function deleteAnalysis + * @memberof google.cloud.visionai.v1alpha1.LiveVideoAnalytics + * @instance + * @param {google.cloud.visionai.v1alpha1.IDeleteAnalysisRequest} request DeleteAnalysisRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.LiveVideoAnalytics.DeleteAnalysisCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LiveVideoAnalytics.prototype.deleteAnalysis = function deleteAnalysis(request, callback) { + return this.rpcCall(deleteAnalysis, $root.google.cloud.visionai.v1alpha1.DeleteAnalysisRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteAnalysis" }); + + /** + * Calls DeleteAnalysis. + * @function deleteAnalysis + * @memberof google.cloud.visionai.v1alpha1.LiveVideoAnalytics + * @instance + * @param {google.cloud.visionai.v1alpha1.IDeleteAnalysisRequest} request DeleteAnalysisRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return LiveVideoAnalytics; + })(); + + v1alpha1.ListAnalysesRequest = (function() { + + /** + * Properties of a ListAnalysesRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IListAnalysesRequest + * @property {string|null} [parent] ListAnalysesRequest parent + * @property {number|null} [pageSize] ListAnalysesRequest pageSize + * @property {string|null} [pageToken] ListAnalysesRequest pageToken + * @property {string|null} [filter] ListAnalysesRequest filter + * @property {string|null} [orderBy] ListAnalysesRequest orderBy + */ + + /** + * Constructs a new ListAnalysesRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a ListAnalysesRequest. + * @implements IListAnalysesRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IListAnalysesRequest=} [properties] Properties to set + */ + function ListAnalysesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAnalysesRequest parent. + * @member {string} parent + * @memberof google.cloud.visionai.v1alpha1.ListAnalysesRequest + * @instance + */ + ListAnalysesRequest.prototype.parent = ""; + + /** + * ListAnalysesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.visionai.v1alpha1.ListAnalysesRequest + * @instance + */ + ListAnalysesRequest.prototype.pageSize = 0; + + /** + * ListAnalysesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.visionai.v1alpha1.ListAnalysesRequest + * @instance + */ + ListAnalysesRequest.prototype.pageToken = ""; + + /** + * ListAnalysesRequest filter. + * @member {string} filter + * @memberof google.cloud.visionai.v1alpha1.ListAnalysesRequest + * @instance + */ + ListAnalysesRequest.prototype.filter = ""; + + /** + * ListAnalysesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.visionai.v1alpha1.ListAnalysesRequest + * @instance + */ + ListAnalysesRequest.prototype.orderBy = ""; + + /** + * Creates a new ListAnalysesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ListAnalysesRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IListAnalysesRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ListAnalysesRequest} ListAnalysesRequest instance + */ + ListAnalysesRequest.create = function create(properties) { + return new ListAnalysesRequest(properties); + }; + + /** + * Encodes the specified ListAnalysesRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListAnalysesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ListAnalysesRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IListAnalysesRequest} message ListAnalysesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAnalysesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListAnalysesRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListAnalysesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListAnalysesRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IListAnalysesRequest} message ListAnalysesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAnalysesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAnalysesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ListAnalysesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ListAnalysesRequest} ListAnalysesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAnalysesRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ListAnalysesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListAnalysesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListAnalysesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ListAnalysesRequest} ListAnalysesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAnalysesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAnalysesRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ListAnalysesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAnalysesRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListAnalysesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ListAnalysesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ListAnalysesRequest} ListAnalysesRequest + */ + ListAnalysesRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ListAnalysesRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ListAnalysesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListAnalysesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ListAnalysesRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ListAnalysesRequest} message ListAnalysesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAnalysesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListAnalysesRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ListAnalysesRequest + * @instance + * @returns {Object.} JSON object + */ + ListAnalysesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAnalysesRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ListAnalysesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAnalysesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ListAnalysesRequest"; + }; + + return ListAnalysesRequest; + })(); + + v1alpha1.ListAnalysesResponse = (function() { + + /** + * Properties of a ListAnalysesResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IListAnalysesResponse + * @property {Array.|null} [analyses] ListAnalysesResponse analyses + * @property {string|null} [nextPageToken] ListAnalysesResponse nextPageToken + * @property {Array.|null} [unreachable] ListAnalysesResponse unreachable + */ + + /** + * Constructs a new ListAnalysesResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a ListAnalysesResponse. + * @implements IListAnalysesResponse + * @constructor + * @param {google.cloud.visionai.v1alpha1.IListAnalysesResponse=} [properties] Properties to set + */ + function ListAnalysesResponse(properties) { + this.analyses = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAnalysesResponse analyses. + * @member {Array.} analyses + * @memberof google.cloud.visionai.v1alpha1.ListAnalysesResponse + * @instance + */ + ListAnalysesResponse.prototype.analyses = $util.emptyArray; + + /** + * ListAnalysesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.visionai.v1alpha1.ListAnalysesResponse + * @instance + */ + ListAnalysesResponse.prototype.nextPageToken = ""; + + /** + * ListAnalysesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.visionai.v1alpha1.ListAnalysesResponse + * @instance + */ + ListAnalysesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListAnalysesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ListAnalysesResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IListAnalysesResponse=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ListAnalysesResponse} ListAnalysesResponse instance + */ + ListAnalysesResponse.create = function create(properties) { + return new ListAnalysesResponse(properties); + }; + + /** + * Encodes the specified ListAnalysesResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListAnalysesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ListAnalysesResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IListAnalysesResponse} message ListAnalysesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAnalysesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.analyses != null && message.analyses.length) + for (var i = 0; i < message.analyses.length; ++i) + $root.google.cloud.visionai.v1alpha1.Analysis.encode(message.analyses[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListAnalysesResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListAnalysesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListAnalysesResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IListAnalysesResponse} message ListAnalysesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAnalysesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAnalysesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ListAnalysesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ListAnalysesResponse} ListAnalysesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAnalysesResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ListAnalysesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.analyses && message.analyses.length)) + message.analyses = []; + message.analyses.push($root.google.cloud.visionai.v1alpha1.Analysis.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListAnalysesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListAnalysesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ListAnalysesResponse} ListAnalysesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAnalysesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAnalysesResponse message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ListAnalysesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAnalysesResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.analyses != null && message.hasOwnProperty("analyses")) { + if (!Array.isArray(message.analyses)) + return "analyses: array expected"; + for (var i = 0; i < message.analyses.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.Analysis.verify(message.analyses[i], long + 1); + if (error) + return "analyses." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListAnalysesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ListAnalysesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ListAnalysesResponse} ListAnalysesResponse + */ + ListAnalysesResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ListAnalysesResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ListAnalysesResponse(); + if (object.analyses) { + if (!Array.isArray(object.analyses)) + throw TypeError(".google.cloud.visionai.v1alpha1.ListAnalysesResponse.analyses: array expected"); + message.analyses = []; + for (var i = 0; i < object.analyses.length; ++i) { + if (typeof object.analyses[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ListAnalysesResponse.analyses: object expected"); + message.analyses[i] = $root.google.cloud.visionai.v1alpha1.Analysis.fromObject(object.analyses[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.visionai.v1alpha1.ListAnalysesResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListAnalysesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ListAnalysesResponse + * @static + * @param {google.cloud.visionai.v1alpha1.ListAnalysesResponse} message ListAnalysesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAnalysesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.analyses = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.analyses && message.analyses.length) { + object.analyses = []; + for (var j = 0; j < message.analyses.length; ++j) + object.analyses[j] = $root.google.cloud.visionai.v1alpha1.Analysis.toObject(message.analyses[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListAnalysesResponse to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ListAnalysesResponse + * @instance + * @returns {Object.} JSON object + */ + ListAnalysesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAnalysesResponse + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ListAnalysesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAnalysesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ListAnalysesResponse"; + }; + + return ListAnalysesResponse; + })(); + + v1alpha1.GetAnalysisRequest = (function() { + + /** + * Properties of a GetAnalysisRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IGetAnalysisRequest + * @property {string|null} [name] GetAnalysisRequest name + */ + + /** + * Constructs a new GetAnalysisRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a GetAnalysisRequest. + * @implements IGetAnalysisRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IGetAnalysisRequest=} [properties] Properties to set + */ + function GetAnalysisRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetAnalysisRequest name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.GetAnalysisRequest + * @instance + */ + GetAnalysisRequest.prototype.name = ""; + + /** + * Creates a new GetAnalysisRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.GetAnalysisRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IGetAnalysisRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.GetAnalysisRequest} GetAnalysisRequest instance + */ + GetAnalysisRequest.create = function create(properties) { + return new GetAnalysisRequest(properties); + }; + + /** + * Encodes the specified GetAnalysisRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetAnalysisRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.GetAnalysisRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IGetAnalysisRequest} message GetAnalysisRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAnalysisRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetAnalysisRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetAnalysisRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.GetAnalysisRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IGetAnalysisRequest} message GetAnalysisRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAnalysisRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetAnalysisRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.GetAnalysisRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.GetAnalysisRequest} GetAnalysisRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAnalysisRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.GetAnalysisRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetAnalysisRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.GetAnalysisRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.GetAnalysisRequest} GetAnalysisRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAnalysisRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetAnalysisRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.GetAnalysisRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetAnalysisRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetAnalysisRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.GetAnalysisRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.GetAnalysisRequest} GetAnalysisRequest + */ + GetAnalysisRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.GetAnalysisRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.GetAnalysisRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetAnalysisRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.GetAnalysisRequest + * @static + * @param {google.cloud.visionai.v1alpha1.GetAnalysisRequest} message GetAnalysisRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetAnalysisRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetAnalysisRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.GetAnalysisRequest + * @instance + * @returns {Object.} JSON object + */ + GetAnalysisRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetAnalysisRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.GetAnalysisRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetAnalysisRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.GetAnalysisRequest"; + }; + + return GetAnalysisRequest; + })(); + + v1alpha1.CreateAnalysisRequest = (function() { + + /** + * Properties of a CreateAnalysisRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface ICreateAnalysisRequest + * @property {string|null} [parent] CreateAnalysisRequest parent + * @property {string|null} [analysisId] CreateAnalysisRequest analysisId + * @property {google.cloud.visionai.v1alpha1.IAnalysis|null} [analysis] CreateAnalysisRequest analysis + * @property {string|null} [requestId] CreateAnalysisRequest requestId + */ + + /** + * Constructs a new CreateAnalysisRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a CreateAnalysisRequest. + * @implements ICreateAnalysisRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.ICreateAnalysisRequest=} [properties] Properties to set + */ + function CreateAnalysisRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateAnalysisRequest parent. + * @member {string} parent + * @memberof google.cloud.visionai.v1alpha1.CreateAnalysisRequest + * @instance + */ + CreateAnalysisRequest.prototype.parent = ""; + + /** + * CreateAnalysisRequest analysisId. + * @member {string} analysisId + * @memberof google.cloud.visionai.v1alpha1.CreateAnalysisRequest + * @instance + */ + CreateAnalysisRequest.prototype.analysisId = ""; + + /** + * CreateAnalysisRequest analysis. + * @member {google.cloud.visionai.v1alpha1.IAnalysis|null|undefined} analysis + * @memberof google.cloud.visionai.v1alpha1.CreateAnalysisRequest + * @instance + */ + CreateAnalysisRequest.prototype.analysis = null; + + /** + * CreateAnalysisRequest requestId. + * @member {string} requestId + * @memberof google.cloud.visionai.v1alpha1.CreateAnalysisRequest + * @instance + */ + CreateAnalysisRequest.prototype.requestId = ""; + + /** + * Creates a new CreateAnalysisRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.CreateAnalysisRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ICreateAnalysisRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.CreateAnalysisRequest} CreateAnalysisRequest instance + */ + CreateAnalysisRequest.create = function create(properties) { + return new CreateAnalysisRequest(properties); + }; + + /** + * Encodes the specified CreateAnalysisRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateAnalysisRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.CreateAnalysisRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ICreateAnalysisRequest} message CreateAnalysisRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAnalysisRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.analysisId != null && Object.hasOwnProperty.call(message, "analysisId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.analysisId); + if (message.analysis != null && Object.hasOwnProperty.call(message, "analysis")) + $root.google.cloud.visionai.v1alpha1.Analysis.encode(message.analysis, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateAnalysisRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateAnalysisRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.CreateAnalysisRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ICreateAnalysisRequest} message CreateAnalysisRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAnalysisRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateAnalysisRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.CreateAnalysisRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.CreateAnalysisRequest} CreateAnalysisRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAnalysisRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.CreateAnalysisRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.analysisId = reader.string(); + break; + } + case 3: { + message.analysis = $root.google.cloud.visionai.v1alpha1.Analysis.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreateAnalysisRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.CreateAnalysisRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.CreateAnalysisRequest} CreateAnalysisRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAnalysisRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateAnalysisRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.CreateAnalysisRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateAnalysisRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.analysisId != null && message.hasOwnProperty("analysisId")) + if (!$util.isString(message.analysisId)) + return "analysisId: string expected"; + if (message.analysis != null && message.hasOwnProperty("analysis")) { + var error = $root.google.cloud.visionai.v1alpha1.Analysis.verify(message.analysis, long + 1); + if (error) + return "analysis." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateAnalysisRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.CreateAnalysisRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.CreateAnalysisRequest} CreateAnalysisRequest + */ + CreateAnalysisRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.CreateAnalysisRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.CreateAnalysisRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.analysisId != null) + message.analysisId = String(object.analysisId); + if (object.analysis != null) { + if (typeof object.analysis !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.CreateAnalysisRequest.analysis: object expected"); + message.analysis = $root.google.cloud.visionai.v1alpha1.Analysis.fromObject(object.analysis, long + 1); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateAnalysisRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.CreateAnalysisRequest + * @static + * @param {google.cloud.visionai.v1alpha1.CreateAnalysisRequest} message CreateAnalysisRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateAnalysisRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.analysisId = ""; + object.analysis = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.analysisId != null && message.hasOwnProperty("analysisId")) + object.analysisId = message.analysisId; + if (message.analysis != null && message.hasOwnProperty("analysis")) + object.analysis = $root.google.cloud.visionai.v1alpha1.Analysis.toObject(message.analysis, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateAnalysisRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.CreateAnalysisRequest + * @instance + * @returns {Object.} JSON object + */ + CreateAnalysisRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateAnalysisRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.CreateAnalysisRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateAnalysisRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.CreateAnalysisRequest"; + }; + + return CreateAnalysisRequest; + })(); + + v1alpha1.UpdateAnalysisRequest = (function() { + + /** + * Properties of an UpdateAnalysisRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IUpdateAnalysisRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateAnalysisRequest updateMask + * @property {google.cloud.visionai.v1alpha1.IAnalysis|null} [analysis] UpdateAnalysisRequest analysis + * @property {string|null} [requestId] UpdateAnalysisRequest requestId + */ + + /** + * Constructs a new UpdateAnalysisRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents an UpdateAnalysisRequest. + * @implements IUpdateAnalysisRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IUpdateAnalysisRequest=} [properties] Properties to set + */ + function UpdateAnalysisRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateAnalysisRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.visionai.v1alpha1.UpdateAnalysisRequest + * @instance + */ + UpdateAnalysisRequest.prototype.updateMask = null; + + /** + * UpdateAnalysisRequest analysis. + * @member {google.cloud.visionai.v1alpha1.IAnalysis|null|undefined} analysis + * @memberof google.cloud.visionai.v1alpha1.UpdateAnalysisRequest + * @instance + */ + UpdateAnalysisRequest.prototype.analysis = null; + + /** + * UpdateAnalysisRequest requestId. + * @member {string} requestId + * @memberof google.cloud.visionai.v1alpha1.UpdateAnalysisRequest + * @instance + */ + UpdateAnalysisRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateAnalysisRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.UpdateAnalysisRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IUpdateAnalysisRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.UpdateAnalysisRequest} UpdateAnalysisRequest instance + */ + UpdateAnalysisRequest.create = function create(properties) { + return new UpdateAnalysisRequest(properties); + }; + + /** + * Encodes the specified UpdateAnalysisRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateAnalysisRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.UpdateAnalysisRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IUpdateAnalysisRequest} message UpdateAnalysisRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAnalysisRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.analysis != null && Object.hasOwnProperty.call(message, "analysis")) + $root.google.cloud.visionai.v1alpha1.Analysis.encode(message.analysis, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified UpdateAnalysisRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateAnalysisRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.UpdateAnalysisRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IUpdateAnalysisRequest} message UpdateAnalysisRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAnalysisRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateAnalysisRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.UpdateAnalysisRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.UpdateAnalysisRequest} UpdateAnalysisRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAnalysisRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.UpdateAnalysisRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.analysis = $root.google.cloud.visionai.v1alpha1.Analysis.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateAnalysisRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.UpdateAnalysisRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.UpdateAnalysisRequest} UpdateAnalysisRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAnalysisRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateAnalysisRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.UpdateAnalysisRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateAnalysisRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + if (message.analysis != null && message.hasOwnProperty("analysis")) { + var error = $root.google.cloud.visionai.v1alpha1.Analysis.verify(message.analysis, long + 1); + if (error) + return "analysis." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an UpdateAnalysisRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.UpdateAnalysisRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.UpdateAnalysisRequest} UpdateAnalysisRequest + */ + UpdateAnalysisRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.UpdateAnalysisRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.UpdateAnalysisRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.UpdateAnalysisRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + if (object.analysis != null) { + if (typeof object.analysis !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.UpdateAnalysisRequest.analysis: object expected"); + message.analysis = $root.google.cloud.visionai.v1alpha1.Analysis.fromObject(object.analysis, long + 1); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateAnalysisRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.UpdateAnalysisRequest + * @static + * @param {google.cloud.visionai.v1alpha1.UpdateAnalysisRequest} message UpdateAnalysisRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateAnalysisRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.analysis = null; + object.requestId = ""; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.analysis != null && message.hasOwnProperty("analysis")) + object.analysis = $root.google.cloud.visionai.v1alpha1.Analysis.toObject(message.analysis, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UpdateAnalysisRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.UpdateAnalysisRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateAnalysisRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateAnalysisRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.UpdateAnalysisRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateAnalysisRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.UpdateAnalysisRequest"; + }; + + return UpdateAnalysisRequest; + })(); + + v1alpha1.DeleteAnalysisRequest = (function() { + + /** + * Properties of a DeleteAnalysisRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IDeleteAnalysisRequest + * @property {string|null} [name] DeleteAnalysisRequest name + * @property {string|null} [requestId] DeleteAnalysisRequest requestId + */ + + /** + * Constructs a new DeleteAnalysisRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a DeleteAnalysisRequest. + * @implements IDeleteAnalysisRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IDeleteAnalysisRequest=} [properties] Properties to set + */ + function DeleteAnalysisRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteAnalysisRequest name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.DeleteAnalysisRequest + * @instance + */ + DeleteAnalysisRequest.prototype.name = ""; + + /** + * DeleteAnalysisRequest requestId. + * @member {string} requestId + * @memberof google.cloud.visionai.v1alpha1.DeleteAnalysisRequest + * @instance + */ + DeleteAnalysisRequest.prototype.requestId = ""; + + /** + * Creates a new DeleteAnalysisRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.DeleteAnalysisRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IDeleteAnalysisRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.DeleteAnalysisRequest} DeleteAnalysisRequest instance + */ + DeleteAnalysisRequest.create = function create(properties) { + return new DeleteAnalysisRequest(properties); + }; + + /** + * Encodes the specified DeleteAnalysisRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteAnalysisRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.DeleteAnalysisRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IDeleteAnalysisRequest} message DeleteAnalysisRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAnalysisRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified DeleteAnalysisRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteAnalysisRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.DeleteAnalysisRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IDeleteAnalysisRequest} message DeleteAnalysisRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAnalysisRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteAnalysisRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.DeleteAnalysisRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.DeleteAnalysisRequest} DeleteAnalysisRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAnalysisRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.DeleteAnalysisRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteAnalysisRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.DeleteAnalysisRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.DeleteAnalysisRequest} DeleteAnalysisRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAnalysisRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteAnalysisRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.DeleteAnalysisRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteAnalysisRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a DeleteAnalysisRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.DeleteAnalysisRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.DeleteAnalysisRequest} DeleteAnalysisRequest + */ + DeleteAnalysisRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.DeleteAnalysisRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.DeleteAnalysisRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteAnalysisRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.DeleteAnalysisRequest + * @static + * @param {google.cloud.visionai.v1alpha1.DeleteAnalysisRequest} message DeleteAnalysisRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteAnalysisRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this DeleteAnalysisRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.DeleteAnalysisRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteAnalysisRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteAnalysisRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.DeleteAnalysisRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteAnalysisRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.DeleteAnalysisRequest"; + }; + + return DeleteAnalysisRequest; + })(); + + v1alpha1.AppPlatform = (function() { + + /** + * Constructs a new AppPlatform service. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents an AppPlatform + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function AppPlatform(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (AppPlatform.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AppPlatform; + + /** + * Creates new AppPlatform service using the specified rpc implementation. + * @function create + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {AppPlatform} RPC service. Useful where requests and/or responses are streamed. + */ + AppPlatform.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.AppPlatform|listApplications}. + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @typedef ListApplicationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.visionai.v1alpha1.ListApplicationsResponse} [response] ListApplicationsResponse + */ + + /** + * Calls ListApplications. + * @function listApplications + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @instance + * @param {google.cloud.visionai.v1alpha1.IListApplicationsRequest} request ListApplicationsRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.AppPlatform.ListApplicationsCallback} callback Node-style callback called with the error, if any, and ListApplicationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AppPlatform.prototype.listApplications = function listApplications(request, callback) { + return this.rpcCall(listApplications, $root.google.cloud.visionai.v1alpha1.ListApplicationsRequest, $root.google.cloud.visionai.v1alpha1.ListApplicationsResponse, request, callback); + }, "name", { value: "ListApplications" }); + + /** + * Calls ListApplications. + * @function listApplications + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @instance + * @param {google.cloud.visionai.v1alpha1.IListApplicationsRequest} request ListApplicationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.AppPlatform|getApplication}. + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @typedef GetApplicationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.visionai.v1alpha1.Application} [response] Application + */ + + /** + * Calls GetApplication. + * @function getApplication + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @instance + * @param {google.cloud.visionai.v1alpha1.IGetApplicationRequest} request GetApplicationRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.AppPlatform.GetApplicationCallback} callback Node-style callback called with the error, if any, and Application + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AppPlatform.prototype.getApplication = function getApplication(request, callback) { + return this.rpcCall(getApplication, $root.google.cloud.visionai.v1alpha1.GetApplicationRequest, $root.google.cloud.visionai.v1alpha1.Application, request, callback); + }, "name", { value: "GetApplication" }); + + /** + * Calls GetApplication. + * @function getApplication + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @instance + * @param {google.cloud.visionai.v1alpha1.IGetApplicationRequest} request GetApplicationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.AppPlatform|createApplication}. + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @typedef CreateApplicationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateApplication. + * @function createApplication + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @instance + * @param {google.cloud.visionai.v1alpha1.ICreateApplicationRequest} request CreateApplicationRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.AppPlatform.CreateApplicationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AppPlatform.prototype.createApplication = function createApplication(request, callback) { + return this.rpcCall(createApplication, $root.google.cloud.visionai.v1alpha1.CreateApplicationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateApplication" }); + + /** + * Calls CreateApplication. + * @function createApplication + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @instance + * @param {google.cloud.visionai.v1alpha1.ICreateApplicationRequest} request CreateApplicationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.AppPlatform|updateApplication}. + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @typedef UpdateApplicationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateApplication. + * @function updateApplication + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @instance + * @param {google.cloud.visionai.v1alpha1.IUpdateApplicationRequest} request UpdateApplicationRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.AppPlatform.UpdateApplicationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AppPlatform.prototype.updateApplication = function updateApplication(request, callback) { + return this.rpcCall(updateApplication, $root.google.cloud.visionai.v1alpha1.UpdateApplicationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateApplication" }); + + /** + * Calls UpdateApplication. + * @function updateApplication + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @instance + * @param {google.cloud.visionai.v1alpha1.IUpdateApplicationRequest} request UpdateApplicationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.AppPlatform|deleteApplication}. + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @typedef DeleteApplicationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteApplication. + * @function deleteApplication + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @instance + * @param {google.cloud.visionai.v1alpha1.IDeleteApplicationRequest} request DeleteApplicationRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.AppPlatform.DeleteApplicationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AppPlatform.prototype.deleteApplication = function deleteApplication(request, callback) { + return this.rpcCall(deleteApplication, $root.google.cloud.visionai.v1alpha1.DeleteApplicationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteApplication" }); + + /** + * Calls DeleteApplication. + * @function deleteApplication + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @instance + * @param {google.cloud.visionai.v1alpha1.IDeleteApplicationRequest} request DeleteApplicationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.AppPlatform|deployApplication}. + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @typedef DeployApplicationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeployApplication. + * @function deployApplication + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @instance + * @param {google.cloud.visionai.v1alpha1.IDeployApplicationRequest} request DeployApplicationRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.AppPlatform.DeployApplicationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AppPlatform.prototype.deployApplication = function deployApplication(request, callback) { + return this.rpcCall(deployApplication, $root.google.cloud.visionai.v1alpha1.DeployApplicationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeployApplication" }); + + /** + * Calls DeployApplication. + * @function deployApplication + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @instance + * @param {google.cloud.visionai.v1alpha1.IDeployApplicationRequest} request DeployApplicationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.AppPlatform|undeployApplication}. + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @typedef UndeployApplicationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UndeployApplication. + * @function undeployApplication + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @instance + * @param {google.cloud.visionai.v1alpha1.IUndeployApplicationRequest} request UndeployApplicationRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.AppPlatform.UndeployApplicationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AppPlatform.prototype.undeployApplication = function undeployApplication(request, callback) { + return this.rpcCall(undeployApplication, $root.google.cloud.visionai.v1alpha1.UndeployApplicationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UndeployApplication" }); + + /** + * Calls UndeployApplication. + * @function undeployApplication + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @instance + * @param {google.cloud.visionai.v1alpha1.IUndeployApplicationRequest} request UndeployApplicationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.AppPlatform|addApplicationStreamInput}. + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @typedef AddApplicationStreamInputCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls AddApplicationStreamInput. + * @function addApplicationStreamInput + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @instance + * @param {google.cloud.visionai.v1alpha1.IAddApplicationStreamInputRequest} request AddApplicationStreamInputRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.AppPlatform.AddApplicationStreamInputCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AppPlatform.prototype.addApplicationStreamInput = function addApplicationStreamInput(request, callback) { + return this.rpcCall(addApplicationStreamInput, $root.google.cloud.visionai.v1alpha1.AddApplicationStreamInputRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "AddApplicationStreamInput" }); + + /** + * Calls AddApplicationStreamInput. + * @function addApplicationStreamInput + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @instance + * @param {google.cloud.visionai.v1alpha1.IAddApplicationStreamInputRequest} request AddApplicationStreamInputRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.AppPlatform|removeApplicationStreamInput}. + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @typedef RemoveApplicationStreamInputCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RemoveApplicationStreamInput. + * @function removeApplicationStreamInput + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @instance + * @param {google.cloud.visionai.v1alpha1.IRemoveApplicationStreamInputRequest} request RemoveApplicationStreamInputRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.AppPlatform.RemoveApplicationStreamInputCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AppPlatform.prototype.removeApplicationStreamInput = function removeApplicationStreamInput(request, callback) { + return this.rpcCall(removeApplicationStreamInput, $root.google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RemoveApplicationStreamInput" }); + + /** + * Calls RemoveApplicationStreamInput. + * @function removeApplicationStreamInput + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @instance + * @param {google.cloud.visionai.v1alpha1.IRemoveApplicationStreamInputRequest} request RemoveApplicationStreamInputRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.AppPlatform|updateApplicationStreamInput}. + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @typedef UpdateApplicationStreamInputCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateApplicationStreamInput. + * @function updateApplicationStreamInput + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @instance + * @param {google.cloud.visionai.v1alpha1.IUpdateApplicationStreamInputRequest} request UpdateApplicationStreamInputRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.AppPlatform.UpdateApplicationStreamInputCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AppPlatform.prototype.updateApplicationStreamInput = function updateApplicationStreamInput(request, callback) { + return this.rpcCall(updateApplicationStreamInput, $root.google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateApplicationStreamInput" }); + + /** + * Calls UpdateApplicationStreamInput. + * @function updateApplicationStreamInput + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @instance + * @param {google.cloud.visionai.v1alpha1.IUpdateApplicationStreamInputRequest} request UpdateApplicationStreamInputRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.AppPlatform|listInstances}. + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @typedef ListInstancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.visionai.v1alpha1.ListInstancesResponse} [response] ListInstancesResponse + */ + + /** + * Calls ListInstances. + * @function listInstances + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @instance + * @param {google.cloud.visionai.v1alpha1.IListInstancesRequest} request ListInstancesRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.AppPlatform.ListInstancesCallback} callback Node-style callback called with the error, if any, and ListInstancesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AppPlatform.prototype.listInstances = function listInstances(request, callback) { + return this.rpcCall(listInstances, $root.google.cloud.visionai.v1alpha1.ListInstancesRequest, $root.google.cloud.visionai.v1alpha1.ListInstancesResponse, request, callback); + }, "name", { value: "ListInstances" }); + + /** + * Calls ListInstances. + * @function listInstances + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @instance + * @param {google.cloud.visionai.v1alpha1.IListInstancesRequest} request ListInstancesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.AppPlatform|getInstance}. + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @typedef GetInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.visionai.v1alpha1.Instance} [response] Instance + */ + + /** + * Calls GetInstance. + * @function getInstance + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @instance + * @param {google.cloud.visionai.v1alpha1.IGetInstanceRequest} request GetInstanceRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.AppPlatform.GetInstanceCallback} callback Node-style callback called with the error, if any, and Instance + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AppPlatform.prototype.getInstance = function getInstance(request, callback) { + return this.rpcCall(getInstance, $root.google.cloud.visionai.v1alpha1.GetInstanceRequest, $root.google.cloud.visionai.v1alpha1.Instance, request, callback); + }, "name", { value: "GetInstance" }); + + /** + * Calls GetInstance. + * @function getInstance + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @instance + * @param {google.cloud.visionai.v1alpha1.IGetInstanceRequest} request GetInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.AppPlatform|createApplicationInstances}. + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @typedef CreateApplicationInstancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateApplicationInstances. + * @function createApplicationInstances + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @instance + * @param {google.cloud.visionai.v1alpha1.ICreateApplicationInstancesRequest} request CreateApplicationInstancesRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.AppPlatform.CreateApplicationInstancesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AppPlatform.prototype.createApplicationInstances = function createApplicationInstances(request, callback) { + return this.rpcCall(createApplicationInstances, $root.google.cloud.visionai.v1alpha1.CreateApplicationInstancesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateApplicationInstances" }); + + /** + * Calls CreateApplicationInstances. + * @function createApplicationInstances + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @instance + * @param {google.cloud.visionai.v1alpha1.ICreateApplicationInstancesRequest} request CreateApplicationInstancesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.AppPlatform|deleteApplicationInstances}. + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @typedef DeleteApplicationInstancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteApplicationInstances. + * @function deleteApplicationInstances + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @instance + * @param {google.cloud.visionai.v1alpha1.IDeleteApplicationInstancesRequest} request DeleteApplicationInstancesRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.AppPlatform.DeleteApplicationInstancesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AppPlatform.prototype.deleteApplicationInstances = function deleteApplicationInstances(request, callback) { + return this.rpcCall(deleteApplicationInstances, $root.google.cloud.visionai.v1alpha1.DeleteApplicationInstancesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteApplicationInstances" }); + + /** + * Calls DeleteApplicationInstances. + * @function deleteApplicationInstances + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @instance + * @param {google.cloud.visionai.v1alpha1.IDeleteApplicationInstancesRequest} request DeleteApplicationInstancesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.AppPlatform|updateApplicationInstances}. + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @typedef UpdateApplicationInstancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateApplicationInstances. + * @function updateApplicationInstances + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @instance + * @param {google.cloud.visionai.v1alpha1.IUpdateApplicationInstancesRequest} request UpdateApplicationInstancesRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.AppPlatform.UpdateApplicationInstancesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AppPlatform.prototype.updateApplicationInstances = function updateApplicationInstances(request, callback) { + return this.rpcCall(updateApplicationInstances, $root.google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateApplicationInstances" }); + + /** + * Calls UpdateApplicationInstances. + * @function updateApplicationInstances + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @instance + * @param {google.cloud.visionai.v1alpha1.IUpdateApplicationInstancesRequest} request UpdateApplicationInstancesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.AppPlatform|listDrafts}. + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @typedef ListDraftsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.visionai.v1alpha1.ListDraftsResponse} [response] ListDraftsResponse + */ + + /** + * Calls ListDrafts. + * @function listDrafts + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @instance + * @param {google.cloud.visionai.v1alpha1.IListDraftsRequest} request ListDraftsRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.AppPlatform.ListDraftsCallback} callback Node-style callback called with the error, if any, and ListDraftsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AppPlatform.prototype.listDrafts = function listDrafts(request, callback) { + return this.rpcCall(listDrafts, $root.google.cloud.visionai.v1alpha1.ListDraftsRequest, $root.google.cloud.visionai.v1alpha1.ListDraftsResponse, request, callback); + }, "name", { value: "ListDrafts" }); + + /** + * Calls ListDrafts. + * @function listDrafts + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @instance + * @param {google.cloud.visionai.v1alpha1.IListDraftsRequest} request ListDraftsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.AppPlatform|getDraft}. + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @typedef GetDraftCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.visionai.v1alpha1.Draft} [response] Draft + */ + + /** + * Calls GetDraft. + * @function getDraft + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @instance + * @param {google.cloud.visionai.v1alpha1.IGetDraftRequest} request GetDraftRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.AppPlatform.GetDraftCallback} callback Node-style callback called with the error, if any, and Draft + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AppPlatform.prototype.getDraft = function getDraft(request, callback) { + return this.rpcCall(getDraft, $root.google.cloud.visionai.v1alpha1.GetDraftRequest, $root.google.cloud.visionai.v1alpha1.Draft, request, callback); + }, "name", { value: "GetDraft" }); + + /** + * Calls GetDraft. + * @function getDraft + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @instance + * @param {google.cloud.visionai.v1alpha1.IGetDraftRequest} request GetDraftRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.AppPlatform|createDraft}. + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @typedef CreateDraftCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateDraft. + * @function createDraft + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @instance + * @param {google.cloud.visionai.v1alpha1.ICreateDraftRequest} request CreateDraftRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.AppPlatform.CreateDraftCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AppPlatform.prototype.createDraft = function createDraft(request, callback) { + return this.rpcCall(createDraft, $root.google.cloud.visionai.v1alpha1.CreateDraftRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateDraft" }); + + /** + * Calls CreateDraft. + * @function createDraft + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @instance + * @param {google.cloud.visionai.v1alpha1.ICreateDraftRequest} request CreateDraftRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.AppPlatform|updateDraft}. + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @typedef UpdateDraftCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateDraft. + * @function updateDraft + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @instance + * @param {google.cloud.visionai.v1alpha1.IUpdateDraftRequest} request UpdateDraftRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.AppPlatform.UpdateDraftCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AppPlatform.prototype.updateDraft = function updateDraft(request, callback) { + return this.rpcCall(updateDraft, $root.google.cloud.visionai.v1alpha1.UpdateDraftRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateDraft" }); + + /** + * Calls UpdateDraft. + * @function updateDraft + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @instance + * @param {google.cloud.visionai.v1alpha1.IUpdateDraftRequest} request UpdateDraftRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.AppPlatform|deleteDraft}. + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @typedef DeleteDraftCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteDraft. + * @function deleteDraft + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @instance + * @param {google.cloud.visionai.v1alpha1.IDeleteDraftRequest} request DeleteDraftRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.AppPlatform.DeleteDraftCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AppPlatform.prototype.deleteDraft = function deleteDraft(request, callback) { + return this.rpcCall(deleteDraft, $root.google.cloud.visionai.v1alpha1.DeleteDraftRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteDraft" }); + + /** + * Calls DeleteDraft. + * @function deleteDraft + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @instance + * @param {google.cloud.visionai.v1alpha1.IDeleteDraftRequest} request DeleteDraftRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.AppPlatform|listProcessors}. + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @typedef ListProcessorsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.visionai.v1alpha1.ListProcessorsResponse} [response] ListProcessorsResponse + */ + + /** + * Calls ListProcessors. + * @function listProcessors + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @instance + * @param {google.cloud.visionai.v1alpha1.IListProcessorsRequest} request ListProcessorsRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.AppPlatform.ListProcessorsCallback} callback Node-style callback called with the error, if any, and ListProcessorsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AppPlatform.prototype.listProcessors = function listProcessors(request, callback) { + return this.rpcCall(listProcessors, $root.google.cloud.visionai.v1alpha1.ListProcessorsRequest, $root.google.cloud.visionai.v1alpha1.ListProcessorsResponse, request, callback); + }, "name", { value: "ListProcessors" }); + + /** + * Calls ListProcessors. + * @function listProcessors + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @instance + * @param {google.cloud.visionai.v1alpha1.IListProcessorsRequest} request ListProcessorsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.AppPlatform|listPrebuiltProcessors}. + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @typedef ListPrebuiltProcessorsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsResponse} [response] ListPrebuiltProcessorsResponse + */ + + /** + * Calls ListPrebuiltProcessors. + * @function listPrebuiltProcessors + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @instance + * @param {google.cloud.visionai.v1alpha1.IListPrebuiltProcessorsRequest} request ListPrebuiltProcessorsRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.AppPlatform.ListPrebuiltProcessorsCallback} callback Node-style callback called with the error, if any, and ListPrebuiltProcessorsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AppPlatform.prototype.listPrebuiltProcessors = function listPrebuiltProcessors(request, callback) { + return this.rpcCall(listPrebuiltProcessors, $root.google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsRequest, $root.google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsResponse, request, callback); + }, "name", { value: "ListPrebuiltProcessors" }); + + /** + * Calls ListPrebuiltProcessors. + * @function listPrebuiltProcessors + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @instance + * @param {google.cloud.visionai.v1alpha1.IListPrebuiltProcessorsRequest} request ListPrebuiltProcessorsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.AppPlatform|getProcessor}. + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @typedef GetProcessorCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.visionai.v1alpha1.Processor} [response] Processor + */ + + /** + * Calls GetProcessor. + * @function getProcessor + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @instance + * @param {google.cloud.visionai.v1alpha1.IGetProcessorRequest} request GetProcessorRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.AppPlatform.GetProcessorCallback} callback Node-style callback called with the error, if any, and Processor + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AppPlatform.prototype.getProcessor = function getProcessor(request, callback) { + return this.rpcCall(getProcessor, $root.google.cloud.visionai.v1alpha1.GetProcessorRequest, $root.google.cloud.visionai.v1alpha1.Processor, request, callback); + }, "name", { value: "GetProcessor" }); + + /** + * Calls GetProcessor. + * @function getProcessor + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @instance + * @param {google.cloud.visionai.v1alpha1.IGetProcessorRequest} request GetProcessorRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.AppPlatform|createProcessor}. + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @typedef CreateProcessorCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateProcessor. + * @function createProcessor + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @instance + * @param {google.cloud.visionai.v1alpha1.ICreateProcessorRequest} request CreateProcessorRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.AppPlatform.CreateProcessorCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AppPlatform.prototype.createProcessor = function createProcessor(request, callback) { + return this.rpcCall(createProcessor, $root.google.cloud.visionai.v1alpha1.CreateProcessorRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateProcessor" }); + + /** + * Calls CreateProcessor. + * @function createProcessor + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @instance + * @param {google.cloud.visionai.v1alpha1.ICreateProcessorRequest} request CreateProcessorRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.AppPlatform|updateProcessor}. + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @typedef UpdateProcessorCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateProcessor. + * @function updateProcessor + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @instance + * @param {google.cloud.visionai.v1alpha1.IUpdateProcessorRequest} request UpdateProcessorRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.AppPlatform.UpdateProcessorCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AppPlatform.prototype.updateProcessor = function updateProcessor(request, callback) { + return this.rpcCall(updateProcessor, $root.google.cloud.visionai.v1alpha1.UpdateProcessorRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateProcessor" }); + + /** + * Calls UpdateProcessor. + * @function updateProcessor + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @instance + * @param {google.cloud.visionai.v1alpha1.IUpdateProcessorRequest} request UpdateProcessorRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.AppPlatform|deleteProcessor}. + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @typedef DeleteProcessorCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteProcessor. + * @function deleteProcessor + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @instance + * @param {google.cloud.visionai.v1alpha1.IDeleteProcessorRequest} request DeleteProcessorRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.AppPlatform.DeleteProcessorCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AppPlatform.prototype.deleteProcessor = function deleteProcessor(request, callback) { + return this.rpcCall(deleteProcessor, $root.google.cloud.visionai.v1alpha1.DeleteProcessorRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteProcessor" }); + + /** + * Calls DeleteProcessor. + * @function deleteProcessor + * @memberof google.cloud.visionai.v1alpha1.AppPlatform + * @instance + * @param {google.cloud.visionai.v1alpha1.IDeleteProcessorRequest} request DeleteProcessorRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return AppPlatform; + })(); + + /** + * ModelType enum. + * @name google.cloud.visionai.v1alpha1.ModelType + * @enum {number} + * @property {number} MODEL_TYPE_UNSPECIFIED=0 MODEL_TYPE_UNSPECIFIED value + * @property {number} IMAGE_CLASSIFICATION=1 IMAGE_CLASSIFICATION value + * @property {number} OBJECT_DETECTION=2 OBJECT_DETECTION value + * @property {number} VIDEO_CLASSIFICATION=3 VIDEO_CLASSIFICATION value + * @property {number} VIDEO_OBJECT_TRACKING=4 VIDEO_OBJECT_TRACKING value + * @property {number} VIDEO_ACTION_RECOGNITION=5 VIDEO_ACTION_RECOGNITION value + * @property {number} OCCUPANCY_COUNTING=6 OCCUPANCY_COUNTING value + * @property {number} PERSON_BLUR=7 PERSON_BLUR value + * @property {number} VERTEX_CUSTOM=8 VERTEX_CUSTOM value + */ + v1alpha1.ModelType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODEL_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "IMAGE_CLASSIFICATION"] = 1; + values[valuesById[2] = "OBJECT_DETECTION"] = 2; + values[valuesById[3] = "VIDEO_CLASSIFICATION"] = 3; + values[valuesById[4] = "VIDEO_OBJECT_TRACKING"] = 4; + values[valuesById[5] = "VIDEO_ACTION_RECOGNITION"] = 5; + values[valuesById[6] = "OCCUPANCY_COUNTING"] = 6; + values[valuesById[7] = "PERSON_BLUR"] = 7; + values[valuesById[8] = "VERTEX_CUSTOM"] = 8; + return values; + })(); + + /** + * AcceleratorType enum. + * @name google.cloud.visionai.v1alpha1.AcceleratorType + * @enum {number} + * @property {number} ACCELERATOR_TYPE_UNSPECIFIED=0 ACCELERATOR_TYPE_UNSPECIFIED value + * @property {number} NVIDIA_TESLA_K80=1 NVIDIA_TESLA_K80 value + * @property {number} NVIDIA_TESLA_P100=2 NVIDIA_TESLA_P100 value + * @property {number} NVIDIA_TESLA_V100=3 NVIDIA_TESLA_V100 value + * @property {number} NVIDIA_TESLA_P4=4 NVIDIA_TESLA_P4 value + * @property {number} NVIDIA_TESLA_T4=5 NVIDIA_TESLA_T4 value + * @property {number} NVIDIA_TESLA_A100=8 NVIDIA_TESLA_A100 value + * @property {number} TPU_V2=6 TPU_V2 value + * @property {number} TPU_V3=7 TPU_V3 value + */ + v1alpha1.AcceleratorType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACCELERATOR_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NVIDIA_TESLA_K80"] = 1; + values[valuesById[2] = "NVIDIA_TESLA_P100"] = 2; + values[valuesById[3] = "NVIDIA_TESLA_V100"] = 3; + values[valuesById[4] = "NVIDIA_TESLA_P4"] = 4; + values[valuesById[5] = "NVIDIA_TESLA_T4"] = 5; + values[valuesById[8] = "NVIDIA_TESLA_A100"] = 8; + values[valuesById[6] = "TPU_V2"] = 6; + values[valuesById[7] = "TPU_V3"] = 7; + return values; + })(); + + v1alpha1.DeleteApplicationInstancesResponse = (function() { + + /** + * Properties of a DeleteApplicationInstancesResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IDeleteApplicationInstancesResponse + */ + + /** + * Constructs a new DeleteApplicationInstancesResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a DeleteApplicationInstancesResponse. + * @implements IDeleteApplicationInstancesResponse + * @constructor + * @param {google.cloud.visionai.v1alpha1.IDeleteApplicationInstancesResponse=} [properties] Properties to set + */ + function DeleteApplicationInstancesResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new DeleteApplicationInstancesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.DeleteApplicationInstancesResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IDeleteApplicationInstancesResponse=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.DeleteApplicationInstancesResponse} DeleteApplicationInstancesResponse instance + */ + DeleteApplicationInstancesResponse.create = function create(properties) { + return new DeleteApplicationInstancesResponse(properties); + }; + + /** + * Encodes the specified DeleteApplicationInstancesResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteApplicationInstancesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.DeleteApplicationInstancesResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IDeleteApplicationInstancesResponse} message DeleteApplicationInstancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteApplicationInstancesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified DeleteApplicationInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteApplicationInstancesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.DeleteApplicationInstancesResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IDeleteApplicationInstancesResponse} message DeleteApplicationInstancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteApplicationInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteApplicationInstancesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.DeleteApplicationInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.DeleteApplicationInstancesResponse} DeleteApplicationInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteApplicationInstancesResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.DeleteApplicationInstancesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteApplicationInstancesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.DeleteApplicationInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.DeleteApplicationInstancesResponse} DeleteApplicationInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteApplicationInstancesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteApplicationInstancesResponse message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.DeleteApplicationInstancesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteApplicationInstancesResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates a DeleteApplicationInstancesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.DeleteApplicationInstancesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.DeleteApplicationInstancesResponse} DeleteApplicationInstancesResponse + */ + DeleteApplicationInstancesResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.DeleteApplicationInstancesResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.google.cloud.visionai.v1alpha1.DeleteApplicationInstancesResponse(); + }; + + /** + * Creates a plain object from a DeleteApplicationInstancesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.DeleteApplicationInstancesResponse + * @static + * @param {google.cloud.visionai.v1alpha1.DeleteApplicationInstancesResponse} message DeleteApplicationInstancesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteApplicationInstancesResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this DeleteApplicationInstancesResponse to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.DeleteApplicationInstancesResponse + * @instance + * @returns {Object.} JSON object + */ + DeleteApplicationInstancesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteApplicationInstancesResponse + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.DeleteApplicationInstancesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteApplicationInstancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.DeleteApplicationInstancesResponse"; + }; + + return DeleteApplicationInstancesResponse; + })(); + + v1alpha1.CreateApplicationInstancesResponse = (function() { + + /** + * Properties of a CreateApplicationInstancesResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @interface ICreateApplicationInstancesResponse + */ + + /** + * Constructs a new CreateApplicationInstancesResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a CreateApplicationInstancesResponse. + * @implements ICreateApplicationInstancesResponse + * @constructor + * @param {google.cloud.visionai.v1alpha1.ICreateApplicationInstancesResponse=} [properties] Properties to set + */ + function CreateApplicationInstancesResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new CreateApplicationInstancesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.CreateApplicationInstancesResponse + * @static + * @param {google.cloud.visionai.v1alpha1.ICreateApplicationInstancesResponse=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.CreateApplicationInstancesResponse} CreateApplicationInstancesResponse instance + */ + CreateApplicationInstancesResponse.create = function create(properties) { + return new CreateApplicationInstancesResponse(properties); + }; + + /** + * Encodes the specified CreateApplicationInstancesResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateApplicationInstancesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.CreateApplicationInstancesResponse + * @static + * @param {google.cloud.visionai.v1alpha1.ICreateApplicationInstancesResponse} message CreateApplicationInstancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateApplicationInstancesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified CreateApplicationInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateApplicationInstancesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.CreateApplicationInstancesResponse + * @static + * @param {google.cloud.visionai.v1alpha1.ICreateApplicationInstancesResponse} message CreateApplicationInstancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateApplicationInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateApplicationInstancesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.CreateApplicationInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.CreateApplicationInstancesResponse} CreateApplicationInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateApplicationInstancesResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.CreateApplicationInstancesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreateApplicationInstancesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.CreateApplicationInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.CreateApplicationInstancesResponse} CreateApplicationInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateApplicationInstancesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateApplicationInstancesResponse message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.CreateApplicationInstancesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateApplicationInstancesResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates a CreateApplicationInstancesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.CreateApplicationInstancesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.CreateApplicationInstancesResponse} CreateApplicationInstancesResponse + */ + CreateApplicationInstancesResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.CreateApplicationInstancesResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.google.cloud.visionai.v1alpha1.CreateApplicationInstancesResponse(); + }; + + /** + * Creates a plain object from a CreateApplicationInstancesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.CreateApplicationInstancesResponse + * @static + * @param {google.cloud.visionai.v1alpha1.CreateApplicationInstancesResponse} message CreateApplicationInstancesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateApplicationInstancesResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this CreateApplicationInstancesResponse to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.CreateApplicationInstancesResponse + * @instance + * @returns {Object.} JSON object + */ + CreateApplicationInstancesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateApplicationInstancesResponse + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.CreateApplicationInstancesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateApplicationInstancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.CreateApplicationInstancesResponse"; + }; + + return CreateApplicationInstancesResponse; + })(); + + v1alpha1.UpdateApplicationInstancesResponse = (function() { + + /** + * Properties of an UpdateApplicationInstancesResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IUpdateApplicationInstancesResponse + */ + + /** + * Constructs a new UpdateApplicationInstancesResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents an UpdateApplicationInstancesResponse. + * @implements IUpdateApplicationInstancesResponse + * @constructor + * @param {google.cloud.visionai.v1alpha1.IUpdateApplicationInstancesResponse=} [properties] Properties to set + */ + function UpdateApplicationInstancesResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new UpdateApplicationInstancesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationInstancesResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IUpdateApplicationInstancesResponse=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.UpdateApplicationInstancesResponse} UpdateApplicationInstancesResponse instance + */ + UpdateApplicationInstancesResponse.create = function create(properties) { + return new UpdateApplicationInstancesResponse(properties); + }; + + /** + * Encodes the specified UpdateApplicationInstancesResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateApplicationInstancesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationInstancesResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IUpdateApplicationInstancesResponse} message UpdateApplicationInstancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateApplicationInstancesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified UpdateApplicationInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateApplicationInstancesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationInstancesResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IUpdateApplicationInstancesResponse} message UpdateApplicationInstancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateApplicationInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateApplicationInstancesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.UpdateApplicationInstancesResponse} UpdateApplicationInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateApplicationInstancesResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.UpdateApplicationInstancesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateApplicationInstancesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.UpdateApplicationInstancesResponse} UpdateApplicationInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateApplicationInstancesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateApplicationInstancesResponse message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationInstancesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateApplicationInstancesResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates an UpdateApplicationInstancesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationInstancesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.UpdateApplicationInstancesResponse} UpdateApplicationInstancesResponse + */ + UpdateApplicationInstancesResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.UpdateApplicationInstancesResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.google.cloud.visionai.v1alpha1.UpdateApplicationInstancesResponse(); + }; + + /** + * Creates a plain object from an UpdateApplicationInstancesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationInstancesResponse + * @static + * @param {google.cloud.visionai.v1alpha1.UpdateApplicationInstancesResponse} message UpdateApplicationInstancesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateApplicationInstancesResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this UpdateApplicationInstancesResponse to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationInstancesResponse + * @instance + * @returns {Object.} JSON object + */ + UpdateApplicationInstancesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateApplicationInstancesResponse + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationInstancesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateApplicationInstancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.UpdateApplicationInstancesResponse"; + }; + + return UpdateApplicationInstancesResponse; + })(); + + v1alpha1.CreateApplicationInstancesRequest = (function() { + + /** + * Properties of a CreateApplicationInstancesRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface ICreateApplicationInstancesRequest + * @property {string|null} [name] CreateApplicationInstancesRequest name + * @property {Array.|null} [applicationInstances] CreateApplicationInstancesRequest applicationInstances + * @property {string|null} [requestId] CreateApplicationInstancesRequest requestId + */ + + /** + * Constructs a new CreateApplicationInstancesRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a CreateApplicationInstancesRequest. + * @implements ICreateApplicationInstancesRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.ICreateApplicationInstancesRequest=} [properties] Properties to set + */ + function CreateApplicationInstancesRequest(properties) { + this.applicationInstances = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateApplicationInstancesRequest name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.CreateApplicationInstancesRequest + * @instance + */ + CreateApplicationInstancesRequest.prototype.name = ""; + + /** + * CreateApplicationInstancesRequest applicationInstances. + * @member {Array.} applicationInstances + * @memberof google.cloud.visionai.v1alpha1.CreateApplicationInstancesRequest + * @instance + */ + CreateApplicationInstancesRequest.prototype.applicationInstances = $util.emptyArray; + + /** + * CreateApplicationInstancesRequest requestId. + * @member {string} requestId + * @memberof google.cloud.visionai.v1alpha1.CreateApplicationInstancesRequest + * @instance + */ + CreateApplicationInstancesRequest.prototype.requestId = ""; + + /** + * Creates a new CreateApplicationInstancesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.CreateApplicationInstancesRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ICreateApplicationInstancesRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.CreateApplicationInstancesRequest} CreateApplicationInstancesRequest instance + */ + CreateApplicationInstancesRequest.create = function create(properties) { + return new CreateApplicationInstancesRequest(properties); + }; + + /** + * Encodes the specified CreateApplicationInstancesRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateApplicationInstancesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.CreateApplicationInstancesRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ICreateApplicationInstancesRequest} message CreateApplicationInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateApplicationInstancesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.applicationInstances != null && message.applicationInstances.length) + for (var i = 0; i < message.applicationInstances.length; ++i) + $root.google.cloud.visionai.v1alpha1.ApplicationInstance.encode(message.applicationInstances[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateApplicationInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateApplicationInstancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.CreateApplicationInstancesRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ICreateApplicationInstancesRequest} message CreateApplicationInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateApplicationInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateApplicationInstancesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.CreateApplicationInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.CreateApplicationInstancesRequest} CreateApplicationInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateApplicationInstancesRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.CreateApplicationInstancesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.applicationInstances && message.applicationInstances.length)) + message.applicationInstances = []; + message.applicationInstances.push($root.google.cloud.visionai.v1alpha1.ApplicationInstance.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreateApplicationInstancesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.CreateApplicationInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.CreateApplicationInstancesRequest} CreateApplicationInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateApplicationInstancesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateApplicationInstancesRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.CreateApplicationInstancesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateApplicationInstancesRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.applicationInstances != null && message.hasOwnProperty("applicationInstances")) { + if (!Array.isArray(message.applicationInstances)) + return "applicationInstances: array expected"; + for (var i = 0; i < message.applicationInstances.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.ApplicationInstance.verify(message.applicationInstances[i], long + 1); + if (error) + return "applicationInstances." + error; + } + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateApplicationInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.CreateApplicationInstancesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.CreateApplicationInstancesRequest} CreateApplicationInstancesRequest + */ + CreateApplicationInstancesRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.CreateApplicationInstancesRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.CreateApplicationInstancesRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.applicationInstances) { + if (!Array.isArray(object.applicationInstances)) + throw TypeError(".google.cloud.visionai.v1alpha1.CreateApplicationInstancesRequest.applicationInstances: array expected"); + message.applicationInstances = []; + for (var i = 0; i < object.applicationInstances.length; ++i) { + if (typeof object.applicationInstances[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.CreateApplicationInstancesRequest.applicationInstances: object expected"); + message.applicationInstances[i] = $root.google.cloud.visionai.v1alpha1.ApplicationInstance.fromObject(object.applicationInstances[i], long + 1); + } + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateApplicationInstancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.CreateApplicationInstancesRequest + * @static + * @param {google.cloud.visionai.v1alpha1.CreateApplicationInstancesRequest} message CreateApplicationInstancesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateApplicationInstancesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.applicationInstances = []; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.applicationInstances && message.applicationInstances.length) { + object.applicationInstances = []; + for (var j = 0; j < message.applicationInstances.length; ++j) + object.applicationInstances[j] = $root.google.cloud.visionai.v1alpha1.ApplicationInstance.toObject(message.applicationInstances[j], options); + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateApplicationInstancesRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.CreateApplicationInstancesRequest + * @instance + * @returns {Object.} JSON object + */ + CreateApplicationInstancesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateApplicationInstancesRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.CreateApplicationInstancesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateApplicationInstancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.CreateApplicationInstancesRequest"; + }; + + return CreateApplicationInstancesRequest; + })(); + + v1alpha1.DeleteApplicationInstancesRequest = (function() { + + /** + * Properties of a DeleteApplicationInstancesRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IDeleteApplicationInstancesRequest + * @property {string|null} [name] DeleteApplicationInstancesRequest name + * @property {Array.|null} [instanceIds] DeleteApplicationInstancesRequest instanceIds + * @property {string|null} [requestId] DeleteApplicationInstancesRequest requestId + */ + + /** + * Constructs a new DeleteApplicationInstancesRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a DeleteApplicationInstancesRequest. + * @implements IDeleteApplicationInstancesRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IDeleteApplicationInstancesRequest=} [properties] Properties to set + */ + function DeleteApplicationInstancesRequest(properties) { + this.instanceIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteApplicationInstancesRequest name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.DeleteApplicationInstancesRequest + * @instance + */ + DeleteApplicationInstancesRequest.prototype.name = ""; + + /** + * DeleteApplicationInstancesRequest instanceIds. + * @member {Array.} instanceIds + * @memberof google.cloud.visionai.v1alpha1.DeleteApplicationInstancesRequest + * @instance + */ + DeleteApplicationInstancesRequest.prototype.instanceIds = $util.emptyArray; + + /** + * DeleteApplicationInstancesRequest requestId. + * @member {string} requestId + * @memberof google.cloud.visionai.v1alpha1.DeleteApplicationInstancesRequest + * @instance + */ + DeleteApplicationInstancesRequest.prototype.requestId = ""; + + /** + * Creates a new DeleteApplicationInstancesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.DeleteApplicationInstancesRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IDeleteApplicationInstancesRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.DeleteApplicationInstancesRequest} DeleteApplicationInstancesRequest instance + */ + DeleteApplicationInstancesRequest.create = function create(properties) { + return new DeleteApplicationInstancesRequest(properties); + }; + + /** + * Encodes the specified DeleteApplicationInstancesRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteApplicationInstancesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.DeleteApplicationInstancesRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IDeleteApplicationInstancesRequest} message DeleteApplicationInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteApplicationInstancesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.instanceIds != null && message.instanceIds.length) + for (var i = 0; i < message.instanceIds.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceIds[i]); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified DeleteApplicationInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteApplicationInstancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.DeleteApplicationInstancesRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IDeleteApplicationInstancesRequest} message DeleteApplicationInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteApplicationInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteApplicationInstancesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.DeleteApplicationInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.DeleteApplicationInstancesRequest} DeleteApplicationInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteApplicationInstancesRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.DeleteApplicationInstancesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.instanceIds && message.instanceIds.length)) + message.instanceIds = []; + message.instanceIds.push(reader.string()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteApplicationInstancesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.DeleteApplicationInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.DeleteApplicationInstancesRequest} DeleteApplicationInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteApplicationInstancesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteApplicationInstancesRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.DeleteApplicationInstancesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteApplicationInstancesRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.instanceIds != null && message.hasOwnProperty("instanceIds")) { + if (!Array.isArray(message.instanceIds)) + return "instanceIds: array expected"; + for (var i = 0; i < message.instanceIds.length; ++i) + if (!$util.isString(message.instanceIds[i])) + return "instanceIds: string[] expected"; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a DeleteApplicationInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.DeleteApplicationInstancesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.DeleteApplicationInstancesRequest} DeleteApplicationInstancesRequest + */ + DeleteApplicationInstancesRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.DeleteApplicationInstancesRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.DeleteApplicationInstancesRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.instanceIds) { + if (!Array.isArray(object.instanceIds)) + throw TypeError(".google.cloud.visionai.v1alpha1.DeleteApplicationInstancesRequest.instanceIds: array expected"); + message.instanceIds = []; + for (var i = 0; i < object.instanceIds.length; ++i) + message.instanceIds[i] = String(object.instanceIds[i]); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteApplicationInstancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.DeleteApplicationInstancesRequest + * @static + * @param {google.cloud.visionai.v1alpha1.DeleteApplicationInstancesRequest} message DeleteApplicationInstancesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteApplicationInstancesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.instanceIds = []; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.instanceIds && message.instanceIds.length) { + object.instanceIds = []; + for (var j = 0; j < message.instanceIds.length; ++j) + object.instanceIds[j] = message.instanceIds[j]; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this DeleteApplicationInstancesRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.DeleteApplicationInstancesRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteApplicationInstancesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteApplicationInstancesRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.DeleteApplicationInstancesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteApplicationInstancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.DeleteApplicationInstancesRequest"; + }; + + return DeleteApplicationInstancesRequest; + })(); + + v1alpha1.DeployApplicationResponse = (function() { + + /** + * Properties of a DeployApplicationResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IDeployApplicationResponse + */ + + /** + * Constructs a new DeployApplicationResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a DeployApplicationResponse. + * @implements IDeployApplicationResponse + * @constructor + * @param {google.cloud.visionai.v1alpha1.IDeployApplicationResponse=} [properties] Properties to set + */ + function DeployApplicationResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new DeployApplicationResponse instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.DeployApplicationResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IDeployApplicationResponse=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.DeployApplicationResponse} DeployApplicationResponse instance + */ + DeployApplicationResponse.create = function create(properties) { + return new DeployApplicationResponse(properties); + }; + + /** + * Encodes the specified DeployApplicationResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeployApplicationResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.DeployApplicationResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IDeployApplicationResponse} message DeployApplicationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployApplicationResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified DeployApplicationResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeployApplicationResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.DeployApplicationResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IDeployApplicationResponse} message DeployApplicationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployApplicationResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeployApplicationResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.DeployApplicationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.DeployApplicationResponse} DeployApplicationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployApplicationResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.DeployApplicationResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeployApplicationResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.DeployApplicationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.DeployApplicationResponse} DeployApplicationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployApplicationResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeployApplicationResponse message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.DeployApplicationResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeployApplicationResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates a DeployApplicationResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.DeployApplicationResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.DeployApplicationResponse} DeployApplicationResponse + */ + DeployApplicationResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.DeployApplicationResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.google.cloud.visionai.v1alpha1.DeployApplicationResponse(); + }; + + /** + * Creates a plain object from a DeployApplicationResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.DeployApplicationResponse + * @static + * @param {google.cloud.visionai.v1alpha1.DeployApplicationResponse} message DeployApplicationResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeployApplicationResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this DeployApplicationResponse to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.DeployApplicationResponse + * @instance + * @returns {Object.} JSON object + */ + DeployApplicationResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeployApplicationResponse + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.DeployApplicationResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeployApplicationResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.DeployApplicationResponse"; + }; + + return DeployApplicationResponse; + })(); + + v1alpha1.UndeployApplicationResponse = (function() { + + /** + * Properties of an UndeployApplicationResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IUndeployApplicationResponse + */ + + /** + * Constructs a new UndeployApplicationResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents an UndeployApplicationResponse. + * @implements IUndeployApplicationResponse + * @constructor + * @param {google.cloud.visionai.v1alpha1.IUndeployApplicationResponse=} [properties] Properties to set + */ + function UndeployApplicationResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new UndeployApplicationResponse instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.UndeployApplicationResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IUndeployApplicationResponse=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.UndeployApplicationResponse} UndeployApplicationResponse instance + */ + UndeployApplicationResponse.create = function create(properties) { + return new UndeployApplicationResponse(properties); + }; + + /** + * Encodes the specified UndeployApplicationResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.UndeployApplicationResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.UndeployApplicationResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IUndeployApplicationResponse} message UndeployApplicationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeployApplicationResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified UndeployApplicationResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.UndeployApplicationResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.UndeployApplicationResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IUndeployApplicationResponse} message UndeployApplicationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeployApplicationResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UndeployApplicationResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.UndeployApplicationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.UndeployApplicationResponse} UndeployApplicationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeployApplicationResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.UndeployApplicationResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UndeployApplicationResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.UndeployApplicationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.UndeployApplicationResponse} UndeployApplicationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeployApplicationResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UndeployApplicationResponse message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.UndeployApplicationResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UndeployApplicationResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates an UndeployApplicationResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.UndeployApplicationResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.UndeployApplicationResponse} UndeployApplicationResponse + */ + UndeployApplicationResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.UndeployApplicationResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.google.cloud.visionai.v1alpha1.UndeployApplicationResponse(); + }; + + /** + * Creates a plain object from an UndeployApplicationResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.UndeployApplicationResponse + * @static + * @param {google.cloud.visionai.v1alpha1.UndeployApplicationResponse} message UndeployApplicationResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UndeployApplicationResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this UndeployApplicationResponse to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.UndeployApplicationResponse + * @instance + * @returns {Object.} JSON object + */ + UndeployApplicationResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UndeployApplicationResponse + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.UndeployApplicationResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UndeployApplicationResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.UndeployApplicationResponse"; + }; + + return UndeployApplicationResponse; + })(); + + v1alpha1.RemoveApplicationStreamInputResponse = (function() { + + /** + * Properties of a RemoveApplicationStreamInputResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IRemoveApplicationStreamInputResponse + */ + + /** + * Constructs a new RemoveApplicationStreamInputResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a RemoveApplicationStreamInputResponse. + * @implements IRemoveApplicationStreamInputResponse + * @constructor + * @param {google.cloud.visionai.v1alpha1.IRemoveApplicationStreamInputResponse=} [properties] Properties to set + */ + function RemoveApplicationStreamInputResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new RemoveApplicationStreamInputResponse instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IRemoveApplicationStreamInputResponse=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputResponse} RemoveApplicationStreamInputResponse instance + */ + RemoveApplicationStreamInputResponse.create = function create(properties) { + return new RemoveApplicationStreamInputResponse(properties); + }; + + /** + * Encodes the specified RemoveApplicationStreamInputResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IRemoveApplicationStreamInputResponse} message RemoveApplicationStreamInputResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveApplicationStreamInputResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified RemoveApplicationStreamInputResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IRemoveApplicationStreamInputResponse} message RemoveApplicationStreamInputResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveApplicationStreamInputResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RemoveApplicationStreamInputResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputResponse} RemoveApplicationStreamInputResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveApplicationStreamInputResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a RemoveApplicationStreamInputResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputResponse} RemoveApplicationStreamInputResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveApplicationStreamInputResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RemoveApplicationStreamInputResponse message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RemoveApplicationStreamInputResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates a RemoveApplicationStreamInputResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputResponse} RemoveApplicationStreamInputResponse + */ + RemoveApplicationStreamInputResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputResponse(); + }; + + /** + * Creates a plain object from a RemoveApplicationStreamInputResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputResponse + * @static + * @param {google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputResponse} message RemoveApplicationStreamInputResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RemoveApplicationStreamInputResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this RemoveApplicationStreamInputResponse to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputResponse + * @instance + * @returns {Object.} JSON object + */ + RemoveApplicationStreamInputResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RemoveApplicationStreamInputResponse + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RemoveApplicationStreamInputResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputResponse"; + }; + + return RemoveApplicationStreamInputResponse; + })(); + + v1alpha1.AddApplicationStreamInputResponse = (function() { + + /** + * Properties of an AddApplicationStreamInputResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IAddApplicationStreamInputResponse + */ + + /** + * Constructs a new AddApplicationStreamInputResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents an AddApplicationStreamInputResponse. + * @implements IAddApplicationStreamInputResponse + * @constructor + * @param {google.cloud.visionai.v1alpha1.IAddApplicationStreamInputResponse=} [properties] Properties to set + */ + function AddApplicationStreamInputResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new AddApplicationStreamInputResponse instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.AddApplicationStreamInputResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IAddApplicationStreamInputResponse=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.AddApplicationStreamInputResponse} AddApplicationStreamInputResponse instance + */ + AddApplicationStreamInputResponse.create = function create(properties) { + return new AddApplicationStreamInputResponse(properties); + }; + + /** + * Encodes the specified AddApplicationStreamInputResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.AddApplicationStreamInputResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.AddApplicationStreamInputResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IAddApplicationStreamInputResponse} message AddApplicationStreamInputResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddApplicationStreamInputResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified AddApplicationStreamInputResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.AddApplicationStreamInputResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.AddApplicationStreamInputResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IAddApplicationStreamInputResponse} message AddApplicationStreamInputResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddApplicationStreamInputResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AddApplicationStreamInputResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.AddApplicationStreamInputResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.AddApplicationStreamInputResponse} AddApplicationStreamInputResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddApplicationStreamInputResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.AddApplicationStreamInputResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an AddApplicationStreamInputResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.AddApplicationStreamInputResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.AddApplicationStreamInputResponse} AddApplicationStreamInputResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddApplicationStreamInputResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AddApplicationStreamInputResponse message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.AddApplicationStreamInputResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AddApplicationStreamInputResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates an AddApplicationStreamInputResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.AddApplicationStreamInputResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.AddApplicationStreamInputResponse} AddApplicationStreamInputResponse + */ + AddApplicationStreamInputResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.AddApplicationStreamInputResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.google.cloud.visionai.v1alpha1.AddApplicationStreamInputResponse(); + }; + + /** + * Creates a plain object from an AddApplicationStreamInputResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.AddApplicationStreamInputResponse + * @static + * @param {google.cloud.visionai.v1alpha1.AddApplicationStreamInputResponse} message AddApplicationStreamInputResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AddApplicationStreamInputResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this AddApplicationStreamInputResponse to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.AddApplicationStreamInputResponse + * @instance + * @returns {Object.} JSON object + */ + AddApplicationStreamInputResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AddApplicationStreamInputResponse + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.AddApplicationStreamInputResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AddApplicationStreamInputResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.AddApplicationStreamInputResponse"; + }; + + return AddApplicationStreamInputResponse; + })(); + + v1alpha1.UpdateApplicationStreamInputResponse = (function() { + + /** + * Properties of an UpdateApplicationStreamInputResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IUpdateApplicationStreamInputResponse + */ + + /** + * Constructs a new UpdateApplicationStreamInputResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents an UpdateApplicationStreamInputResponse. + * @implements IUpdateApplicationStreamInputResponse + * @constructor + * @param {google.cloud.visionai.v1alpha1.IUpdateApplicationStreamInputResponse=} [properties] Properties to set + */ + function UpdateApplicationStreamInputResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new UpdateApplicationStreamInputResponse instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IUpdateApplicationStreamInputResponse=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputResponse} UpdateApplicationStreamInputResponse instance + */ + UpdateApplicationStreamInputResponse.create = function create(properties) { + return new UpdateApplicationStreamInputResponse(properties); + }; + + /** + * Encodes the specified UpdateApplicationStreamInputResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IUpdateApplicationStreamInputResponse} message UpdateApplicationStreamInputResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateApplicationStreamInputResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified UpdateApplicationStreamInputResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IUpdateApplicationStreamInputResponse} message UpdateApplicationStreamInputResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateApplicationStreamInputResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateApplicationStreamInputResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputResponse} UpdateApplicationStreamInputResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateApplicationStreamInputResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateApplicationStreamInputResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputResponse} UpdateApplicationStreamInputResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateApplicationStreamInputResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateApplicationStreamInputResponse message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateApplicationStreamInputResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates an UpdateApplicationStreamInputResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputResponse} UpdateApplicationStreamInputResponse + */ + UpdateApplicationStreamInputResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputResponse(); + }; + + /** + * Creates a plain object from an UpdateApplicationStreamInputResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputResponse + * @static + * @param {google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputResponse} message UpdateApplicationStreamInputResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateApplicationStreamInputResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this UpdateApplicationStreamInputResponse to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputResponse + * @instance + * @returns {Object.} JSON object + */ + UpdateApplicationStreamInputResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateApplicationStreamInputResponse + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateApplicationStreamInputResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputResponse"; + }; + + return UpdateApplicationStreamInputResponse; + })(); + + v1alpha1.ListApplicationsRequest = (function() { + + /** + * Properties of a ListApplicationsRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IListApplicationsRequest + * @property {string|null} [parent] ListApplicationsRequest parent + * @property {number|null} [pageSize] ListApplicationsRequest pageSize + * @property {string|null} [pageToken] ListApplicationsRequest pageToken + * @property {string|null} [filter] ListApplicationsRequest filter + * @property {string|null} [orderBy] ListApplicationsRequest orderBy + */ + + /** + * Constructs a new ListApplicationsRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a ListApplicationsRequest. + * @implements IListApplicationsRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IListApplicationsRequest=} [properties] Properties to set + */ + function ListApplicationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListApplicationsRequest parent. + * @member {string} parent + * @memberof google.cloud.visionai.v1alpha1.ListApplicationsRequest + * @instance + */ + ListApplicationsRequest.prototype.parent = ""; + + /** + * ListApplicationsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.visionai.v1alpha1.ListApplicationsRequest + * @instance + */ + ListApplicationsRequest.prototype.pageSize = 0; + + /** + * ListApplicationsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.visionai.v1alpha1.ListApplicationsRequest + * @instance + */ + ListApplicationsRequest.prototype.pageToken = ""; + + /** + * ListApplicationsRequest filter. + * @member {string} filter + * @memberof google.cloud.visionai.v1alpha1.ListApplicationsRequest + * @instance + */ + ListApplicationsRequest.prototype.filter = ""; + + /** + * ListApplicationsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.visionai.v1alpha1.ListApplicationsRequest + * @instance + */ + ListApplicationsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListApplicationsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ListApplicationsRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IListApplicationsRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ListApplicationsRequest} ListApplicationsRequest instance + */ + ListApplicationsRequest.create = function create(properties) { + return new ListApplicationsRequest(properties); + }; + + /** + * Encodes the specified ListApplicationsRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListApplicationsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ListApplicationsRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IListApplicationsRequest} message ListApplicationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApplicationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListApplicationsRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListApplicationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListApplicationsRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IListApplicationsRequest} message ListApplicationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApplicationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListApplicationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ListApplicationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ListApplicationsRequest} ListApplicationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApplicationsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ListApplicationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListApplicationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListApplicationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ListApplicationsRequest} ListApplicationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApplicationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListApplicationsRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ListApplicationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListApplicationsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListApplicationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ListApplicationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ListApplicationsRequest} ListApplicationsRequest + */ + ListApplicationsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ListApplicationsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ListApplicationsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListApplicationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ListApplicationsRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ListApplicationsRequest} message ListApplicationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListApplicationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListApplicationsRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ListApplicationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListApplicationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListApplicationsRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ListApplicationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListApplicationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ListApplicationsRequest"; + }; + + return ListApplicationsRequest; + })(); + + v1alpha1.ListApplicationsResponse = (function() { + + /** + * Properties of a ListApplicationsResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IListApplicationsResponse + * @property {Array.|null} [applications] ListApplicationsResponse applications + * @property {string|null} [nextPageToken] ListApplicationsResponse nextPageToken + * @property {Array.|null} [unreachable] ListApplicationsResponse unreachable + */ + + /** + * Constructs a new ListApplicationsResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a ListApplicationsResponse. + * @implements IListApplicationsResponse + * @constructor + * @param {google.cloud.visionai.v1alpha1.IListApplicationsResponse=} [properties] Properties to set + */ + function ListApplicationsResponse(properties) { + this.applications = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListApplicationsResponse applications. + * @member {Array.} applications + * @memberof google.cloud.visionai.v1alpha1.ListApplicationsResponse + * @instance + */ + ListApplicationsResponse.prototype.applications = $util.emptyArray; + + /** + * ListApplicationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.visionai.v1alpha1.ListApplicationsResponse + * @instance + */ + ListApplicationsResponse.prototype.nextPageToken = ""; + + /** + * ListApplicationsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.visionai.v1alpha1.ListApplicationsResponse + * @instance + */ + ListApplicationsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListApplicationsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ListApplicationsResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IListApplicationsResponse=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ListApplicationsResponse} ListApplicationsResponse instance + */ + ListApplicationsResponse.create = function create(properties) { + return new ListApplicationsResponse(properties); + }; + + /** + * Encodes the specified ListApplicationsResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListApplicationsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ListApplicationsResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IListApplicationsResponse} message ListApplicationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApplicationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.applications != null && message.applications.length) + for (var i = 0; i < message.applications.length; ++i) + $root.google.cloud.visionai.v1alpha1.Application.encode(message.applications[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListApplicationsResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListApplicationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListApplicationsResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IListApplicationsResponse} message ListApplicationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApplicationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListApplicationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ListApplicationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ListApplicationsResponse} ListApplicationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApplicationsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ListApplicationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.applications && message.applications.length)) + message.applications = []; + message.applications.push($root.google.cloud.visionai.v1alpha1.Application.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListApplicationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListApplicationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ListApplicationsResponse} ListApplicationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApplicationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListApplicationsResponse message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ListApplicationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListApplicationsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.applications != null && message.hasOwnProperty("applications")) { + if (!Array.isArray(message.applications)) + return "applications: array expected"; + for (var i = 0; i < message.applications.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.Application.verify(message.applications[i], long + 1); + if (error) + return "applications." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListApplicationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ListApplicationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ListApplicationsResponse} ListApplicationsResponse + */ + ListApplicationsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ListApplicationsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ListApplicationsResponse(); + if (object.applications) { + if (!Array.isArray(object.applications)) + throw TypeError(".google.cloud.visionai.v1alpha1.ListApplicationsResponse.applications: array expected"); + message.applications = []; + for (var i = 0; i < object.applications.length; ++i) { + if (typeof object.applications[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ListApplicationsResponse.applications: object expected"); + message.applications[i] = $root.google.cloud.visionai.v1alpha1.Application.fromObject(object.applications[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.visionai.v1alpha1.ListApplicationsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListApplicationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ListApplicationsResponse + * @static + * @param {google.cloud.visionai.v1alpha1.ListApplicationsResponse} message ListApplicationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListApplicationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.applications = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.applications && message.applications.length) { + object.applications = []; + for (var j = 0; j < message.applications.length; ++j) + object.applications[j] = $root.google.cloud.visionai.v1alpha1.Application.toObject(message.applications[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListApplicationsResponse to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ListApplicationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListApplicationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListApplicationsResponse + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ListApplicationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListApplicationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ListApplicationsResponse"; + }; + + return ListApplicationsResponse; + })(); + + v1alpha1.GetApplicationRequest = (function() { + + /** + * Properties of a GetApplicationRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IGetApplicationRequest + * @property {string|null} [name] GetApplicationRequest name + */ + + /** + * Constructs a new GetApplicationRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a GetApplicationRequest. + * @implements IGetApplicationRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IGetApplicationRequest=} [properties] Properties to set + */ + function GetApplicationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetApplicationRequest name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.GetApplicationRequest + * @instance + */ + GetApplicationRequest.prototype.name = ""; + + /** + * Creates a new GetApplicationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.GetApplicationRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IGetApplicationRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.GetApplicationRequest} GetApplicationRequest instance + */ + GetApplicationRequest.create = function create(properties) { + return new GetApplicationRequest(properties); + }; + + /** + * Encodes the specified GetApplicationRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetApplicationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.GetApplicationRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IGetApplicationRequest} message GetApplicationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetApplicationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetApplicationRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetApplicationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.GetApplicationRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IGetApplicationRequest} message GetApplicationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetApplicationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetApplicationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.GetApplicationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.GetApplicationRequest} GetApplicationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetApplicationRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.GetApplicationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetApplicationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.GetApplicationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.GetApplicationRequest} GetApplicationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetApplicationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetApplicationRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.GetApplicationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetApplicationRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetApplicationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.GetApplicationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.GetApplicationRequest} GetApplicationRequest + */ + GetApplicationRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.GetApplicationRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.GetApplicationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetApplicationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.GetApplicationRequest + * @static + * @param {google.cloud.visionai.v1alpha1.GetApplicationRequest} message GetApplicationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetApplicationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetApplicationRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.GetApplicationRequest + * @instance + * @returns {Object.} JSON object + */ + GetApplicationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetApplicationRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.GetApplicationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetApplicationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.GetApplicationRequest"; + }; + + return GetApplicationRequest; + })(); + + v1alpha1.CreateApplicationRequest = (function() { + + /** + * Properties of a CreateApplicationRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface ICreateApplicationRequest + * @property {string|null} [parent] CreateApplicationRequest parent + * @property {string|null} [applicationId] CreateApplicationRequest applicationId + * @property {google.cloud.visionai.v1alpha1.IApplication|null} [application] CreateApplicationRequest application + * @property {string|null} [requestId] CreateApplicationRequest requestId + */ + + /** + * Constructs a new CreateApplicationRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a CreateApplicationRequest. + * @implements ICreateApplicationRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.ICreateApplicationRequest=} [properties] Properties to set + */ + function CreateApplicationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateApplicationRequest parent. + * @member {string} parent + * @memberof google.cloud.visionai.v1alpha1.CreateApplicationRequest + * @instance + */ + CreateApplicationRequest.prototype.parent = ""; + + /** + * CreateApplicationRequest applicationId. + * @member {string} applicationId + * @memberof google.cloud.visionai.v1alpha1.CreateApplicationRequest + * @instance + */ + CreateApplicationRequest.prototype.applicationId = ""; + + /** + * CreateApplicationRequest application. + * @member {google.cloud.visionai.v1alpha1.IApplication|null|undefined} application + * @memberof google.cloud.visionai.v1alpha1.CreateApplicationRequest + * @instance + */ + CreateApplicationRequest.prototype.application = null; + + /** + * CreateApplicationRequest requestId. + * @member {string} requestId + * @memberof google.cloud.visionai.v1alpha1.CreateApplicationRequest + * @instance + */ + CreateApplicationRequest.prototype.requestId = ""; + + /** + * Creates a new CreateApplicationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.CreateApplicationRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ICreateApplicationRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.CreateApplicationRequest} CreateApplicationRequest instance + */ + CreateApplicationRequest.create = function create(properties) { + return new CreateApplicationRequest(properties); + }; + + /** + * Encodes the specified CreateApplicationRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateApplicationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.CreateApplicationRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ICreateApplicationRequest} message CreateApplicationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateApplicationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.applicationId != null && Object.hasOwnProperty.call(message, "applicationId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.applicationId); + if (message.application != null && Object.hasOwnProperty.call(message, "application")) + $root.google.cloud.visionai.v1alpha1.Application.encode(message.application, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateApplicationRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateApplicationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.CreateApplicationRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ICreateApplicationRequest} message CreateApplicationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateApplicationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateApplicationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.CreateApplicationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.CreateApplicationRequest} CreateApplicationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateApplicationRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.CreateApplicationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.applicationId = reader.string(); + break; + } + case 3: { + message.application = $root.google.cloud.visionai.v1alpha1.Application.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreateApplicationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.CreateApplicationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.CreateApplicationRequest} CreateApplicationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateApplicationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateApplicationRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.CreateApplicationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateApplicationRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.applicationId != null && message.hasOwnProperty("applicationId")) + if (!$util.isString(message.applicationId)) + return "applicationId: string expected"; + if (message.application != null && message.hasOwnProperty("application")) { + var error = $root.google.cloud.visionai.v1alpha1.Application.verify(message.application, long + 1); + if (error) + return "application." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateApplicationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.CreateApplicationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.CreateApplicationRequest} CreateApplicationRequest + */ + CreateApplicationRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.CreateApplicationRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.CreateApplicationRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.applicationId != null) + message.applicationId = String(object.applicationId); + if (object.application != null) { + if (typeof object.application !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.CreateApplicationRequest.application: object expected"); + message.application = $root.google.cloud.visionai.v1alpha1.Application.fromObject(object.application, long + 1); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateApplicationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.CreateApplicationRequest + * @static + * @param {google.cloud.visionai.v1alpha1.CreateApplicationRequest} message CreateApplicationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateApplicationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.applicationId = ""; + object.application = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.applicationId != null && message.hasOwnProperty("applicationId")) + object.applicationId = message.applicationId; + if (message.application != null && message.hasOwnProperty("application")) + object.application = $root.google.cloud.visionai.v1alpha1.Application.toObject(message.application, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateApplicationRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.CreateApplicationRequest + * @instance + * @returns {Object.} JSON object + */ + CreateApplicationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateApplicationRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.CreateApplicationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateApplicationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.CreateApplicationRequest"; + }; + + return CreateApplicationRequest; + })(); + + v1alpha1.UpdateApplicationRequest = (function() { + + /** + * Properties of an UpdateApplicationRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IUpdateApplicationRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateApplicationRequest updateMask + * @property {google.cloud.visionai.v1alpha1.IApplication|null} [application] UpdateApplicationRequest application + * @property {string|null} [requestId] UpdateApplicationRequest requestId + */ + + /** + * Constructs a new UpdateApplicationRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents an UpdateApplicationRequest. + * @implements IUpdateApplicationRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IUpdateApplicationRequest=} [properties] Properties to set + */ + function UpdateApplicationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateApplicationRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationRequest + * @instance + */ + UpdateApplicationRequest.prototype.updateMask = null; + + /** + * UpdateApplicationRequest application. + * @member {google.cloud.visionai.v1alpha1.IApplication|null|undefined} application + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationRequest + * @instance + */ + UpdateApplicationRequest.prototype.application = null; + + /** + * UpdateApplicationRequest requestId. + * @member {string} requestId + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationRequest + * @instance + */ + UpdateApplicationRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateApplicationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IUpdateApplicationRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.UpdateApplicationRequest} UpdateApplicationRequest instance + */ + UpdateApplicationRequest.create = function create(properties) { + return new UpdateApplicationRequest(properties); + }; + + /** + * Encodes the specified UpdateApplicationRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateApplicationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IUpdateApplicationRequest} message UpdateApplicationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateApplicationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.application != null && Object.hasOwnProperty.call(message, "application")) + $root.google.cloud.visionai.v1alpha1.Application.encode(message.application, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified UpdateApplicationRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateApplicationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IUpdateApplicationRequest} message UpdateApplicationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateApplicationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateApplicationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.UpdateApplicationRequest} UpdateApplicationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateApplicationRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.UpdateApplicationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.application = $root.google.cloud.visionai.v1alpha1.Application.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateApplicationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.UpdateApplicationRequest} UpdateApplicationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateApplicationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateApplicationRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateApplicationRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + if (message.application != null && message.hasOwnProperty("application")) { + var error = $root.google.cloud.visionai.v1alpha1.Application.verify(message.application, long + 1); + if (error) + return "application." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an UpdateApplicationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.UpdateApplicationRequest} UpdateApplicationRequest + */ + UpdateApplicationRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.UpdateApplicationRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.UpdateApplicationRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.UpdateApplicationRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + if (object.application != null) { + if (typeof object.application !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.UpdateApplicationRequest.application: object expected"); + message.application = $root.google.cloud.visionai.v1alpha1.Application.fromObject(object.application, long + 1); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateApplicationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationRequest + * @static + * @param {google.cloud.visionai.v1alpha1.UpdateApplicationRequest} message UpdateApplicationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateApplicationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.application = null; + object.requestId = ""; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.application != null && message.hasOwnProperty("application")) + object.application = $root.google.cloud.visionai.v1alpha1.Application.toObject(message.application, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UpdateApplicationRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateApplicationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateApplicationRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateApplicationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.UpdateApplicationRequest"; + }; + + return UpdateApplicationRequest; + })(); + + v1alpha1.DeleteApplicationRequest = (function() { + + /** + * Properties of a DeleteApplicationRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IDeleteApplicationRequest + * @property {string|null} [name] DeleteApplicationRequest name + * @property {string|null} [requestId] DeleteApplicationRequest requestId + * @property {boolean|null} [force] DeleteApplicationRequest force + */ + + /** + * Constructs a new DeleteApplicationRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a DeleteApplicationRequest. + * @implements IDeleteApplicationRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IDeleteApplicationRequest=} [properties] Properties to set + */ + function DeleteApplicationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteApplicationRequest name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.DeleteApplicationRequest + * @instance + */ + DeleteApplicationRequest.prototype.name = ""; + + /** + * DeleteApplicationRequest requestId. + * @member {string} requestId + * @memberof google.cloud.visionai.v1alpha1.DeleteApplicationRequest + * @instance + */ + DeleteApplicationRequest.prototype.requestId = ""; + + /** + * DeleteApplicationRequest force. + * @member {boolean} force + * @memberof google.cloud.visionai.v1alpha1.DeleteApplicationRequest + * @instance + */ + DeleteApplicationRequest.prototype.force = false; + + /** + * Creates a new DeleteApplicationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.DeleteApplicationRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IDeleteApplicationRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.DeleteApplicationRequest} DeleteApplicationRequest instance + */ + DeleteApplicationRequest.create = function create(properties) { + return new DeleteApplicationRequest(properties); + }; + + /** + * Encodes the specified DeleteApplicationRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteApplicationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.DeleteApplicationRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IDeleteApplicationRequest} message DeleteApplicationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteApplicationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.force); + return writer; + }; + + /** + * Encodes the specified DeleteApplicationRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteApplicationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.DeleteApplicationRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IDeleteApplicationRequest} message DeleteApplicationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteApplicationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteApplicationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.DeleteApplicationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.DeleteApplicationRequest} DeleteApplicationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteApplicationRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.DeleteApplicationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + case 3: { + message.force = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteApplicationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.DeleteApplicationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.DeleteApplicationRequest} DeleteApplicationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteApplicationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteApplicationRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.DeleteApplicationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteApplicationRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + return null; + }; + + /** + * Creates a DeleteApplicationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.DeleteApplicationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.DeleteApplicationRequest} DeleteApplicationRequest + */ + DeleteApplicationRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.DeleteApplicationRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.DeleteApplicationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; + + /** + * Creates a plain object from a DeleteApplicationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.DeleteApplicationRequest + * @static + * @param {google.cloud.visionai.v1alpha1.DeleteApplicationRequest} message DeleteApplicationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteApplicationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + object.force = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; + }; + + /** + * Converts this DeleteApplicationRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.DeleteApplicationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteApplicationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteApplicationRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.DeleteApplicationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteApplicationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.DeleteApplicationRequest"; + }; + + return DeleteApplicationRequest; + })(); + + v1alpha1.DeployApplicationRequest = (function() { + + /** + * Properties of a DeployApplicationRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IDeployApplicationRequest + * @property {string|null} [name] DeployApplicationRequest name + * @property {boolean|null} [validateOnly] DeployApplicationRequest validateOnly + * @property {string|null} [requestId] DeployApplicationRequest requestId + * @property {boolean|null} [enableMonitoring] DeployApplicationRequest enableMonitoring + */ + + /** + * Constructs a new DeployApplicationRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a DeployApplicationRequest. + * @implements IDeployApplicationRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IDeployApplicationRequest=} [properties] Properties to set + */ + function DeployApplicationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeployApplicationRequest name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.DeployApplicationRequest + * @instance + */ + DeployApplicationRequest.prototype.name = ""; + + /** + * DeployApplicationRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.visionai.v1alpha1.DeployApplicationRequest + * @instance + */ + DeployApplicationRequest.prototype.validateOnly = false; + + /** + * DeployApplicationRequest requestId. + * @member {string} requestId + * @memberof google.cloud.visionai.v1alpha1.DeployApplicationRequest + * @instance + */ + DeployApplicationRequest.prototype.requestId = ""; + + /** + * DeployApplicationRequest enableMonitoring. + * @member {boolean} enableMonitoring + * @memberof google.cloud.visionai.v1alpha1.DeployApplicationRequest + * @instance + */ + DeployApplicationRequest.prototype.enableMonitoring = false; + + /** + * Creates a new DeployApplicationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.DeployApplicationRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IDeployApplicationRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.DeployApplicationRequest} DeployApplicationRequest instance + */ + DeployApplicationRequest.create = function create(properties) { + return new DeployApplicationRequest(properties); + }; + + /** + * Encodes the specified DeployApplicationRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeployApplicationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.DeployApplicationRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IDeployApplicationRequest} message DeployApplicationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployApplicationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.validateOnly); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + if (message.enableMonitoring != null && Object.hasOwnProperty.call(message, "enableMonitoring")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.enableMonitoring); + return writer; + }; + + /** + * Encodes the specified DeployApplicationRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeployApplicationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.DeployApplicationRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IDeployApplicationRequest} message DeployApplicationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployApplicationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeployApplicationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.DeployApplicationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.DeployApplicationRequest} DeployApplicationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployApplicationRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.DeployApplicationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.validateOnly = reader.bool(); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + case 4: { + message.enableMonitoring = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeployApplicationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.DeployApplicationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.DeployApplicationRequest} DeployApplicationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployApplicationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeployApplicationRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.DeployApplicationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeployApplicationRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.enableMonitoring != null && message.hasOwnProperty("enableMonitoring")) + if (typeof message.enableMonitoring !== "boolean") + return "enableMonitoring: boolean expected"; + return null; + }; + + /** + * Creates a DeployApplicationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.DeployApplicationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.DeployApplicationRequest} DeployApplicationRequest + */ + DeployApplicationRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.DeployApplicationRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.DeployApplicationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.enableMonitoring != null) + message.enableMonitoring = Boolean(object.enableMonitoring); + return message; + }; + + /** + * Creates a plain object from a DeployApplicationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.DeployApplicationRequest + * @static + * @param {google.cloud.visionai.v1alpha1.DeployApplicationRequest} message DeployApplicationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeployApplicationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.validateOnly = false; + object.requestId = ""; + object.enableMonitoring = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.enableMonitoring != null && message.hasOwnProperty("enableMonitoring")) + object.enableMonitoring = message.enableMonitoring; + return object; + }; + + /** + * Converts this DeployApplicationRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.DeployApplicationRequest + * @instance + * @returns {Object.} JSON object + */ + DeployApplicationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeployApplicationRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.DeployApplicationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeployApplicationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.DeployApplicationRequest"; + }; + + return DeployApplicationRequest; + })(); + + v1alpha1.UndeployApplicationRequest = (function() { + + /** + * Properties of an UndeployApplicationRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IUndeployApplicationRequest + * @property {string|null} [name] UndeployApplicationRequest name + * @property {string|null} [requestId] UndeployApplicationRequest requestId + */ + + /** + * Constructs a new UndeployApplicationRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents an UndeployApplicationRequest. + * @implements IUndeployApplicationRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IUndeployApplicationRequest=} [properties] Properties to set + */ + function UndeployApplicationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UndeployApplicationRequest name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.UndeployApplicationRequest + * @instance + */ + UndeployApplicationRequest.prototype.name = ""; + + /** + * UndeployApplicationRequest requestId. + * @member {string} requestId + * @memberof google.cloud.visionai.v1alpha1.UndeployApplicationRequest + * @instance + */ + UndeployApplicationRequest.prototype.requestId = ""; + + /** + * Creates a new UndeployApplicationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.UndeployApplicationRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IUndeployApplicationRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.UndeployApplicationRequest} UndeployApplicationRequest instance + */ + UndeployApplicationRequest.create = function create(properties) { + return new UndeployApplicationRequest(properties); + }; + + /** + * Encodes the specified UndeployApplicationRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.UndeployApplicationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.UndeployApplicationRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IUndeployApplicationRequest} message UndeployApplicationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeployApplicationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified UndeployApplicationRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.UndeployApplicationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.UndeployApplicationRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IUndeployApplicationRequest} message UndeployApplicationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeployApplicationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UndeployApplicationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.UndeployApplicationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.UndeployApplicationRequest} UndeployApplicationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeployApplicationRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.UndeployApplicationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UndeployApplicationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.UndeployApplicationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.UndeployApplicationRequest} UndeployApplicationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeployApplicationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UndeployApplicationRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.UndeployApplicationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UndeployApplicationRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an UndeployApplicationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.UndeployApplicationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.UndeployApplicationRequest} UndeployApplicationRequest + */ + UndeployApplicationRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.UndeployApplicationRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.UndeployApplicationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UndeployApplicationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.UndeployApplicationRequest + * @static + * @param {google.cloud.visionai.v1alpha1.UndeployApplicationRequest} message UndeployApplicationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UndeployApplicationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UndeployApplicationRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.UndeployApplicationRequest + * @instance + * @returns {Object.} JSON object + */ + UndeployApplicationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UndeployApplicationRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.UndeployApplicationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UndeployApplicationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.UndeployApplicationRequest"; + }; + + return UndeployApplicationRequest; + })(); + + v1alpha1.ApplicationStreamInput = (function() { + + /** + * Properties of an ApplicationStreamInput. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IApplicationStreamInput + * @property {google.cloud.visionai.v1alpha1.IStreamWithAnnotation|null} [streamWithAnnotation] ApplicationStreamInput streamWithAnnotation + */ + + /** + * Constructs a new ApplicationStreamInput. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents an ApplicationStreamInput. + * @implements IApplicationStreamInput + * @constructor + * @param {google.cloud.visionai.v1alpha1.IApplicationStreamInput=} [properties] Properties to set + */ + function ApplicationStreamInput(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ApplicationStreamInput streamWithAnnotation. + * @member {google.cloud.visionai.v1alpha1.IStreamWithAnnotation|null|undefined} streamWithAnnotation + * @memberof google.cloud.visionai.v1alpha1.ApplicationStreamInput + * @instance + */ + ApplicationStreamInput.prototype.streamWithAnnotation = null; + + /** + * Creates a new ApplicationStreamInput instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ApplicationStreamInput + * @static + * @param {google.cloud.visionai.v1alpha1.IApplicationStreamInput=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ApplicationStreamInput} ApplicationStreamInput instance + */ + ApplicationStreamInput.create = function create(properties) { + return new ApplicationStreamInput(properties); + }; + + /** + * Encodes the specified ApplicationStreamInput message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ApplicationStreamInput.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ApplicationStreamInput + * @static + * @param {google.cloud.visionai.v1alpha1.IApplicationStreamInput} message ApplicationStreamInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApplicationStreamInput.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.streamWithAnnotation != null && Object.hasOwnProperty.call(message, "streamWithAnnotation")) + $root.google.cloud.visionai.v1alpha1.StreamWithAnnotation.encode(message.streamWithAnnotation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ApplicationStreamInput message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ApplicationStreamInput.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ApplicationStreamInput + * @static + * @param {google.cloud.visionai.v1alpha1.IApplicationStreamInput} message ApplicationStreamInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApplicationStreamInput.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApplicationStreamInput message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ApplicationStreamInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ApplicationStreamInput} ApplicationStreamInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApplicationStreamInput.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ApplicationStreamInput(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.streamWithAnnotation = $root.google.cloud.visionai.v1alpha1.StreamWithAnnotation.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ApplicationStreamInput message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ApplicationStreamInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ApplicationStreamInput} ApplicationStreamInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApplicationStreamInput.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApplicationStreamInput message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ApplicationStreamInput + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApplicationStreamInput.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.streamWithAnnotation != null && message.hasOwnProperty("streamWithAnnotation")) { + var error = $root.google.cloud.visionai.v1alpha1.StreamWithAnnotation.verify(message.streamWithAnnotation, long + 1); + if (error) + return "streamWithAnnotation." + error; + } + return null; + }; + + /** + * Creates an ApplicationStreamInput message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ApplicationStreamInput + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ApplicationStreamInput} ApplicationStreamInput + */ + ApplicationStreamInput.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ApplicationStreamInput) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ApplicationStreamInput(); + if (object.streamWithAnnotation != null) { + if (typeof object.streamWithAnnotation !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ApplicationStreamInput.streamWithAnnotation: object expected"); + message.streamWithAnnotation = $root.google.cloud.visionai.v1alpha1.StreamWithAnnotation.fromObject(object.streamWithAnnotation, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an ApplicationStreamInput message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ApplicationStreamInput + * @static + * @param {google.cloud.visionai.v1alpha1.ApplicationStreamInput} message ApplicationStreamInput + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApplicationStreamInput.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.streamWithAnnotation = null; + if (message.streamWithAnnotation != null && message.hasOwnProperty("streamWithAnnotation")) + object.streamWithAnnotation = $root.google.cloud.visionai.v1alpha1.StreamWithAnnotation.toObject(message.streamWithAnnotation, options); + return object; + }; + + /** + * Converts this ApplicationStreamInput to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ApplicationStreamInput + * @instance + * @returns {Object.} JSON object + */ + ApplicationStreamInput.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ApplicationStreamInput + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ApplicationStreamInput + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ApplicationStreamInput.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ApplicationStreamInput"; + }; + + return ApplicationStreamInput; + })(); + + v1alpha1.AddApplicationStreamInputRequest = (function() { + + /** + * Properties of an AddApplicationStreamInputRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IAddApplicationStreamInputRequest + * @property {string|null} [name] AddApplicationStreamInputRequest name + * @property {Array.|null} [applicationStreamInputs] AddApplicationStreamInputRequest applicationStreamInputs + * @property {string|null} [requestId] AddApplicationStreamInputRequest requestId + */ + + /** + * Constructs a new AddApplicationStreamInputRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents an AddApplicationStreamInputRequest. + * @implements IAddApplicationStreamInputRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IAddApplicationStreamInputRequest=} [properties] Properties to set + */ + function AddApplicationStreamInputRequest(properties) { + this.applicationStreamInputs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * AddApplicationStreamInputRequest name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.AddApplicationStreamInputRequest + * @instance + */ + AddApplicationStreamInputRequest.prototype.name = ""; + + /** + * AddApplicationStreamInputRequest applicationStreamInputs. + * @member {Array.} applicationStreamInputs + * @memberof google.cloud.visionai.v1alpha1.AddApplicationStreamInputRequest + * @instance + */ + AddApplicationStreamInputRequest.prototype.applicationStreamInputs = $util.emptyArray; + + /** + * AddApplicationStreamInputRequest requestId. + * @member {string} requestId + * @memberof google.cloud.visionai.v1alpha1.AddApplicationStreamInputRequest + * @instance + */ + AddApplicationStreamInputRequest.prototype.requestId = ""; + + /** + * Creates a new AddApplicationStreamInputRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.AddApplicationStreamInputRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IAddApplicationStreamInputRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.AddApplicationStreamInputRequest} AddApplicationStreamInputRequest instance + */ + AddApplicationStreamInputRequest.create = function create(properties) { + return new AddApplicationStreamInputRequest(properties); + }; + + /** + * Encodes the specified AddApplicationStreamInputRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.AddApplicationStreamInputRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.AddApplicationStreamInputRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IAddApplicationStreamInputRequest} message AddApplicationStreamInputRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddApplicationStreamInputRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.applicationStreamInputs != null && message.applicationStreamInputs.length) + for (var i = 0; i < message.applicationStreamInputs.length; ++i) + $root.google.cloud.visionai.v1alpha1.ApplicationStreamInput.encode(message.applicationStreamInputs[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified AddApplicationStreamInputRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.AddApplicationStreamInputRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.AddApplicationStreamInputRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IAddApplicationStreamInputRequest} message AddApplicationStreamInputRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddApplicationStreamInputRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AddApplicationStreamInputRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.AddApplicationStreamInputRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.AddApplicationStreamInputRequest} AddApplicationStreamInputRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddApplicationStreamInputRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.AddApplicationStreamInputRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.applicationStreamInputs && message.applicationStreamInputs.length)) + message.applicationStreamInputs = []; + message.applicationStreamInputs.push($root.google.cloud.visionai.v1alpha1.ApplicationStreamInput.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an AddApplicationStreamInputRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.AddApplicationStreamInputRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.AddApplicationStreamInputRequest} AddApplicationStreamInputRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddApplicationStreamInputRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AddApplicationStreamInputRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.AddApplicationStreamInputRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AddApplicationStreamInputRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.applicationStreamInputs != null && message.hasOwnProperty("applicationStreamInputs")) { + if (!Array.isArray(message.applicationStreamInputs)) + return "applicationStreamInputs: array expected"; + for (var i = 0; i < message.applicationStreamInputs.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.ApplicationStreamInput.verify(message.applicationStreamInputs[i], long + 1); + if (error) + return "applicationStreamInputs." + error; + } + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an AddApplicationStreamInputRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.AddApplicationStreamInputRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.AddApplicationStreamInputRequest} AddApplicationStreamInputRequest + */ + AddApplicationStreamInputRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.AddApplicationStreamInputRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.AddApplicationStreamInputRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.applicationStreamInputs) { + if (!Array.isArray(object.applicationStreamInputs)) + throw TypeError(".google.cloud.visionai.v1alpha1.AddApplicationStreamInputRequest.applicationStreamInputs: array expected"); + message.applicationStreamInputs = []; + for (var i = 0; i < object.applicationStreamInputs.length; ++i) { + if (typeof object.applicationStreamInputs[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.AddApplicationStreamInputRequest.applicationStreamInputs: object expected"); + message.applicationStreamInputs[i] = $root.google.cloud.visionai.v1alpha1.ApplicationStreamInput.fromObject(object.applicationStreamInputs[i], long + 1); + } + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an AddApplicationStreamInputRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.AddApplicationStreamInputRequest + * @static + * @param {google.cloud.visionai.v1alpha1.AddApplicationStreamInputRequest} message AddApplicationStreamInputRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AddApplicationStreamInputRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.applicationStreamInputs = []; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.applicationStreamInputs && message.applicationStreamInputs.length) { + object.applicationStreamInputs = []; + for (var j = 0; j < message.applicationStreamInputs.length; ++j) + object.applicationStreamInputs[j] = $root.google.cloud.visionai.v1alpha1.ApplicationStreamInput.toObject(message.applicationStreamInputs[j], options); + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this AddApplicationStreamInputRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.AddApplicationStreamInputRequest + * @instance + * @returns {Object.} JSON object + */ + AddApplicationStreamInputRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AddApplicationStreamInputRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.AddApplicationStreamInputRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AddApplicationStreamInputRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.AddApplicationStreamInputRequest"; + }; + + return AddApplicationStreamInputRequest; + })(); + + v1alpha1.UpdateApplicationStreamInputRequest = (function() { + + /** + * Properties of an UpdateApplicationStreamInputRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IUpdateApplicationStreamInputRequest + * @property {string|null} [name] UpdateApplicationStreamInputRequest name + * @property {Array.|null} [applicationStreamInputs] UpdateApplicationStreamInputRequest applicationStreamInputs + * @property {string|null} [requestId] UpdateApplicationStreamInputRequest requestId + * @property {boolean|null} [allowMissing] UpdateApplicationStreamInputRequest allowMissing + */ + + /** + * Constructs a new UpdateApplicationStreamInputRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents an UpdateApplicationStreamInputRequest. + * @implements IUpdateApplicationStreamInputRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IUpdateApplicationStreamInputRequest=} [properties] Properties to set + */ + function UpdateApplicationStreamInputRequest(properties) { + this.applicationStreamInputs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateApplicationStreamInputRequest name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputRequest + * @instance + */ + UpdateApplicationStreamInputRequest.prototype.name = ""; + + /** + * UpdateApplicationStreamInputRequest applicationStreamInputs. + * @member {Array.} applicationStreamInputs + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputRequest + * @instance + */ + UpdateApplicationStreamInputRequest.prototype.applicationStreamInputs = $util.emptyArray; + + /** + * UpdateApplicationStreamInputRequest requestId. + * @member {string} requestId + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputRequest + * @instance + */ + UpdateApplicationStreamInputRequest.prototype.requestId = ""; + + /** + * UpdateApplicationStreamInputRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputRequest + * @instance + */ + UpdateApplicationStreamInputRequest.prototype.allowMissing = false; + + /** + * Creates a new UpdateApplicationStreamInputRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IUpdateApplicationStreamInputRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputRequest} UpdateApplicationStreamInputRequest instance + */ + UpdateApplicationStreamInputRequest.create = function create(properties) { + return new UpdateApplicationStreamInputRequest(properties); + }; + + /** + * Encodes the specified UpdateApplicationStreamInputRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IUpdateApplicationStreamInputRequest} message UpdateApplicationStreamInputRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateApplicationStreamInputRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.applicationStreamInputs != null && message.applicationStreamInputs.length) + for (var i = 0; i < message.applicationStreamInputs.length; ++i) + $root.google.cloud.visionai.v1alpha1.ApplicationStreamInput.encode(message.applicationStreamInputs[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.allowMissing); + return writer; + }; + + /** + * Encodes the specified UpdateApplicationStreamInputRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IUpdateApplicationStreamInputRequest} message UpdateApplicationStreamInputRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateApplicationStreamInputRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateApplicationStreamInputRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputRequest} UpdateApplicationStreamInputRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateApplicationStreamInputRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.applicationStreamInputs && message.applicationStreamInputs.length)) + message.applicationStreamInputs = []; + message.applicationStreamInputs.push($root.google.cloud.visionai.v1alpha1.ApplicationStreamInput.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + case 4: { + message.allowMissing = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateApplicationStreamInputRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputRequest} UpdateApplicationStreamInputRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateApplicationStreamInputRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateApplicationStreamInputRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateApplicationStreamInputRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.applicationStreamInputs != null && message.hasOwnProperty("applicationStreamInputs")) { + if (!Array.isArray(message.applicationStreamInputs)) + return "applicationStreamInputs: array expected"; + for (var i = 0; i < message.applicationStreamInputs.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.ApplicationStreamInput.verify(message.applicationStreamInputs[i], long + 1); + if (error) + return "applicationStreamInputs." + error; + } + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + return null; + }; + + /** + * Creates an UpdateApplicationStreamInputRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputRequest} UpdateApplicationStreamInputRequest + */ + UpdateApplicationStreamInputRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.applicationStreamInputs) { + if (!Array.isArray(object.applicationStreamInputs)) + throw TypeError(".google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputRequest.applicationStreamInputs: array expected"); + message.applicationStreamInputs = []; + for (var i = 0; i < object.applicationStreamInputs.length; ++i) { + if (typeof object.applicationStreamInputs[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputRequest.applicationStreamInputs: object expected"); + message.applicationStreamInputs[i] = $root.google.cloud.visionai.v1alpha1.ApplicationStreamInput.fromObject(object.applicationStreamInputs[i], long + 1); + } + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + return message; + }; + + /** + * Creates a plain object from an UpdateApplicationStreamInputRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputRequest + * @static + * @param {google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputRequest} message UpdateApplicationStreamInputRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateApplicationStreamInputRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.applicationStreamInputs = []; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + object.allowMissing = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.applicationStreamInputs && message.applicationStreamInputs.length) { + object.applicationStreamInputs = []; + for (var j = 0; j < message.applicationStreamInputs.length; ++j) + object.applicationStreamInputs[j] = $root.google.cloud.visionai.v1alpha1.ApplicationStreamInput.toObject(message.applicationStreamInputs[j], options); + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + return object; + }; + + /** + * Converts this UpdateApplicationStreamInputRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateApplicationStreamInputRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateApplicationStreamInputRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateApplicationStreamInputRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputRequest"; + }; + + return UpdateApplicationStreamInputRequest; + })(); + + v1alpha1.RemoveApplicationStreamInputRequest = (function() { + + /** + * Properties of a RemoveApplicationStreamInputRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IRemoveApplicationStreamInputRequest + * @property {string|null} [name] RemoveApplicationStreamInputRequest name + * @property {Array.|null} [targetStreamInputs] RemoveApplicationStreamInputRequest targetStreamInputs + * @property {string|null} [requestId] RemoveApplicationStreamInputRequest requestId + */ + + /** + * Constructs a new RemoveApplicationStreamInputRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a RemoveApplicationStreamInputRequest. + * @implements IRemoveApplicationStreamInputRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IRemoveApplicationStreamInputRequest=} [properties] Properties to set + */ + function RemoveApplicationStreamInputRequest(properties) { + this.targetStreamInputs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * RemoveApplicationStreamInputRequest name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest + * @instance + */ + RemoveApplicationStreamInputRequest.prototype.name = ""; + + /** + * RemoveApplicationStreamInputRequest targetStreamInputs. + * @member {Array.} targetStreamInputs + * @memberof google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest + * @instance + */ + RemoveApplicationStreamInputRequest.prototype.targetStreamInputs = $util.emptyArray; + + /** + * RemoveApplicationStreamInputRequest requestId. + * @member {string} requestId + * @memberof google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest + * @instance + */ + RemoveApplicationStreamInputRequest.prototype.requestId = ""; + + /** + * Creates a new RemoveApplicationStreamInputRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IRemoveApplicationStreamInputRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest} RemoveApplicationStreamInputRequest instance + */ + RemoveApplicationStreamInputRequest.create = function create(properties) { + return new RemoveApplicationStreamInputRequest(properties); + }; + + /** + * Encodes the specified RemoveApplicationStreamInputRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IRemoveApplicationStreamInputRequest} message RemoveApplicationStreamInputRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveApplicationStreamInputRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.targetStreamInputs != null && message.targetStreamInputs.length) + for (var i = 0; i < message.targetStreamInputs.length; ++i) + $root.google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest.TargetStreamInput.encode(message.targetStreamInputs[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified RemoveApplicationStreamInputRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IRemoveApplicationStreamInputRequest} message RemoveApplicationStreamInputRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveApplicationStreamInputRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RemoveApplicationStreamInputRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest} RemoveApplicationStreamInputRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveApplicationStreamInputRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.targetStreamInputs && message.targetStreamInputs.length)) + message.targetStreamInputs = []; + message.targetStreamInputs.push($root.google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest.TargetStreamInput.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a RemoveApplicationStreamInputRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest} RemoveApplicationStreamInputRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveApplicationStreamInputRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RemoveApplicationStreamInputRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RemoveApplicationStreamInputRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.targetStreamInputs != null && message.hasOwnProperty("targetStreamInputs")) { + if (!Array.isArray(message.targetStreamInputs)) + return "targetStreamInputs: array expected"; + for (var i = 0; i < message.targetStreamInputs.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest.TargetStreamInput.verify(message.targetStreamInputs[i], long + 1); + if (error) + return "targetStreamInputs." + error; + } + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a RemoveApplicationStreamInputRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest} RemoveApplicationStreamInputRequest + */ + RemoveApplicationStreamInputRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.targetStreamInputs) { + if (!Array.isArray(object.targetStreamInputs)) + throw TypeError(".google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest.targetStreamInputs: array expected"); + message.targetStreamInputs = []; + for (var i = 0; i < object.targetStreamInputs.length; ++i) { + if (typeof object.targetStreamInputs[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest.targetStreamInputs: object expected"); + message.targetStreamInputs[i] = $root.google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest.TargetStreamInput.fromObject(object.targetStreamInputs[i], long + 1); + } + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a RemoveApplicationStreamInputRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest + * @static + * @param {google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest} message RemoveApplicationStreamInputRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RemoveApplicationStreamInputRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.targetStreamInputs = []; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.targetStreamInputs && message.targetStreamInputs.length) { + object.targetStreamInputs = []; + for (var j = 0; j < message.targetStreamInputs.length; ++j) + object.targetStreamInputs[j] = $root.google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest.TargetStreamInput.toObject(message.targetStreamInputs[j], options); + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this RemoveApplicationStreamInputRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest + * @instance + * @returns {Object.} JSON object + */ + RemoveApplicationStreamInputRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RemoveApplicationStreamInputRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RemoveApplicationStreamInputRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest"; + }; + + RemoveApplicationStreamInputRequest.TargetStreamInput = (function() { + + /** + * Properties of a TargetStreamInput. + * @memberof google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest + * @interface ITargetStreamInput + * @property {string|null} [stream] TargetStreamInput stream + */ + + /** + * Constructs a new TargetStreamInput. + * @memberof google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest + * @classdesc Represents a TargetStreamInput. + * @implements ITargetStreamInput + * @constructor + * @param {google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest.ITargetStreamInput=} [properties] Properties to set + */ + function TargetStreamInput(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetStreamInput stream. + * @member {string} stream + * @memberof google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest.TargetStreamInput + * @instance + */ + TargetStreamInput.prototype.stream = ""; + + /** + * Creates a new TargetStreamInput instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest.TargetStreamInput + * @static + * @param {google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest.ITargetStreamInput=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest.TargetStreamInput} TargetStreamInput instance + */ + TargetStreamInput.create = function create(properties) { + return new TargetStreamInput(properties); + }; + + /** + * Encodes the specified TargetStreamInput message. Does not implicitly {@link google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest.TargetStreamInput.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest.TargetStreamInput + * @static + * @param {google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest.ITargetStreamInput} message TargetStreamInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetStreamInput.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stream != null && Object.hasOwnProperty.call(message, "stream")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.stream); + return writer; + }; + + /** + * Encodes the specified TargetStreamInput message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest.TargetStreamInput.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest.TargetStreamInput + * @static + * @param {google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest.ITargetStreamInput} message TargetStreamInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetStreamInput.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetStreamInput message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest.TargetStreamInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest.TargetStreamInput} TargetStreamInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetStreamInput.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest.TargetStreamInput(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.stream = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TargetStreamInput message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest.TargetStreamInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest.TargetStreamInput} TargetStreamInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetStreamInput.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetStreamInput message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest.TargetStreamInput + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetStreamInput.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.stream != null && message.hasOwnProperty("stream")) + if (!$util.isString(message.stream)) + return "stream: string expected"; + return null; + }; + + /** + * Creates a TargetStreamInput message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest.TargetStreamInput + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest.TargetStreamInput} TargetStreamInput + */ + TargetStreamInput.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest.TargetStreamInput) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest.TargetStreamInput(); + if (object.stream != null) + message.stream = String(object.stream); + return message; + }; + + /** + * Creates a plain object from a TargetStreamInput message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest.TargetStreamInput + * @static + * @param {google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest.TargetStreamInput} message TargetStreamInput + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetStreamInput.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.stream = ""; + if (message.stream != null && message.hasOwnProperty("stream")) + object.stream = message.stream; + return object; + }; + + /** + * Converts this TargetStreamInput to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest.TargetStreamInput + * @instance + * @returns {Object.} JSON object + */ + TargetStreamInput.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TargetStreamInput + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest.TargetStreamInput + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TargetStreamInput.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest.TargetStreamInput"; + }; + + return TargetStreamInput; + })(); + + return RemoveApplicationStreamInputRequest; + })(); + + v1alpha1.ListInstancesRequest = (function() { + + /** + * Properties of a ListInstancesRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IListInstancesRequest + * @property {string|null} [parent] ListInstancesRequest parent + * @property {number|null} [pageSize] ListInstancesRequest pageSize + * @property {string|null} [pageToken] ListInstancesRequest pageToken + * @property {string|null} [filter] ListInstancesRequest filter + * @property {string|null} [orderBy] ListInstancesRequest orderBy + */ + + /** + * Constructs a new ListInstancesRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a ListInstancesRequest. + * @implements IListInstancesRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IListInstancesRequest=} [properties] Properties to set + */ + function ListInstancesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInstancesRequest parent. + * @member {string} parent + * @memberof google.cloud.visionai.v1alpha1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.parent = ""; + + /** + * ListInstancesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.visionai.v1alpha1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.pageSize = 0; + + /** + * ListInstancesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.visionai.v1alpha1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.pageToken = ""; + + /** + * ListInstancesRequest filter. + * @member {string} filter + * @memberof google.cloud.visionai.v1alpha1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.filter = ""; + + /** + * ListInstancesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.visionai.v1alpha1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.orderBy = ""; + + /** + * Creates a new ListInstancesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ListInstancesRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IListInstancesRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ListInstancesRequest} ListInstancesRequest instance + */ + ListInstancesRequest.create = function create(properties) { + return new ListInstancesRequest(properties); + }; + + /** + * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListInstancesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ListInstancesRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IListInstancesRequest} message ListInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListInstancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListInstancesRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IListInstancesRequest} message ListInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ListInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ListInstancesRequest} ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ListInstancesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ListInstancesRequest} ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstancesRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ListInstancesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstancesRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ListInstancesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ListInstancesRequest} ListInstancesRequest + */ + ListInstancesRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ListInstancesRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ListInstancesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ListInstancesRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ListInstancesRequest} message ListInstancesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstancesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListInstancesRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ListInstancesRequest + * @instance + * @returns {Object.} JSON object + */ + ListInstancesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInstancesRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ListInstancesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInstancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ListInstancesRequest"; + }; + + return ListInstancesRequest; + })(); + + v1alpha1.ListInstancesResponse = (function() { + + /** + * Properties of a ListInstancesResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IListInstancesResponse + * @property {Array.|null} [instances] ListInstancesResponse instances + * @property {string|null} [nextPageToken] ListInstancesResponse nextPageToken + * @property {Array.|null} [unreachable] ListInstancesResponse unreachable + */ + + /** + * Constructs a new ListInstancesResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a ListInstancesResponse. + * @implements IListInstancesResponse + * @constructor + * @param {google.cloud.visionai.v1alpha1.IListInstancesResponse=} [properties] Properties to set + */ + function ListInstancesResponse(properties) { + this.instances = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInstancesResponse instances. + * @member {Array.} instances + * @memberof google.cloud.visionai.v1alpha1.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.instances = $util.emptyArray; + + /** + * ListInstancesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.visionai.v1alpha1.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.nextPageToken = ""; + + /** + * ListInstancesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.visionai.v1alpha1.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListInstancesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ListInstancesResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IListInstancesResponse=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ListInstancesResponse} ListInstancesResponse instance + */ + ListInstancesResponse.create = function create(properties) { + return new ListInstancesResponse(properties); + }; + + /** + * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListInstancesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ListInstancesResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IListInstancesResponse} message ListInstancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instances != null && message.instances.length) + for (var i = 0; i < message.instances.length; ++i) + $root.google.cloud.visionai.v1alpha1.Instance.encode(message.instances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListInstancesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListInstancesResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IListInstancesResponse} message ListInstancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ListInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ListInstancesResponse} ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ListInstancesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push($root.google.cloud.visionai.v1alpha1.Instance.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ListInstancesResponse} ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstancesResponse message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ListInstancesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstancesResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.instances != null && message.hasOwnProperty("instances")) { + if (!Array.isArray(message.instances)) + return "instances: array expected"; + for (var i = 0; i < message.instances.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.Instance.verify(message.instances[i], long + 1); + if (error) + return "instances." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ListInstancesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ListInstancesResponse} ListInstancesResponse + */ + ListInstancesResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ListInstancesResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ListInstancesResponse(); + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.cloud.visionai.v1alpha1.ListInstancesResponse.instances: array expected"); + message.instances = []; + for (var i = 0; i < object.instances.length; ++i) { + if (typeof object.instances[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ListInstancesResponse.instances: object expected"); + message.instances[i] = $root.google.cloud.visionai.v1alpha1.Instance.fromObject(object.instances[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.visionai.v1alpha1.ListInstancesResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ListInstancesResponse + * @static + * @param {google.cloud.visionai.v1alpha1.ListInstancesResponse} message ListInstancesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstancesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.instances = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.instances && message.instances.length) { + object.instances = []; + for (var j = 0; j < message.instances.length; ++j) + object.instances[j] = $root.google.cloud.visionai.v1alpha1.Instance.toObject(message.instances[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListInstancesResponse to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ListInstancesResponse + * @instance + * @returns {Object.} JSON object + */ + ListInstancesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInstancesResponse + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ListInstancesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInstancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ListInstancesResponse"; + }; + + return ListInstancesResponse; + })(); + + v1alpha1.GetInstanceRequest = (function() { + + /** + * Properties of a GetInstanceRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IGetInstanceRequest + * @property {string|null} [name] GetInstanceRequest name + */ + + /** + * Constructs a new GetInstanceRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a GetInstanceRequest. + * @implements IGetInstanceRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IGetInstanceRequest=} [properties] Properties to set + */ + function GetInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetInstanceRequest name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.GetInstanceRequest + * @instance + */ + GetInstanceRequest.prototype.name = ""; + + /** + * Creates a new GetInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.GetInstanceRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IGetInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.GetInstanceRequest} GetInstanceRequest instance + */ + GetInstanceRequest.create = function create(properties) { + return new GetInstanceRequest(properties); + }; + + /** + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.GetInstanceRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.GetInstanceRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.GetInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.GetInstanceRequest} GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstanceRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.GetInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.GetInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.GetInstanceRequest} GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetInstanceRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.GetInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetInstanceRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.GetInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.GetInstanceRequest} GetInstanceRequest + */ + GetInstanceRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.GetInstanceRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.GetInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.GetInstanceRequest + * @static + * @param {google.cloud.visionai.v1alpha1.GetInstanceRequest} message GetInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.GetInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + GetInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.GetInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.GetInstanceRequest"; + }; + + return GetInstanceRequest; + })(); + + v1alpha1.ListDraftsRequest = (function() { + + /** + * Properties of a ListDraftsRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IListDraftsRequest + * @property {string|null} [parent] ListDraftsRequest parent + * @property {number|null} [pageSize] ListDraftsRequest pageSize + * @property {string|null} [pageToken] ListDraftsRequest pageToken + * @property {string|null} [filter] ListDraftsRequest filter + * @property {string|null} [orderBy] ListDraftsRequest orderBy + */ + + /** + * Constructs a new ListDraftsRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a ListDraftsRequest. + * @implements IListDraftsRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IListDraftsRequest=} [properties] Properties to set + */ + function ListDraftsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDraftsRequest parent. + * @member {string} parent + * @memberof google.cloud.visionai.v1alpha1.ListDraftsRequest + * @instance + */ + ListDraftsRequest.prototype.parent = ""; + + /** + * ListDraftsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.visionai.v1alpha1.ListDraftsRequest + * @instance + */ + ListDraftsRequest.prototype.pageSize = 0; + + /** + * ListDraftsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.visionai.v1alpha1.ListDraftsRequest + * @instance + */ + ListDraftsRequest.prototype.pageToken = ""; + + /** + * ListDraftsRequest filter. + * @member {string} filter + * @memberof google.cloud.visionai.v1alpha1.ListDraftsRequest + * @instance + */ + ListDraftsRequest.prototype.filter = ""; + + /** + * ListDraftsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.visionai.v1alpha1.ListDraftsRequest + * @instance + */ + ListDraftsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListDraftsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ListDraftsRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IListDraftsRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ListDraftsRequest} ListDraftsRequest instance + */ + ListDraftsRequest.create = function create(properties) { + return new ListDraftsRequest(properties); + }; + + /** + * Encodes the specified ListDraftsRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListDraftsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ListDraftsRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IListDraftsRequest} message ListDraftsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDraftsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListDraftsRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListDraftsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListDraftsRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IListDraftsRequest} message ListDraftsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDraftsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDraftsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ListDraftsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ListDraftsRequest} ListDraftsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDraftsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ListDraftsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListDraftsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListDraftsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ListDraftsRequest} ListDraftsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDraftsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDraftsRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ListDraftsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDraftsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListDraftsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ListDraftsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ListDraftsRequest} ListDraftsRequest + */ + ListDraftsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ListDraftsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ListDraftsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListDraftsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ListDraftsRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ListDraftsRequest} message ListDraftsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDraftsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListDraftsRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ListDraftsRequest + * @instance + * @returns {Object.} JSON object + */ + ListDraftsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDraftsRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ListDraftsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDraftsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ListDraftsRequest"; + }; + + return ListDraftsRequest; + })(); + + v1alpha1.ListDraftsResponse = (function() { + + /** + * Properties of a ListDraftsResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IListDraftsResponse + * @property {Array.|null} [drafts] ListDraftsResponse drafts + * @property {string|null} [nextPageToken] ListDraftsResponse nextPageToken + * @property {Array.|null} [unreachable] ListDraftsResponse unreachable + */ + + /** + * Constructs a new ListDraftsResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a ListDraftsResponse. + * @implements IListDraftsResponse + * @constructor + * @param {google.cloud.visionai.v1alpha1.IListDraftsResponse=} [properties] Properties to set + */ + function ListDraftsResponse(properties) { + this.drafts = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDraftsResponse drafts. + * @member {Array.} drafts + * @memberof google.cloud.visionai.v1alpha1.ListDraftsResponse + * @instance + */ + ListDraftsResponse.prototype.drafts = $util.emptyArray; + + /** + * ListDraftsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.visionai.v1alpha1.ListDraftsResponse + * @instance + */ + ListDraftsResponse.prototype.nextPageToken = ""; + + /** + * ListDraftsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.visionai.v1alpha1.ListDraftsResponse + * @instance + */ + ListDraftsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListDraftsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ListDraftsResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IListDraftsResponse=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ListDraftsResponse} ListDraftsResponse instance + */ + ListDraftsResponse.create = function create(properties) { + return new ListDraftsResponse(properties); + }; + + /** + * Encodes the specified ListDraftsResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListDraftsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ListDraftsResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IListDraftsResponse} message ListDraftsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDraftsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.drafts != null && message.drafts.length) + for (var i = 0; i < message.drafts.length; ++i) + $root.google.cloud.visionai.v1alpha1.Draft.encode(message.drafts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListDraftsResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListDraftsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListDraftsResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IListDraftsResponse} message ListDraftsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDraftsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDraftsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ListDraftsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ListDraftsResponse} ListDraftsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDraftsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ListDraftsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.drafts && message.drafts.length)) + message.drafts = []; + message.drafts.push($root.google.cloud.visionai.v1alpha1.Draft.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListDraftsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListDraftsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ListDraftsResponse} ListDraftsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDraftsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDraftsResponse message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ListDraftsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDraftsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.drafts != null && message.hasOwnProperty("drafts")) { + if (!Array.isArray(message.drafts)) + return "drafts: array expected"; + for (var i = 0; i < message.drafts.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.Draft.verify(message.drafts[i], long + 1); + if (error) + return "drafts." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListDraftsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ListDraftsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ListDraftsResponse} ListDraftsResponse + */ + ListDraftsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ListDraftsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ListDraftsResponse(); + if (object.drafts) { + if (!Array.isArray(object.drafts)) + throw TypeError(".google.cloud.visionai.v1alpha1.ListDraftsResponse.drafts: array expected"); + message.drafts = []; + for (var i = 0; i < object.drafts.length; ++i) { + if (typeof object.drafts[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ListDraftsResponse.drafts: object expected"); + message.drafts[i] = $root.google.cloud.visionai.v1alpha1.Draft.fromObject(object.drafts[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.visionai.v1alpha1.ListDraftsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListDraftsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ListDraftsResponse + * @static + * @param {google.cloud.visionai.v1alpha1.ListDraftsResponse} message ListDraftsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDraftsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.drafts = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.drafts && message.drafts.length) { + object.drafts = []; + for (var j = 0; j < message.drafts.length; ++j) + object.drafts[j] = $root.google.cloud.visionai.v1alpha1.Draft.toObject(message.drafts[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListDraftsResponse to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ListDraftsResponse + * @instance + * @returns {Object.} JSON object + */ + ListDraftsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDraftsResponse + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ListDraftsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDraftsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ListDraftsResponse"; + }; + + return ListDraftsResponse; + })(); + + v1alpha1.GetDraftRequest = (function() { + + /** + * Properties of a GetDraftRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IGetDraftRequest + * @property {string|null} [name] GetDraftRequest name + */ + + /** + * Constructs a new GetDraftRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a GetDraftRequest. + * @implements IGetDraftRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IGetDraftRequest=} [properties] Properties to set + */ + function GetDraftRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDraftRequest name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.GetDraftRequest + * @instance + */ + GetDraftRequest.prototype.name = ""; + + /** + * Creates a new GetDraftRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.GetDraftRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IGetDraftRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.GetDraftRequest} GetDraftRequest instance + */ + GetDraftRequest.create = function create(properties) { + return new GetDraftRequest(properties); + }; + + /** + * Encodes the specified GetDraftRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetDraftRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.GetDraftRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IGetDraftRequest} message GetDraftRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDraftRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetDraftRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetDraftRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.GetDraftRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IGetDraftRequest} message GetDraftRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDraftRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDraftRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.GetDraftRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.GetDraftRequest} GetDraftRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDraftRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.GetDraftRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetDraftRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.GetDraftRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.GetDraftRequest} GetDraftRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDraftRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDraftRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.GetDraftRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDraftRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetDraftRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.GetDraftRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.GetDraftRequest} GetDraftRequest + */ + GetDraftRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.GetDraftRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.GetDraftRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetDraftRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.GetDraftRequest + * @static + * @param {google.cloud.visionai.v1alpha1.GetDraftRequest} message GetDraftRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDraftRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetDraftRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.GetDraftRequest + * @instance + * @returns {Object.} JSON object + */ + GetDraftRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetDraftRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.GetDraftRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetDraftRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.GetDraftRequest"; + }; + + return GetDraftRequest; + })(); + + v1alpha1.CreateDraftRequest = (function() { + + /** + * Properties of a CreateDraftRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface ICreateDraftRequest + * @property {string|null} [parent] CreateDraftRequest parent + * @property {string|null} [draftId] CreateDraftRequest draftId + * @property {google.cloud.visionai.v1alpha1.IDraft|null} [draft] CreateDraftRequest draft + * @property {string|null} [requestId] CreateDraftRequest requestId + */ + + /** + * Constructs a new CreateDraftRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a CreateDraftRequest. + * @implements ICreateDraftRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.ICreateDraftRequest=} [properties] Properties to set + */ + function CreateDraftRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateDraftRequest parent. + * @member {string} parent + * @memberof google.cloud.visionai.v1alpha1.CreateDraftRequest + * @instance + */ + CreateDraftRequest.prototype.parent = ""; + + /** + * CreateDraftRequest draftId. + * @member {string} draftId + * @memberof google.cloud.visionai.v1alpha1.CreateDraftRequest + * @instance + */ + CreateDraftRequest.prototype.draftId = ""; + + /** + * CreateDraftRequest draft. + * @member {google.cloud.visionai.v1alpha1.IDraft|null|undefined} draft + * @memberof google.cloud.visionai.v1alpha1.CreateDraftRequest + * @instance + */ + CreateDraftRequest.prototype.draft = null; + + /** + * CreateDraftRequest requestId. + * @member {string} requestId + * @memberof google.cloud.visionai.v1alpha1.CreateDraftRequest + * @instance + */ + CreateDraftRequest.prototype.requestId = ""; + + /** + * Creates a new CreateDraftRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.CreateDraftRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ICreateDraftRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.CreateDraftRequest} CreateDraftRequest instance + */ + CreateDraftRequest.create = function create(properties) { + return new CreateDraftRequest(properties); + }; + + /** + * Encodes the specified CreateDraftRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateDraftRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.CreateDraftRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ICreateDraftRequest} message CreateDraftRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDraftRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.draftId != null && Object.hasOwnProperty.call(message, "draftId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.draftId); + if (message.draft != null && Object.hasOwnProperty.call(message, "draft")) + $root.google.cloud.visionai.v1alpha1.Draft.encode(message.draft, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateDraftRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateDraftRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.CreateDraftRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ICreateDraftRequest} message CreateDraftRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDraftRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateDraftRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.CreateDraftRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.CreateDraftRequest} CreateDraftRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDraftRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.CreateDraftRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.draftId = reader.string(); + break; + } + case 3: { + message.draft = $root.google.cloud.visionai.v1alpha1.Draft.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreateDraftRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.CreateDraftRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.CreateDraftRequest} CreateDraftRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDraftRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateDraftRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.CreateDraftRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateDraftRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.draftId != null && message.hasOwnProperty("draftId")) + if (!$util.isString(message.draftId)) + return "draftId: string expected"; + if (message.draft != null && message.hasOwnProperty("draft")) { + var error = $root.google.cloud.visionai.v1alpha1.Draft.verify(message.draft, long + 1); + if (error) + return "draft." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateDraftRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.CreateDraftRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.CreateDraftRequest} CreateDraftRequest + */ + CreateDraftRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.CreateDraftRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.CreateDraftRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.draftId != null) + message.draftId = String(object.draftId); + if (object.draft != null) { + if (typeof object.draft !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.CreateDraftRequest.draft: object expected"); + message.draft = $root.google.cloud.visionai.v1alpha1.Draft.fromObject(object.draft, long + 1); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateDraftRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.CreateDraftRequest + * @static + * @param {google.cloud.visionai.v1alpha1.CreateDraftRequest} message CreateDraftRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateDraftRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.draftId = ""; + object.draft = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.draftId != null && message.hasOwnProperty("draftId")) + object.draftId = message.draftId; + if (message.draft != null && message.hasOwnProperty("draft")) + object.draft = $root.google.cloud.visionai.v1alpha1.Draft.toObject(message.draft, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateDraftRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.CreateDraftRequest + * @instance + * @returns {Object.} JSON object + */ + CreateDraftRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateDraftRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.CreateDraftRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateDraftRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.CreateDraftRequest"; + }; + + return CreateDraftRequest; + })(); + + v1alpha1.UpdateDraftRequest = (function() { + + /** + * Properties of an UpdateDraftRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IUpdateDraftRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateDraftRequest updateMask + * @property {google.cloud.visionai.v1alpha1.IDraft|null} [draft] UpdateDraftRequest draft + * @property {string|null} [requestId] UpdateDraftRequest requestId + * @property {boolean|null} [allowMissing] UpdateDraftRequest allowMissing + */ + + /** + * Constructs a new UpdateDraftRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents an UpdateDraftRequest. + * @implements IUpdateDraftRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IUpdateDraftRequest=} [properties] Properties to set + */ + function UpdateDraftRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateDraftRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.visionai.v1alpha1.UpdateDraftRequest + * @instance + */ + UpdateDraftRequest.prototype.updateMask = null; + + /** + * UpdateDraftRequest draft. + * @member {google.cloud.visionai.v1alpha1.IDraft|null|undefined} draft + * @memberof google.cloud.visionai.v1alpha1.UpdateDraftRequest + * @instance + */ + UpdateDraftRequest.prototype.draft = null; + + /** + * UpdateDraftRequest requestId. + * @member {string} requestId + * @memberof google.cloud.visionai.v1alpha1.UpdateDraftRequest + * @instance + */ + UpdateDraftRequest.prototype.requestId = ""; + + /** + * UpdateDraftRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.visionai.v1alpha1.UpdateDraftRequest + * @instance + */ + UpdateDraftRequest.prototype.allowMissing = false; + + /** + * Creates a new UpdateDraftRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.UpdateDraftRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IUpdateDraftRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.UpdateDraftRequest} UpdateDraftRequest instance + */ + UpdateDraftRequest.create = function create(properties) { + return new UpdateDraftRequest(properties); + }; + + /** + * Encodes the specified UpdateDraftRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateDraftRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.UpdateDraftRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IUpdateDraftRequest} message UpdateDraftRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDraftRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.draft != null && Object.hasOwnProperty.call(message, "draft")) + $root.google.cloud.visionai.v1alpha1.Draft.encode(message.draft, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.allowMissing); + return writer; + }; + + /** + * Encodes the specified UpdateDraftRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateDraftRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.UpdateDraftRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IUpdateDraftRequest} message UpdateDraftRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDraftRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateDraftRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.UpdateDraftRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.UpdateDraftRequest} UpdateDraftRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDraftRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.UpdateDraftRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.draft = $root.google.cloud.visionai.v1alpha1.Draft.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + case 4: { + message.allowMissing = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateDraftRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.UpdateDraftRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.UpdateDraftRequest} UpdateDraftRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDraftRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateDraftRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.UpdateDraftRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateDraftRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + if (message.draft != null && message.hasOwnProperty("draft")) { + var error = $root.google.cloud.visionai.v1alpha1.Draft.verify(message.draft, long + 1); + if (error) + return "draft." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + return null; + }; + + /** + * Creates an UpdateDraftRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.UpdateDraftRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.UpdateDraftRequest} UpdateDraftRequest + */ + UpdateDraftRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.UpdateDraftRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.UpdateDraftRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.UpdateDraftRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + if (object.draft != null) { + if (typeof object.draft !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.UpdateDraftRequest.draft: object expected"); + message.draft = $root.google.cloud.visionai.v1alpha1.Draft.fromObject(object.draft, long + 1); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + return message; + }; + + /** + * Creates a plain object from an UpdateDraftRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.UpdateDraftRequest + * @static + * @param {google.cloud.visionai.v1alpha1.UpdateDraftRequest} message UpdateDraftRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateDraftRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.draft = null; + object.requestId = ""; + object.allowMissing = false; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.draft != null && message.hasOwnProperty("draft")) + object.draft = $root.google.cloud.visionai.v1alpha1.Draft.toObject(message.draft, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + return object; + }; + + /** + * Converts this UpdateDraftRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.UpdateDraftRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateDraftRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateDraftRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.UpdateDraftRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateDraftRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.UpdateDraftRequest"; + }; + + return UpdateDraftRequest; + })(); + + v1alpha1.UpdateApplicationInstancesRequest = (function() { + + /** + * Properties of an UpdateApplicationInstancesRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IUpdateApplicationInstancesRequest + * @property {string|null} [name] UpdateApplicationInstancesRequest name + * @property {Array.|null} [applicationInstances] UpdateApplicationInstancesRequest applicationInstances + * @property {string|null} [requestId] UpdateApplicationInstancesRequest requestId + * @property {boolean|null} [allowMissing] UpdateApplicationInstancesRequest allowMissing + */ + + /** + * Constructs a new UpdateApplicationInstancesRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents an UpdateApplicationInstancesRequest. + * @implements IUpdateApplicationInstancesRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IUpdateApplicationInstancesRequest=} [properties] Properties to set + */ + function UpdateApplicationInstancesRequest(properties) { + this.applicationInstances = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateApplicationInstancesRequest name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest + * @instance + */ + UpdateApplicationInstancesRequest.prototype.name = ""; + + /** + * UpdateApplicationInstancesRequest applicationInstances. + * @member {Array.} applicationInstances + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest + * @instance + */ + UpdateApplicationInstancesRequest.prototype.applicationInstances = $util.emptyArray; + + /** + * UpdateApplicationInstancesRequest requestId. + * @member {string} requestId + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest + * @instance + */ + UpdateApplicationInstancesRequest.prototype.requestId = ""; + + /** + * UpdateApplicationInstancesRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest + * @instance + */ + UpdateApplicationInstancesRequest.prototype.allowMissing = false; + + /** + * Creates a new UpdateApplicationInstancesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IUpdateApplicationInstancesRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest} UpdateApplicationInstancesRequest instance + */ + UpdateApplicationInstancesRequest.create = function create(properties) { + return new UpdateApplicationInstancesRequest(properties); + }; + + /** + * Encodes the specified UpdateApplicationInstancesRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IUpdateApplicationInstancesRequest} message UpdateApplicationInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateApplicationInstancesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.applicationInstances != null && message.applicationInstances.length) + for (var i = 0; i < message.applicationInstances.length; ++i) + $root.google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest.UpdateApplicationInstance.encode(message.applicationInstances[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.allowMissing); + return writer; + }; + + /** + * Encodes the specified UpdateApplicationInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IUpdateApplicationInstancesRequest} message UpdateApplicationInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateApplicationInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateApplicationInstancesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest} UpdateApplicationInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateApplicationInstancesRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.applicationInstances && message.applicationInstances.length)) + message.applicationInstances = []; + message.applicationInstances.push($root.google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest.UpdateApplicationInstance.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + case 4: { + message.allowMissing = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateApplicationInstancesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest} UpdateApplicationInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateApplicationInstancesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateApplicationInstancesRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateApplicationInstancesRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.applicationInstances != null && message.hasOwnProperty("applicationInstances")) { + if (!Array.isArray(message.applicationInstances)) + return "applicationInstances: array expected"; + for (var i = 0; i < message.applicationInstances.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest.UpdateApplicationInstance.verify(message.applicationInstances[i], long + 1); + if (error) + return "applicationInstances." + error; + } + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + return null; + }; + + /** + * Creates an UpdateApplicationInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest} UpdateApplicationInstancesRequest + */ + UpdateApplicationInstancesRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.applicationInstances) { + if (!Array.isArray(object.applicationInstances)) + throw TypeError(".google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest.applicationInstances: array expected"); + message.applicationInstances = []; + for (var i = 0; i < object.applicationInstances.length; ++i) { + if (typeof object.applicationInstances[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest.applicationInstances: object expected"); + message.applicationInstances[i] = $root.google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest.UpdateApplicationInstance.fromObject(object.applicationInstances[i], long + 1); + } + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + return message; + }; + + /** + * Creates a plain object from an UpdateApplicationInstancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest + * @static + * @param {google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest} message UpdateApplicationInstancesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateApplicationInstancesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.applicationInstances = []; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + object.allowMissing = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.applicationInstances && message.applicationInstances.length) { + object.applicationInstances = []; + for (var j = 0; j < message.applicationInstances.length; ++j) + object.applicationInstances[j] = $root.google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest.UpdateApplicationInstance.toObject(message.applicationInstances[j], options); + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + return object; + }; + + /** + * Converts this UpdateApplicationInstancesRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateApplicationInstancesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateApplicationInstancesRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateApplicationInstancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest"; + }; + + UpdateApplicationInstancesRequest.UpdateApplicationInstance = (function() { + + /** + * Properties of an UpdateApplicationInstance. + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest + * @interface IUpdateApplicationInstance + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateApplicationInstance updateMask + * @property {google.cloud.visionai.v1alpha1.IInstance|null} [instance] UpdateApplicationInstance instance + * @property {string|null} [instanceId] UpdateApplicationInstance instanceId + */ + + /** + * Constructs a new UpdateApplicationInstance. + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest + * @classdesc Represents an UpdateApplicationInstance. + * @implements IUpdateApplicationInstance + * @constructor + * @param {google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest.IUpdateApplicationInstance=} [properties] Properties to set + */ + function UpdateApplicationInstance(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateApplicationInstance updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest.UpdateApplicationInstance + * @instance + */ + UpdateApplicationInstance.prototype.updateMask = null; + + /** + * UpdateApplicationInstance instance. + * @member {google.cloud.visionai.v1alpha1.IInstance|null|undefined} instance + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest.UpdateApplicationInstance + * @instance + */ + UpdateApplicationInstance.prototype.instance = null; + + /** + * UpdateApplicationInstance instanceId. + * @member {string} instanceId + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest.UpdateApplicationInstance + * @instance + */ + UpdateApplicationInstance.prototype.instanceId = ""; + + /** + * Creates a new UpdateApplicationInstance instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest.UpdateApplicationInstance + * @static + * @param {google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest.IUpdateApplicationInstance=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest.UpdateApplicationInstance} UpdateApplicationInstance instance + */ + UpdateApplicationInstance.create = function create(properties) { + return new UpdateApplicationInstance(properties); + }; + + /** + * Encodes the specified UpdateApplicationInstance message. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest.UpdateApplicationInstance.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest.UpdateApplicationInstance + * @static + * @param {google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest.IUpdateApplicationInstance} message UpdateApplicationInstance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateApplicationInstance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + $root.google.cloud.visionai.v1alpha1.Instance.encode(message.instance, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.instanceId); + return writer; + }; + + /** + * Encodes the specified UpdateApplicationInstance message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest.UpdateApplicationInstance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest.UpdateApplicationInstance + * @static + * @param {google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest.IUpdateApplicationInstance} message UpdateApplicationInstance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateApplicationInstance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateApplicationInstance message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest.UpdateApplicationInstance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest.UpdateApplicationInstance} UpdateApplicationInstance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateApplicationInstance.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest.UpdateApplicationInstance(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.instance = $root.google.cloud.visionai.v1alpha1.Instance.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.instanceId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateApplicationInstance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest.UpdateApplicationInstance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest.UpdateApplicationInstance} UpdateApplicationInstance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateApplicationInstance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateApplicationInstance message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest.UpdateApplicationInstance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateApplicationInstance.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + if (message.instance != null && message.hasOwnProperty("instance")) { + var error = $root.google.cloud.visionai.v1alpha1.Instance.verify(message.instance, long + 1); + if (error) + return "instance." + error; + } + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (!$util.isString(message.instanceId)) + return "instanceId: string expected"; + return null; + }; + + /** + * Creates an UpdateApplicationInstance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest.UpdateApplicationInstance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest.UpdateApplicationInstance} UpdateApplicationInstance + */ + UpdateApplicationInstance.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest.UpdateApplicationInstance) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest.UpdateApplicationInstance(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest.UpdateApplicationInstance.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + if (object.instance != null) { + if (typeof object.instance !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest.UpdateApplicationInstance.instance: object expected"); + message.instance = $root.google.cloud.visionai.v1alpha1.Instance.fromObject(object.instance, long + 1); + } + if (object.instanceId != null) + message.instanceId = String(object.instanceId); + return message; + }; + + /** + * Creates a plain object from an UpdateApplicationInstance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest.UpdateApplicationInstance + * @static + * @param {google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest.UpdateApplicationInstance} message UpdateApplicationInstance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateApplicationInstance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.instance = null; + object.instanceId = ""; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = $root.google.cloud.visionai.v1alpha1.Instance.toObject(message.instance, options); + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + object.instanceId = message.instanceId; + return object; + }; + + /** + * Converts this UpdateApplicationInstance to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest.UpdateApplicationInstance + * @instance + * @returns {Object.} JSON object + */ + UpdateApplicationInstance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateApplicationInstance + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest.UpdateApplicationInstance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateApplicationInstance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest.UpdateApplicationInstance"; + }; + + return UpdateApplicationInstance; + })(); + + return UpdateApplicationInstancesRequest; + })(); + + v1alpha1.DeleteDraftRequest = (function() { + + /** + * Properties of a DeleteDraftRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IDeleteDraftRequest + * @property {string|null} [name] DeleteDraftRequest name + * @property {string|null} [requestId] DeleteDraftRequest requestId + */ + + /** + * Constructs a new DeleteDraftRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a DeleteDraftRequest. + * @implements IDeleteDraftRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IDeleteDraftRequest=} [properties] Properties to set + */ + function DeleteDraftRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteDraftRequest name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.DeleteDraftRequest + * @instance + */ + DeleteDraftRequest.prototype.name = ""; + + /** + * DeleteDraftRequest requestId. + * @member {string} requestId + * @memberof google.cloud.visionai.v1alpha1.DeleteDraftRequest + * @instance + */ + DeleteDraftRequest.prototype.requestId = ""; + + /** + * Creates a new DeleteDraftRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.DeleteDraftRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IDeleteDraftRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.DeleteDraftRequest} DeleteDraftRequest instance + */ + DeleteDraftRequest.create = function create(properties) { + return new DeleteDraftRequest(properties); + }; + + /** + * Encodes the specified DeleteDraftRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteDraftRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.DeleteDraftRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IDeleteDraftRequest} message DeleteDraftRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDraftRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified DeleteDraftRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteDraftRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.DeleteDraftRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IDeleteDraftRequest} message DeleteDraftRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDraftRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteDraftRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.DeleteDraftRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.DeleteDraftRequest} DeleteDraftRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDraftRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.DeleteDraftRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteDraftRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.DeleteDraftRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.DeleteDraftRequest} DeleteDraftRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDraftRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteDraftRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.DeleteDraftRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteDraftRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a DeleteDraftRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.DeleteDraftRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.DeleteDraftRequest} DeleteDraftRequest + */ + DeleteDraftRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.DeleteDraftRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.DeleteDraftRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteDraftRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.DeleteDraftRequest + * @static + * @param {google.cloud.visionai.v1alpha1.DeleteDraftRequest} message DeleteDraftRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteDraftRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this DeleteDraftRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.DeleteDraftRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteDraftRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteDraftRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.DeleteDraftRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteDraftRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.DeleteDraftRequest"; + }; + + return DeleteDraftRequest; + })(); + + v1alpha1.ListProcessorsRequest = (function() { + + /** + * Properties of a ListProcessorsRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IListProcessorsRequest + * @property {string|null} [parent] ListProcessorsRequest parent + * @property {number|null} [pageSize] ListProcessorsRequest pageSize + * @property {string|null} [pageToken] ListProcessorsRequest pageToken + * @property {string|null} [filter] ListProcessorsRequest filter + * @property {string|null} [orderBy] ListProcessorsRequest orderBy + */ + + /** + * Constructs a new ListProcessorsRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a ListProcessorsRequest. + * @implements IListProcessorsRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IListProcessorsRequest=} [properties] Properties to set + */ + function ListProcessorsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListProcessorsRequest parent. + * @member {string} parent + * @memberof google.cloud.visionai.v1alpha1.ListProcessorsRequest + * @instance + */ + ListProcessorsRequest.prototype.parent = ""; + + /** + * ListProcessorsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.visionai.v1alpha1.ListProcessorsRequest + * @instance + */ + ListProcessorsRequest.prototype.pageSize = 0; + + /** + * ListProcessorsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.visionai.v1alpha1.ListProcessorsRequest + * @instance + */ + ListProcessorsRequest.prototype.pageToken = ""; + + /** + * ListProcessorsRequest filter. + * @member {string} filter + * @memberof google.cloud.visionai.v1alpha1.ListProcessorsRequest + * @instance + */ + ListProcessorsRequest.prototype.filter = ""; + + /** + * ListProcessorsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.visionai.v1alpha1.ListProcessorsRequest + * @instance + */ + ListProcessorsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListProcessorsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ListProcessorsRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IListProcessorsRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ListProcessorsRequest} ListProcessorsRequest instance + */ + ListProcessorsRequest.create = function create(properties) { + return new ListProcessorsRequest(properties); + }; + + /** + * Encodes the specified ListProcessorsRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListProcessorsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ListProcessorsRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IListProcessorsRequest} message ListProcessorsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProcessorsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListProcessorsRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListProcessorsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListProcessorsRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IListProcessorsRequest} message ListProcessorsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProcessorsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListProcessorsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ListProcessorsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ListProcessorsRequest} ListProcessorsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProcessorsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ListProcessorsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListProcessorsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListProcessorsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ListProcessorsRequest} ListProcessorsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProcessorsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListProcessorsRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ListProcessorsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListProcessorsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListProcessorsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ListProcessorsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ListProcessorsRequest} ListProcessorsRequest + */ + ListProcessorsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ListProcessorsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ListProcessorsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListProcessorsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ListProcessorsRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ListProcessorsRequest} message ListProcessorsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListProcessorsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListProcessorsRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ListProcessorsRequest + * @instance + * @returns {Object.} JSON object + */ + ListProcessorsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListProcessorsRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ListProcessorsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListProcessorsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ListProcessorsRequest"; + }; + + return ListProcessorsRequest; + })(); + + v1alpha1.ListProcessorsResponse = (function() { + + /** + * Properties of a ListProcessorsResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IListProcessorsResponse + * @property {Array.|null} [processors] ListProcessorsResponse processors + * @property {string|null} [nextPageToken] ListProcessorsResponse nextPageToken + * @property {Array.|null} [unreachable] ListProcessorsResponse unreachable + */ + + /** + * Constructs a new ListProcessorsResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a ListProcessorsResponse. + * @implements IListProcessorsResponse + * @constructor + * @param {google.cloud.visionai.v1alpha1.IListProcessorsResponse=} [properties] Properties to set + */ + function ListProcessorsResponse(properties) { + this.processors = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListProcessorsResponse processors. + * @member {Array.} processors + * @memberof google.cloud.visionai.v1alpha1.ListProcessorsResponse + * @instance + */ + ListProcessorsResponse.prototype.processors = $util.emptyArray; + + /** + * ListProcessorsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.visionai.v1alpha1.ListProcessorsResponse + * @instance + */ + ListProcessorsResponse.prototype.nextPageToken = ""; + + /** + * ListProcessorsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.visionai.v1alpha1.ListProcessorsResponse + * @instance + */ + ListProcessorsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListProcessorsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ListProcessorsResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IListProcessorsResponse=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ListProcessorsResponse} ListProcessorsResponse instance + */ + ListProcessorsResponse.create = function create(properties) { + return new ListProcessorsResponse(properties); + }; + + /** + * Encodes the specified ListProcessorsResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListProcessorsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ListProcessorsResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IListProcessorsResponse} message ListProcessorsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProcessorsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.processors != null && message.processors.length) + for (var i = 0; i < message.processors.length; ++i) + $root.google.cloud.visionai.v1alpha1.Processor.encode(message.processors[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListProcessorsResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListProcessorsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListProcessorsResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IListProcessorsResponse} message ListProcessorsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProcessorsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListProcessorsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ListProcessorsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ListProcessorsResponse} ListProcessorsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProcessorsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ListProcessorsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.processors && message.processors.length)) + message.processors = []; + message.processors.push($root.google.cloud.visionai.v1alpha1.Processor.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListProcessorsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListProcessorsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ListProcessorsResponse} ListProcessorsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProcessorsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListProcessorsResponse message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ListProcessorsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListProcessorsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.processors != null && message.hasOwnProperty("processors")) { + if (!Array.isArray(message.processors)) + return "processors: array expected"; + for (var i = 0; i < message.processors.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.Processor.verify(message.processors[i], long + 1); + if (error) + return "processors." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListProcessorsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ListProcessorsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ListProcessorsResponse} ListProcessorsResponse + */ + ListProcessorsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ListProcessorsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ListProcessorsResponse(); + if (object.processors) { + if (!Array.isArray(object.processors)) + throw TypeError(".google.cloud.visionai.v1alpha1.ListProcessorsResponse.processors: array expected"); + message.processors = []; + for (var i = 0; i < object.processors.length; ++i) { + if (typeof object.processors[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ListProcessorsResponse.processors: object expected"); + message.processors[i] = $root.google.cloud.visionai.v1alpha1.Processor.fromObject(object.processors[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.visionai.v1alpha1.ListProcessorsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListProcessorsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ListProcessorsResponse + * @static + * @param {google.cloud.visionai.v1alpha1.ListProcessorsResponse} message ListProcessorsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListProcessorsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.processors = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.processors && message.processors.length) { + object.processors = []; + for (var j = 0; j < message.processors.length; ++j) + object.processors[j] = $root.google.cloud.visionai.v1alpha1.Processor.toObject(message.processors[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListProcessorsResponse to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ListProcessorsResponse + * @instance + * @returns {Object.} JSON object + */ + ListProcessorsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListProcessorsResponse + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ListProcessorsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListProcessorsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ListProcessorsResponse"; + }; + + return ListProcessorsResponse; + })(); + + v1alpha1.ListPrebuiltProcessorsRequest = (function() { + + /** + * Properties of a ListPrebuiltProcessorsRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IListPrebuiltProcessorsRequest + * @property {string|null} [parent] ListPrebuiltProcessorsRequest parent + */ + + /** + * Constructs a new ListPrebuiltProcessorsRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a ListPrebuiltProcessorsRequest. + * @implements IListPrebuiltProcessorsRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IListPrebuiltProcessorsRequest=} [properties] Properties to set + */ + function ListPrebuiltProcessorsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPrebuiltProcessorsRequest parent. + * @member {string} parent + * @memberof google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsRequest + * @instance + */ + ListPrebuiltProcessorsRequest.prototype.parent = ""; + + /** + * Creates a new ListPrebuiltProcessorsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IListPrebuiltProcessorsRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsRequest} ListPrebuiltProcessorsRequest instance + */ + ListPrebuiltProcessorsRequest.create = function create(properties) { + return new ListPrebuiltProcessorsRequest(properties); + }; + + /** + * Encodes the specified ListPrebuiltProcessorsRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IListPrebuiltProcessorsRequest} message ListPrebuiltProcessorsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPrebuiltProcessorsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + return writer; + }; + + /** + * Encodes the specified ListPrebuiltProcessorsRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IListPrebuiltProcessorsRequest} message ListPrebuiltProcessorsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPrebuiltProcessorsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPrebuiltProcessorsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsRequest} ListPrebuiltProcessorsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPrebuiltProcessorsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListPrebuiltProcessorsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsRequest} ListPrebuiltProcessorsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPrebuiltProcessorsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPrebuiltProcessorsRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPrebuiltProcessorsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + return null; + }; + + /** + * Creates a ListPrebuiltProcessorsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsRequest} ListPrebuiltProcessorsRequest + */ + ListPrebuiltProcessorsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + return message; + }; + + /** + * Creates a plain object from a ListPrebuiltProcessorsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsRequest} message ListPrebuiltProcessorsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPrebuiltProcessorsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + return object; + }; + + /** + * Converts this ListPrebuiltProcessorsRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsRequest + * @instance + * @returns {Object.} JSON object + */ + ListPrebuiltProcessorsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListPrebuiltProcessorsRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPrebuiltProcessorsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsRequest"; + }; + + return ListPrebuiltProcessorsRequest; + })(); + + v1alpha1.ListPrebuiltProcessorsResponse = (function() { + + /** + * Properties of a ListPrebuiltProcessorsResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IListPrebuiltProcessorsResponse + * @property {Array.|null} [processors] ListPrebuiltProcessorsResponse processors + */ + + /** + * Constructs a new ListPrebuiltProcessorsResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a ListPrebuiltProcessorsResponse. + * @implements IListPrebuiltProcessorsResponse + * @constructor + * @param {google.cloud.visionai.v1alpha1.IListPrebuiltProcessorsResponse=} [properties] Properties to set + */ + function ListPrebuiltProcessorsResponse(properties) { + this.processors = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPrebuiltProcessorsResponse processors. + * @member {Array.} processors + * @memberof google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsResponse + * @instance + */ + ListPrebuiltProcessorsResponse.prototype.processors = $util.emptyArray; + + /** + * Creates a new ListPrebuiltProcessorsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IListPrebuiltProcessorsResponse=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsResponse} ListPrebuiltProcessorsResponse instance + */ + ListPrebuiltProcessorsResponse.create = function create(properties) { + return new ListPrebuiltProcessorsResponse(properties); + }; + + /** + * Encodes the specified ListPrebuiltProcessorsResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IListPrebuiltProcessorsResponse} message ListPrebuiltProcessorsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPrebuiltProcessorsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.processors != null && message.processors.length) + for (var i = 0; i < message.processors.length; ++i) + $root.google.cloud.visionai.v1alpha1.Processor.encode(message.processors[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListPrebuiltProcessorsResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IListPrebuiltProcessorsResponse} message ListPrebuiltProcessorsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPrebuiltProcessorsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPrebuiltProcessorsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsResponse} ListPrebuiltProcessorsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPrebuiltProcessorsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.processors && message.processors.length)) + message.processors = []; + message.processors.push($root.google.cloud.visionai.v1alpha1.Processor.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListPrebuiltProcessorsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsResponse} ListPrebuiltProcessorsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPrebuiltProcessorsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPrebuiltProcessorsResponse message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPrebuiltProcessorsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.processors != null && message.hasOwnProperty("processors")) { + if (!Array.isArray(message.processors)) + return "processors: array expected"; + for (var i = 0; i < message.processors.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.Processor.verify(message.processors[i], long + 1); + if (error) + return "processors." + error; + } + } + return null; + }; + + /** + * Creates a ListPrebuiltProcessorsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsResponse} ListPrebuiltProcessorsResponse + */ + ListPrebuiltProcessorsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsResponse(); + if (object.processors) { + if (!Array.isArray(object.processors)) + throw TypeError(".google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsResponse.processors: array expected"); + message.processors = []; + for (var i = 0; i < object.processors.length; ++i) { + if (typeof object.processors[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsResponse.processors: object expected"); + message.processors[i] = $root.google.cloud.visionai.v1alpha1.Processor.fromObject(object.processors[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a ListPrebuiltProcessorsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsResponse + * @static + * @param {google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsResponse} message ListPrebuiltProcessorsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPrebuiltProcessorsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.processors = []; + if (message.processors && message.processors.length) { + object.processors = []; + for (var j = 0; j < message.processors.length; ++j) + object.processors[j] = $root.google.cloud.visionai.v1alpha1.Processor.toObject(message.processors[j], options); + } + return object; + }; + + /** + * Converts this ListPrebuiltProcessorsResponse to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsResponse + * @instance + * @returns {Object.} JSON object + */ + ListPrebuiltProcessorsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListPrebuiltProcessorsResponse + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPrebuiltProcessorsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsResponse"; + }; + + return ListPrebuiltProcessorsResponse; + })(); + + v1alpha1.GetProcessorRequest = (function() { + + /** + * Properties of a GetProcessorRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IGetProcessorRequest + * @property {string|null} [name] GetProcessorRequest name + */ + + /** + * Constructs a new GetProcessorRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a GetProcessorRequest. + * @implements IGetProcessorRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IGetProcessorRequest=} [properties] Properties to set + */ + function GetProcessorRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetProcessorRequest name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.GetProcessorRequest + * @instance + */ + GetProcessorRequest.prototype.name = ""; + + /** + * Creates a new GetProcessorRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.GetProcessorRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IGetProcessorRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.GetProcessorRequest} GetProcessorRequest instance + */ + GetProcessorRequest.create = function create(properties) { + return new GetProcessorRequest(properties); + }; + + /** + * Encodes the specified GetProcessorRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetProcessorRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.GetProcessorRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IGetProcessorRequest} message GetProcessorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProcessorRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetProcessorRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetProcessorRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.GetProcessorRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IGetProcessorRequest} message GetProcessorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProcessorRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetProcessorRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.GetProcessorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.GetProcessorRequest} GetProcessorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProcessorRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.GetProcessorRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetProcessorRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.GetProcessorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.GetProcessorRequest} GetProcessorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProcessorRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetProcessorRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.GetProcessorRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetProcessorRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetProcessorRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.GetProcessorRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.GetProcessorRequest} GetProcessorRequest + */ + GetProcessorRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.GetProcessorRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.GetProcessorRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetProcessorRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.GetProcessorRequest + * @static + * @param {google.cloud.visionai.v1alpha1.GetProcessorRequest} message GetProcessorRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetProcessorRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetProcessorRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.GetProcessorRequest + * @instance + * @returns {Object.} JSON object + */ + GetProcessorRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetProcessorRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.GetProcessorRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetProcessorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.GetProcessorRequest"; + }; + + return GetProcessorRequest; + })(); + + v1alpha1.CreateProcessorRequest = (function() { + + /** + * Properties of a CreateProcessorRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface ICreateProcessorRequest + * @property {string|null} [parent] CreateProcessorRequest parent + * @property {string|null} [processorId] CreateProcessorRequest processorId + * @property {google.cloud.visionai.v1alpha1.IProcessor|null} [processor] CreateProcessorRequest processor + * @property {string|null} [requestId] CreateProcessorRequest requestId + */ + + /** + * Constructs a new CreateProcessorRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a CreateProcessorRequest. + * @implements ICreateProcessorRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.ICreateProcessorRequest=} [properties] Properties to set + */ + function CreateProcessorRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateProcessorRequest parent. + * @member {string} parent + * @memberof google.cloud.visionai.v1alpha1.CreateProcessorRequest + * @instance + */ + CreateProcessorRequest.prototype.parent = ""; + + /** + * CreateProcessorRequest processorId. + * @member {string} processorId + * @memberof google.cloud.visionai.v1alpha1.CreateProcessorRequest + * @instance + */ + CreateProcessorRequest.prototype.processorId = ""; + + /** + * CreateProcessorRequest processor. + * @member {google.cloud.visionai.v1alpha1.IProcessor|null|undefined} processor + * @memberof google.cloud.visionai.v1alpha1.CreateProcessorRequest + * @instance + */ + CreateProcessorRequest.prototype.processor = null; + + /** + * CreateProcessorRequest requestId. + * @member {string} requestId + * @memberof google.cloud.visionai.v1alpha1.CreateProcessorRequest + * @instance + */ + CreateProcessorRequest.prototype.requestId = ""; + + /** + * Creates a new CreateProcessorRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.CreateProcessorRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ICreateProcessorRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.CreateProcessorRequest} CreateProcessorRequest instance + */ + CreateProcessorRequest.create = function create(properties) { + return new CreateProcessorRequest(properties); + }; + + /** + * Encodes the specified CreateProcessorRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateProcessorRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.CreateProcessorRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ICreateProcessorRequest} message CreateProcessorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateProcessorRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.processorId != null && Object.hasOwnProperty.call(message, "processorId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.processorId); + if (message.processor != null && Object.hasOwnProperty.call(message, "processor")) + $root.google.cloud.visionai.v1alpha1.Processor.encode(message.processor, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateProcessorRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateProcessorRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.CreateProcessorRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ICreateProcessorRequest} message CreateProcessorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateProcessorRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateProcessorRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.CreateProcessorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.CreateProcessorRequest} CreateProcessorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateProcessorRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.CreateProcessorRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.processorId = reader.string(); + break; + } + case 3: { + message.processor = $root.google.cloud.visionai.v1alpha1.Processor.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreateProcessorRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.CreateProcessorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.CreateProcessorRequest} CreateProcessorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateProcessorRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateProcessorRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.CreateProcessorRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateProcessorRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.processorId != null && message.hasOwnProperty("processorId")) + if (!$util.isString(message.processorId)) + return "processorId: string expected"; + if (message.processor != null && message.hasOwnProperty("processor")) { + var error = $root.google.cloud.visionai.v1alpha1.Processor.verify(message.processor, long + 1); + if (error) + return "processor." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateProcessorRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.CreateProcessorRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.CreateProcessorRequest} CreateProcessorRequest + */ + CreateProcessorRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.CreateProcessorRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.CreateProcessorRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.processorId != null) + message.processorId = String(object.processorId); + if (object.processor != null) { + if (typeof object.processor !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.CreateProcessorRequest.processor: object expected"); + message.processor = $root.google.cloud.visionai.v1alpha1.Processor.fromObject(object.processor, long + 1); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateProcessorRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.CreateProcessorRequest + * @static + * @param {google.cloud.visionai.v1alpha1.CreateProcessorRequest} message CreateProcessorRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateProcessorRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.processorId = ""; + object.processor = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.processorId != null && message.hasOwnProperty("processorId")) + object.processorId = message.processorId; + if (message.processor != null && message.hasOwnProperty("processor")) + object.processor = $root.google.cloud.visionai.v1alpha1.Processor.toObject(message.processor, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateProcessorRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.CreateProcessorRequest + * @instance + * @returns {Object.} JSON object + */ + CreateProcessorRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateProcessorRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.CreateProcessorRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateProcessorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.CreateProcessorRequest"; + }; + + return CreateProcessorRequest; + })(); + + v1alpha1.UpdateProcessorRequest = (function() { + + /** + * Properties of an UpdateProcessorRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IUpdateProcessorRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateProcessorRequest updateMask + * @property {google.cloud.visionai.v1alpha1.IProcessor|null} [processor] UpdateProcessorRequest processor + * @property {string|null} [requestId] UpdateProcessorRequest requestId + */ + + /** + * Constructs a new UpdateProcessorRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents an UpdateProcessorRequest. + * @implements IUpdateProcessorRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IUpdateProcessorRequest=} [properties] Properties to set + */ + function UpdateProcessorRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateProcessorRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.visionai.v1alpha1.UpdateProcessorRequest + * @instance + */ + UpdateProcessorRequest.prototype.updateMask = null; + + /** + * UpdateProcessorRequest processor. + * @member {google.cloud.visionai.v1alpha1.IProcessor|null|undefined} processor + * @memberof google.cloud.visionai.v1alpha1.UpdateProcessorRequest + * @instance + */ + UpdateProcessorRequest.prototype.processor = null; + + /** + * UpdateProcessorRequest requestId. + * @member {string} requestId + * @memberof google.cloud.visionai.v1alpha1.UpdateProcessorRequest + * @instance + */ + UpdateProcessorRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateProcessorRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.UpdateProcessorRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IUpdateProcessorRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.UpdateProcessorRequest} UpdateProcessorRequest instance + */ + UpdateProcessorRequest.create = function create(properties) { + return new UpdateProcessorRequest(properties); + }; + + /** + * Encodes the specified UpdateProcessorRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateProcessorRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.UpdateProcessorRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IUpdateProcessorRequest} message UpdateProcessorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateProcessorRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.processor != null && Object.hasOwnProperty.call(message, "processor")) + $root.google.cloud.visionai.v1alpha1.Processor.encode(message.processor, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified UpdateProcessorRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateProcessorRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.UpdateProcessorRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IUpdateProcessorRequest} message UpdateProcessorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateProcessorRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateProcessorRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.UpdateProcessorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.UpdateProcessorRequest} UpdateProcessorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateProcessorRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.UpdateProcessorRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.processor = $root.google.cloud.visionai.v1alpha1.Processor.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateProcessorRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.UpdateProcessorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.UpdateProcessorRequest} UpdateProcessorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateProcessorRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateProcessorRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.UpdateProcessorRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateProcessorRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + if (message.processor != null && message.hasOwnProperty("processor")) { + var error = $root.google.cloud.visionai.v1alpha1.Processor.verify(message.processor, long + 1); + if (error) + return "processor." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an UpdateProcessorRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.UpdateProcessorRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.UpdateProcessorRequest} UpdateProcessorRequest + */ + UpdateProcessorRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.UpdateProcessorRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.UpdateProcessorRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.UpdateProcessorRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + if (object.processor != null) { + if (typeof object.processor !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.UpdateProcessorRequest.processor: object expected"); + message.processor = $root.google.cloud.visionai.v1alpha1.Processor.fromObject(object.processor, long + 1); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateProcessorRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.UpdateProcessorRequest + * @static + * @param {google.cloud.visionai.v1alpha1.UpdateProcessorRequest} message UpdateProcessorRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateProcessorRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.processor = null; + object.requestId = ""; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.processor != null && message.hasOwnProperty("processor")) + object.processor = $root.google.cloud.visionai.v1alpha1.Processor.toObject(message.processor, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UpdateProcessorRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.UpdateProcessorRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateProcessorRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateProcessorRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.UpdateProcessorRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateProcessorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.UpdateProcessorRequest"; + }; + + return UpdateProcessorRequest; + })(); + + v1alpha1.DeleteProcessorRequest = (function() { + + /** + * Properties of a DeleteProcessorRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IDeleteProcessorRequest + * @property {string|null} [name] DeleteProcessorRequest name + * @property {string|null} [requestId] DeleteProcessorRequest requestId + */ + + /** + * Constructs a new DeleteProcessorRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a DeleteProcessorRequest. + * @implements IDeleteProcessorRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IDeleteProcessorRequest=} [properties] Properties to set + */ + function DeleteProcessorRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteProcessorRequest name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.DeleteProcessorRequest + * @instance + */ + DeleteProcessorRequest.prototype.name = ""; + + /** + * DeleteProcessorRequest requestId. + * @member {string} requestId + * @memberof google.cloud.visionai.v1alpha1.DeleteProcessorRequest + * @instance + */ + DeleteProcessorRequest.prototype.requestId = ""; + + /** + * Creates a new DeleteProcessorRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.DeleteProcessorRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IDeleteProcessorRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.DeleteProcessorRequest} DeleteProcessorRequest instance + */ + DeleteProcessorRequest.create = function create(properties) { + return new DeleteProcessorRequest(properties); + }; + + /** + * Encodes the specified DeleteProcessorRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteProcessorRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.DeleteProcessorRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IDeleteProcessorRequest} message DeleteProcessorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteProcessorRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified DeleteProcessorRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteProcessorRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.DeleteProcessorRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IDeleteProcessorRequest} message DeleteProcessorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteProcessorRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteProcessorRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.DeleteProcessorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.DeleteProcessorRequest} DeleteProcessorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteProcessorRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.DeleteProcessorRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteProcessorRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.DeleteProcessorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.DeleteProcessorRequest} DeleteProcessorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteProcessorRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteProcessorRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.DeleteProcessorRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteProcessorRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a DeleteProcessorRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.DeleteProcessorRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.DeleteProcessorRequest} DeleteProcessorRequest + */ + DeleteProcessorRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.DeleteProcessorRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.DeleteProcessorRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteProcessorRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.DeleteProcessorRequest + * @static + * @param {google.cloud.visionai.v1alpha1.DeleteProcessorRequest} message DeleteProcessorRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteProcessorRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this DeleteProcessorRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.DeleteProcessorRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteProcessorRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteProcessorRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.DeleteProcessorRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteProcessorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.DeleteProcessorRequest"; + }; + + return DeleteProcessorRequest; + })(); + + v1alpha1.Application = (function() { + + /** + * Properties of an Application. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IApplication + * @property {string|null} [name] Application name + * @property {google.protobuf.ITimestamp|null} [createTime] Application createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Application updateTime + * @property {Object.|null} [labels] Application labels + * @property {string|null} [displayName] Application displayName + * @property {string|null} [description] Application description + * @property {google.cloud.visionai.v1alpha1.IApplicationConfigs|null} [applicationConfigs] Application applicationConfigs + * @property {google.cloud.visionai.v1alpha1.Application.IApplicationRuntimeInfo|null} [runtimeInfo] Application runtimeInfo + * @property {google.cloud.visionai.v1alpha1.Application.State|null} [state] Application state + */ + + /** + * Constructs a new Application. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents an Application. + * @implements IApplication + * @constructor + * @param {google.cloud.visionai.v1alpha1.IApplication=} [properties] Properties to set + */ + function Application(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Application name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.Application + * @instance + */ + Application.prototype.name = ""; + + /** + * Application createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.visionai.v1alpha1.Application + * @instance + */ + Application.prototype.createTime = null; + + /** + * Application updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.visionai.v1alpha1.Application + * @instance + */ + Application.prototype.updateTime = null; + + /** + * Application labels. + * @member {Object.} labels + * @memberof google.cloud.visionai.v1alpha1.Application + * @instance + */ + Application.prototype.labels = $util.emptyObject; + + /** + * Application displayName. + * @member {string} displayName + * @memberof google.cloud.visionai.v1alpha1.Application + * @instance + */ + Application.prototype.displayName = ""; + + /** + * Application description. + * @member {string} description + * @memberof google.cloud.visionai.v1alpha1.Application + * @instance + */ + Application.prototype.description = ""; + + /** + * Application applicationConfigs. + * @member {google.cloud.visionai.v1alpha1.IApplicationConfigs|null|undefined} applicationConfigs + * @memberof google.cloud.visionai.v1alpha1.Application + * @instance + */ + Application.prototype.applicationConfigs = null; + + /** + * Application runtimeInfo. + * @member {google.cloud.visionai.v1alpha1.Application.IApplicationRuntimeInfo|null|undefined} runtimeInfo + * @memberof google.cloud.visionai.v1alpha1.Application + * @instance + */ + Application.prototype.runtimeInfo = null; + + /** + * Application state. + * @member {google.cloud.visionai.v1alpha1.Application.State} state + * @memberof google.cloud.visionai.v1alpha1.Application + * @instance + */ + Application.prototype.state = 0; + + /** + * Creates a new Application instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.Application + * @static + * @param {google.cloud.visionai.v1alpha1.IApplication=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.Application} Application instance + */ + Application.create = function create(properties) { + return new Application(properties); + }; + + /** + * Encodes the specified Application message. Does not implicitly {@link google.cloud.visionai.v1alpha1.Application.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.Application + * @static + * @param {google.cloud.visionai.v1alpha1.IApplication} message Application message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Application.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.description); + if (message.applicationConfigs != null && Object.hasOwnProperty.call(message, "applicationConfigs")) + $root.google.cloud.visionai.v1alpha1.ApplicationConfigs.encode(message.applicationConfigs, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.runtimeInfo != null && Object.hasOwnProperty.call(message, "runtimeInfo")) + $root.google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.encode(message.runtimeInfo, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.state); + return writer; + }; + + /** + * Encodes the specified Application message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.Application.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.Application + * @static + * @param {google.cloud.visionai.v1alpha1.IApplication} message Application message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Application.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Application message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.Application + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.Application} Application + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Application.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.Application(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.labels, key); + message.labels[key] = value; + break; + } + case 5: { + message.displayName = reader.string(); + break; + } + case 6: { + message.description = reader.string(); + break; + } + case 7: { + message.applicationConfigs = $root.google.cloud.visionai.v1alpha1.ApplicationConfigs.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 8: { + message.runtimeInfo = $root.google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 9: { + message.state = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an Application message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.Application + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.Application} Application + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Application.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Application message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.Application + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Application.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime, long + 1); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime, long + 1); + if (error) + return "updateTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.applicationConfigs != null && message.hasOwnProperty("applicationConfigs")) { + var error = $root.google.cloud.visionai.v1alpha1.ApplicationConfigs.verify(message.applicationConfigs, long + 1); + if (error) + return "applicationConfigs." + error; + } + if (message.runtimeInfo != null && message.hasOwnProperty("runtimeInfo")) { + var error = $root.google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.verify(message.runtimeInfo, long + 1); + if (error) + return "runtimeInfo." + error; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + break; + } + return null; + }; + + /** + * Creates an Application message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.Application + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.Application} Application + */ + Application.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.Application) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.Application(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Application.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime, long + 1); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Application.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime, long + 1); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Application.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.labels, keys[i]); + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + } + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.applicationConfigs != null) { + if (typeof object.applicationConfigs !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Application.applicationConfigs: object expected"); + message.applicationConfigs = $root.google.cloud.visionai.v1alpha1.ApplicationConfigs.fromObject(object.applicationConfigs, long + 1); + } + if (object.runtimeInfo != null) { + if (typeof object.runtimeInfo !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Application.runtimeInfo: object expected"); + message.runtimeInfo = $root.google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.fromObject(object.runtimeInfo, long + 1); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATED": + case 1: + message.state = 1; + break; + case "DEPLOYING": + case 2: + message.state = 2; + break; + case "DEPLOYED": + case 3: + message.state = 3; + break; + case "UNDEPLOYING": + case 4: + message.state = 4; + break; + case "DELETED": + case 5: + message.state = 5; + break; + case "ERROR": + case 6: + message.state = 6; + break; + case "CREATING": + case 7: + message.state = 7; + break; + case "UPDATING": + case 8: + message.state = 8; + break; + case "DELETING": + case 9: + message.state = 9; + break; + case "FIXING": + case 10: + message.state = 10; + break; + } + return message; + }; + + /** + * Creates a plain object from an Application message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.Application + * @static + * @param {google.cloud.visionai.v1alpha1.Application} message Application + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Application.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.displayName = ""; + object.description = ""; + object.applicationConfigs = null; + object.runtimeInfo = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.labels, keys2[j]); + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.applicationConfigs != null && message.hasOwnProperty("applicationConfigs")) + object.applicationConfigs = $root.google.cloud.visionai.v1alpha1.ApplicationConfigs.toObject(message.applicationConfigs, options); + if (message.runtimeInfo != null && message.hasOwnProperty("runtimeInfo")) + object.runtimeInfo = $root.google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.toObject(message.runtimeInfo, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.visionai.v1alpha1.Application.State[message.state] === undefined ? message.state : $root.google.cloud.visionai.v1alpha1.Application.State[message.state] : message.state; + return object; + }; + + /** + * Converts this Application to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.Application + * @instance + * @returns {Object.} JSON object + */ + Application.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Application + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.Application + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Application.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.Application"; + }; + + Application.ApplicationRuntimeInfo = (function() { + + /** + * Properties of an ApplicationRuntimeInfo. + * @memberof google.cloud.visionai.v1alpha1.Application + * @interface IApplicationRuntimeInfo + * @property {google.protobuf.ITimestamp|null} [deployTime] ApplicationRuntimeInfo deployTime + * @property {Array.|null} [globalOutputResources] ApplicationRuntimeInfo globalOutputResources + * @property {google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.IMonitoringConfig|null} [monitoringConfig] ApplicationRuntimeInfo monitoringConfig + */ + + /** + * Constructs a new ApplicationRuntimeInfo. + * @memberof google.cloud.visionai.v1alpha1.Application + * @classdesc Represents an ApplicationRuntimeInfo. + * @implements IApplicationRuntimeInfo + * @constructor + * @param {google.cloud.visionai.v1alpha1.Application.IApplicationRuntimeInfo=} [properties] Properties to set + */ + function ApplicationRuntimeInfo(properties) { + this.globalOutputResources = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ApplicationRuntimeInfo deployTime. + * @member {google.protobuf.ITimestamp|null|undefined} deployTime + * @memberof google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo + * @instance + */ + ApplicationRuntimeInfo.prototype.deployTime = null; + + /** + * ApplicationRuntimeInfo globalOutputResources. + * @member {Array.} globalOutputResources + * @memberof google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo + * @instance + */ + ApplicationRuntimeInfo.prototype.globalOutputResources = $util.emptyArray; + + /** + * ApplicationRuntimeInfo monitoringConfig. + * @member {google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.IMonitoringConfig|null|undefined} monitoringConfig + * @memberof google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo + * @instance + */ + ApplicationRuntimeInfo.prototype.monitoringConfig = null; + + /** + * Creates a new ApplicationRuntimeInfo instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo + * @static + * @param {google.cloud.visionai.v1alpha1.Application.IApplicationRuntimeInfo=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo} ApplicationRuntimeInfo instance + */ + ApplicationRuntimeInfo.create = function create(properties) { + return new ApplicationRuntimeInfo(properties); + }; + + /** + * Encodes the specified ApplicationRuntimeInfo message. Does not implicitly {@link google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo + * @static + * @param {google.cloud.visionai.v1alpha1.Application.IApplicationRuntimeInfo} message ApplicationRuntimeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApplicationRuntimeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deployTime != null && Object.hasOwnProperty.call(message, "deployTime")) + $root.google.protobuf.Timestamp.encode(message.deployTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.globalOutputResources != null && message.globalOutputResources.length) + for (var i = 0; i < message.globalOutputResources.length; ++i) + $root.google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.GlobalOutputResource.encode(message.globalOutputResources[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.monitoringConfig != null && Object.hasOwnProperty.call(message, "monitoringConfig")) + $root.google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.MonitoringConfig.encode(message.monitoringConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ApplicationRuntimeInfo message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo + * @static + * @param {google.cloud.visionai.v1alpha1.Application.IApplicationRuntimeInfo} message ApplicationRuntimeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApplicationRuntimeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApplicationRuntimeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo} ApplicationRuntimeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApplicationRuntimeInfo.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.deployTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + if (!(message.globalOutputResources && message.globalOutputResources.length)) + message.globalOutputResources = []; + message.globalOutputResources.push($root.google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.GlobalOutputResource.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 4: { + message.monitoringConfig = $root.google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.MonitoringConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ApplicationRuntimeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo} ApplicationRuntimeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApplicationRuntimeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApplicationRuntimeInfo message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApplicationRuntimeInfo.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.deployTime != null && message.hasOwnProperty("deployTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deployTime, long + 1); + if (error) + return "deployTime." + error; + } + if (message.globalOutputResources != null && message.hasOwnProperty("globalOutputResources")) { + if (!Array.isArray(message.globalOutputResources)) + return "globalOutputResources: array expected"; + for (var i = 0; i < message.globalOutputResources.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.GlobalOutputResource.verify(message.globalOutputResources[i], long + 1); + if (error) + return "globalOutputResources." + error; + } + } + if (message.monitoringConfig != null && message.hasOwnProperty("monitoringConfig")) { + var error = $root.google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.MonitoringConfig.verify(message.monitoringConfig, long + 1); + if (error) + return "monitoringConfig." + error; + } + return null; + }; + + /** + * Creates an ApplicationRuntimeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo} ApplicationRuntimeInfo + */ + ApplicationRuntimeInfo.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo(); + if (object.deployTime != null) { + if (typeof object.deployTime !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.deployTime: object expected"); + message.deployTime = $root.google.protobuf.Timestamp.fromObject(object.deployTime, long + 1); + } + if (object.globalOutputResources) { + if (!Array.isArray(object.globalOutputResources)) + throw TypeError(".google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.globalOutputResources: array expected"); + message.globalOutputResources = []; + for (var i = 0; i < object.globalOutputResources.length; ++i) { + if (typeof object.globalOutputResources[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.globalOutputResources: object expected"); + message.globalOutputResources[i] = $root.google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.GlobalOutputResource.fromObject(object.globalOutputResources[i], long + 1); + } + } + if (object.monitoringConfig != null) { + if (typeof object.monitoringConfig !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.monitoringConfig: object expected"); + message.monitoringConfig = $root.google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.MonitoringConfig.fromObject(object.monitoringConfig, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an ApplicationRuntimeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo + * @static + * @param {google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo} message ApplicationRuntimeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApplicationRuntimeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.globalOutputResources = []; + if (options.defaults) { + object.deployTime = null; + object.monitoringConfig = null; + } + if (message.deployTime != null && message.hasOwnProperty("deployTime")) + object.deployTime = $root.google.protobuf.Timestamp.toObject(message.deployTime, options); + if (message.globalOutputResources && message.globalOutputResources.length) { + object.globalOutputResources = []; + for (var j = 0; j < message.globalOutputResources.length; ++j) + object.globalOutputResources[j] = $root.google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.GlobalOutputResource.toObject(message.globalOutputResources[j], options); + } + if (message.monitoringConfig != null && message.hasOwnProperty("monitoringConfig")) + object.monitoringConfig = $root.google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.MonitoringConfig.toObject(message.monitoringConfig, options); + return object; + }; + + /** + * Converts this ApplicationRuntimeInfo to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo + * @instance + * @returns {Object.} JSON object + */ + ApplicationRuntimeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ApplicationRuntimeInfo + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ApplicationRuntimeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo"; + }; + + ApplicationRuntimeInfo.GlobalOutputResource = (function() { + + /** + * Properties of a GlobalOutputResource. + * @memberof google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo + * @interface IGlobalOutputResource + * @property {string|null} [outputResource] GlobalOutputResource outputResource + * @property {string|null} [producerNode] GlobalOutputResource producerNode + * @property {string|null} [key] GlobalOutputResource key + */ + + /** + * Constructs a new GlobalOutputResource. + * @memberof google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo + * @classdesc Represents a GlobalOutputResource. + * @implements IGlobalOutputResource + * @constructor + * @param {google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.IGlobalOutputResource=} [properties] Properties to set + */ + function GlobalOutputResource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GlobalOutputResource outputResource. + * @member {string} outputResource + * @memberof google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.GlobalOutputResource + * @instance + */ + GlobalOutputResource.prototype.outputResource = ""; + + /** + * GlobalOutputResource producerNode. + * @member {string} producerNode + * @memberof google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.GlobalOutputResource + * @instance + */ + GlobalOutputResource.prototype.producerNode = ""; + + /** + * GlobalOutputResource key. + * @member {string} key + * @memberof google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.GlobalOutputResource + * @instance + */ + GlobalOutputResource.prototype.key = ""; + + /** + * Creates a new GlobalOutputResource instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.GlobalOutputResource + * @static + * @param {google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.IGlobalOutputResource=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.GlobalOutputResource} GlobalOutputResource instance + */ + GlobalOutputResource.create = function create(properties) { + return new GlobalOutputResource(properties); + }; + + /** + * Encodes the specified GlobalOutputResource message. Does not implicitly {@link google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.GlobalOutputResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.GlobalOutputResource + * @static + * @param {google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.IGlobalOutputResource} message GlobalOutputResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GlobalOutputResource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.outputResource != null && Object.hasOwnProperty.call(message, "outputResource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.outputResource); + if (message.producerNode != null && Object.hasOwnProperty.call(message, "producerNode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.producerNode); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.key); + return writer; + }; + + /** + * Encodes the specified GlobalOutputResource message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.GlobalOutputResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.GlobalOutputResource + * @static + * @param {google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.IGlobalOutputResource} message GlobalOutputResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GlobalOutputResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GlobalOutputResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.GlobalOutputResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.GlobalOutputResource} GlobalOutputResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GlobalOutputResource.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.GlobalOutputResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.outputResource = reader.string(); + break; + } + case 2: { + message.producerNode = reader.string(); + break; + } + case 3: { + message.key = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GlobalOutputResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.GlobalOutputResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.GlobalOutputResource} GlobalOutputResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GlobalOutputResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GlobalOutputResource message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.GlobalOutputResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GlobalOutputResource.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.outputResource != null && message.hasOwnProperty("outputResource")) + if (!$util.isString(message.outputResource)) + return "outputResource: string expected"; + if (message.producerNode != null && message.hasOwnProperty("producerNode")) + if (!$util.isString(message.producerNode)) + return "producerNode: string expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; + return null; + }; + + /** + * Creates a GlobalOutputResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.GlobalOutputResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.GlobalOutputResource} GlobalOutputResource + */ + GlobalOutputResource.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.GlobalOutputResource) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.GlobalOutputResource(); + if (object.outputResource != null) + message.outputResource = String(object.outputResource); + if (object.producerNode != null) + message.producerNode = String(object.producerNode); + if (object.key != null) + message.key = String(object.key); + return message; + }; + + /** + * Creates a plain object from a GlobalOutputResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.GlobalOutputResource + * @static + * @param {google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.GlobalOutputResource} message GlobalOutputResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GlobalOutputResource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.outputResource = ""; + object.producerNode = ""; + object.key = ""; + } + if (message.outputResource != null && message.hasOwnProperty("outputResource")) + object.outputResource = message.outputResource; + if (message.producerNode != null && message.hasOwnProperty("producerNode")) + object.producerNode = message.producerNode; + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + return object; + }; + + /** + * Converts this GlobalOutputResource to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.GlobalOutputResource + * @instance + * @returns {Object.} JSON object + */ + GlobalOutputResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GlobalOutputResource + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.GlobalOutputResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GlobalOutputResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.GlobalOutputResource"; + }; + + return GlobalOutputResource; + })(); + + ApplicationRuntimeInfo.MonitoringConfig = (function() { + + /** + * Properties of a MonitoringConfig. + * @memberof google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo + * @interface IMonitoringConfig + * @property {boolean|null} [enabled] MonitoringConfig enabled + */ + + /** + * Constructs a new MonitoringConfig. + * @memberof google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo + * @classdesc Represents a MonitoringConfig. + * @implements IMonitoringConfig + * @constructor + * @param {google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.IMonitoringConfig=} [properties] Properties to set + */ + function MonitoringConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * MonitoringConfig enabled. + * @member {boolean} enabled + * @memberof google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.MonitoringConfig + * @instance + */ + MonitoringConfig.prototype.enabled = false; + + /** + * Creates a new MonitoringConfig instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.MonitoringConfig + * @static + * @param {google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.IMonitoringConfig=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.MonitoringConfig} MonitoringConfig instance + */ + MonitoringConfig.create = function create(properties) { + return new MonitoringConfig(properties); + }; + + /** + * Encodes the specified MonitoringConfig message. Does not implicitly {@link google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.MonitoringConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.MonitoringConfig + * @static + * @param {google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.IMonitoringConfig} message MonitoringConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MonitoringConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); + return writer; + }; + + /** + * Encodes the specified MonitoringConfig message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.MonitoringConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.MonitoringConfig + * @static + * @param {google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.IMonitoringConfig} message MonitoringConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MonitoringConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MonitoringConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.MonitoringConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.MonitoringConfig} MonitoringConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MonitoringConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.MonitoringConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a MonitoringConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.MonitoringConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.MonitoringConfig} MonitoringConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MonitoringConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MonitoringConfig message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.MonitoringConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MonitoringConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.enabled != null && message.hasOwnProperty("enabled")) + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + return null; + }; + + /** + * Creates a MonitoringConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.MonitoringConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.MonitoringConfig} MonitoringConfig + */ + MonitoringConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.MonitoringConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.MonitoringConfig(); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + return message; + }; + + /** + * Creates a plain object from a MonitoringConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.MonitoringConfig + * @static + * @param {google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.MonitoringConfig} message MonitoringConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MonitoringConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.enabled = false; + if (message.enabled != null && message.hasOwnProperty("enabled")) + object.enabled = message.enabled; + return object; + }; + + /** + * Converts this MonitoringConfig to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.MonitoringConfig + * @instance + * @returns {Object.} JSON object + */ + MonitoringConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MonitoringConfig + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.MonitoringConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MonitoringConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.Application.ApplicationRuntimeInfo.MonitoringConfig"; + }; + + return MonitoringConfig; + })(); + + return ApplicationRuntimeInfo; + })(); + + /** + * State enum. + * @name google.cloud.visionai.v1alpha1.Application.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATED=1 CREATED value + * @property {number} DEPLOYING=2 DEPLOYING value + * @property {number} DEPLOYED=3 DEPLOYED value + * @property {number} UNDEPLOYING=4 UNDEPLOYING value + * @property {number} DELETED=5 DELETED value + * @property {number} ERROR=6 ERROR value + * @property {number} CREATING=7 CREATING value + * @property {number} UPDATING=8 UPDATING value + * @property {number} DELETING=9 DELETING value + * @property {number} FIXING=10 FIXING value + */ + Application.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATED"] = 1; + values[valuesById[2] = "DEPLOYING"] = 2; + values[valuesById[3] = "DEPLOYED"] = 3; + values[valuesById[4] = "UNDEPLOYING"] = 4; + values[valuesById[5] = "DELETED"] = 5; + values[valuesById[6] = "ERROR"] = 6; + values[valuesById[7] = "CREATING"] = 7; + values[valuesById[8] = "UPDATING"] = 8; + values[valuesById[9] = "DELETING"] = 9; + values[valuesById[10] = "FIXING"] = 10; + return values; + })(); + + return Application; + })(); + + v1alpha1.ApplicationConfigs = (function() { + + /** + * Properties of an ApplicationConfigs. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IApplicationConfigs + * @property {Array.|null} [nodes] ApplicationConfigs nodes + * @property {google.cloud.visionai.v1alpha1.ApplicationConfigs.IEventDeliveryConfig|null} [eventDeliveryConfig] ApplicationConfigs eventDeliveryConfig + */ + + /** + * Constructs a new ApplicationConfigs. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents an ApplicationConfigs. + * @implements IApplicationConfigs + * @constructor + * @param {google.cloud.visionai.v1alpha1.IApplicationConfigs=} [properties] Properties to set + */ + function ApplicationConfigs(properties) { + this.nodes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ApplicationConfigs nodes. + * @member {Array.} nodes + * @memberof google.cloud.visionai.v1alpha1.ApplicationConfigs + * @instance + */ + ApplicationConfigs.prototype.nodes = $util.emptyArray; + + /** + * ApplicationConfigs eventDeliveryConfig. + * @member {google.cloud.visionai.v1alpha1.ApplicationConfigs.IEventDeliveryConfig|null|undefined} eventDeliveryConfig + * @memberof google.cloud.visionai.v1alpha1.ApplicationConfigs + * @instance + */ + ApplicationConfigs.prototype.eventDeliveryConfig = null; + + /** + * Creates a new ApplicationConfigs instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ApplicationConfigs + * @static + * @param {google.cloud.visionai.v1alpha1.IApplicationConfigs=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ApplicationConfigs} ApplicationConfigs instance + */ + ApplicationConfigs.create = function create(properties) { + return new ApplicationConfigs(properties); + }; + + /** + * Encodes the specified ApplicationConfigs message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ApplicationConfigs.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ApplicationConfigs + * @static + * @param {google.cloud.visionai.v1alpha1.IApplicationConfigs} message ApplicationConfigs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApplicationConfigs.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nodes != null && message.nodes.length) + for (var i = 0; i < message.nodes.length; ++i) + $root.google.cloud.visionai.v1alpha1.Node.encode(message.nodes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.eventDeliveryConfig != null && Object.hasOwnProperty.call(message, "eventDeliveryConfig")) + $root.google.cloud.visionai.v1alpha1.ApplicationConfigs.EventDeliveryConfig.encode(message.eventDeliveryConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ApplicationConfigs message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ApplicationConfigs.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ApplicationConfigs + * @static + * @param {google.cloud.visionai.v1alpha1.IApplicationConfigs} message ApplicationConfigs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApplicationConfigs.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApplicationConfigs message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ApplicationConfigs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ApplicationConfigs} ApplicationConfigs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApplicationConfigs.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ApplicationConfigs(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.nodes && message.nodes.length)) + message.nodes = []; + message.nodes.push($root.google.cloud.visionai.v1alpha1.Node.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 3: { + message.eventDeliveryConfig = $root.google.cloud.visionai.v1alpha1.ApplicationConfigs.EventDeliveryConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ApplicationConfigs message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ApplicationConfigs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ApplicationConfigs} ApplicationConfigs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApplicationConfigs.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApplicationConfigs message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ApplicationConfigs + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApplicationConfigs.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.nodes != null && message.hasOwnProperty("nodes")) { + if (!Array.isArray(message.nodes)) + return "nodes: array expected"; + for (var i = 0; i < message.nodes.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.Node.verify(message.nodes[i], long + 1); + if (error) + return "nodes." + error; + } + } + if (message.eventDeliveryConfig != null && message.hasOwnProperty("eventDeliveryConfig")) { + var error = $root.google.cloud.visionai.v1alpha1.ApplicationConfigs.EventDeliveryConfig.verify(message.eventDeliveryConfig, long + 1); + if (error) + return "eventDeliveryConfig." + error; + } + return null; + }; + + /** + * Creates an ApplicationConfigs message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ApplicationConfigs + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ApplicationConfigs} ApplicationConfigs + */ + ApplicationConfigs.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ApplicationConfigs) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ApplicationConfigs(); + if (object.nodes) { + if (!Array.isArray(object.nodes)) + throw TypeError(".google.cloud.visionai.v1alpha1.ApplicationConfigs.nodes: array expected"); + message.nodes = []; + for (var i = 0; i < object.nodes.length; ++i) { + if (typeof object.nodes[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ApplicationConfigs.nodes: object expected"); + message.nodes[i] = $root.google.cloud.visionai.v1alpha1.Node.fromObject(object.nodes[i], long + 1); + } + } + if (object.eventDeliveryConfig != null) { + if (typeof object.eventDeliveryConfig !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ApplicationConfigs.eventDeliveryConfig: object expected"); + message.eventDeliveryConfig = $root.google.cloud.visionai.v1alpha1.ApplicationConfigs.EventDeliveryConfig.fromObject(object.eventDeliveryConfig, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an ApplicationConfigs message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ApplicationConfigs + * @static + * @param {google.cloud.visionai.v1alpha1.ApplicationConfigs} message ApplicationConfigs + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApplicationConfigs.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.nodes = []; + if (options.defaults) + object.eventDeliveryConfig = null; + if (message.nodes && message.nodes.length) { + object.nodes = []; + for (var j = 0; j < message.nodes.length; ++j) + object.nodes[j] = $root.google.cloud.visionai.v1alpha1.Node.toObject(message.nodes[j], options); + } + if (message.eventDeliveryConfig != null && message.hasOwnProperty("eventDeliveryConfig")) + object.eventDeliveryConfig = $root.google.cloud.visionai.v1alpha1.ApplicationConfigs.EventDeliveryConfig.toObject(message.eventDeliveryConfig, options); + return object; + }; + + /** + * Converts this ApplicationConfigs to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ApplicationConfigs + * @instance + * @returns {Object.} JSON object + */ + ApplicationConfigs.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ApplicationConfigs + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ApplicationConfigs + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ApplicationConfigs.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ApplicationConfigs"; + }; + + ApplicationConfigs.EventDeliveryConfig = (function() { + + /** + * Properties of an EventDeliveryConfig. + * @memberof google.cloud.visionai.v1alpha1.ApplicationConfigs + * @interface IEventDeliveryConfig + * @property {string|null} [channel] EventDeliveryConfig channel + * @property {google.protobuf.IDuration|null} [minimalDeliveryInterval] EventDeliveryConfig minimalDeliveryInterval + */ + + /** + * Constructs a new EventDeliveryConfig. + * @memberof google.cloud.visionai.v1alpha1.ApplicationConfigs + * @classdesc Represents an EventDeliveryConfig. + * @implements IEventDeliveryConfig + * @constructor + * @param {google.cloud.visionai.v1alpha1.ApplicationConfigs.IEventDeliveryConfig=} [properties] Properties to set + */ + function EventDeliveryConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * EventDeliveryConfig channel. + * @member {string} channel + * @memberof google.cloud.visionai.v1alpha1.ApplicationConfigs.EventDeliveryConfig + * @instance + */ + EventDeliveryConfig.prototype.channel = ""; + + /** + * EventDeliveryConfig minimalDeliveryInterval. + * @member {google.protobuf.IDuration|null|undefined} minimalDeliveryInterval + * @memberof google.cloud.visionai.v1alpha1.ApplicationConfigs.EventDeliveryConfig + * @instance + */ + EventDeliveryConfig.prototype.minimalDeliveryInterval = null; + + /** + * Creates a new EventDeliveryConfig instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ApplicationConfigs.EventDeliveryConfig + * @static + * @param {google.cloud.visionai.v1alpha1.ApplicationConfigs.IEventDeliveryConfig=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ApplicationConfigs.EventDeliveryConfig} EventDeliveryConfig instance + */ + EventDeliveryConfig.create = function create(properties) { + return new EventDeliveryConfig(properties); + }; + + /** + * Encodes the specified EventDeliveryConfig message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ApplicationConfigs.EventDeliveryConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ApplicationConfigs.EventDeliveryConfig + * @static + * @param {google.cloud.visionai.v1alpha1.ApplicationConfigs.IEventDeliveryConfig} message EventDeliveryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EventDeliveryConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.channel != null && Object.hasOwnProperty.call(message, "channel")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.channel); + if (message.minimalDeliveryInterval != null && Object.hasOwnProperty.call(message, "minimalDeliveryInterval")) + $root.google.protobuf.Duration.encode(message.minimalDeliveryInterval, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EventDeliveryConfig message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ApplicationConfigs.EventDeliveryConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ApplicationConfigs.EventDeliveryConfig + * @static + * @param {google.cloud.visionai.v1alpha1.ApplicationConfigs.IEventDeliveryConfig} message EventDeliveryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EventDeliveryConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EventDeliveryConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ApplicationConfigs.EventDeliveryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ApplicationConfigs.EventDeliveryConfig} EventDeliveryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EventDeliveryConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ApplicationConfigs.EventDeliveryConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.channel = reader.string(); + break; + } + case 2: { + message.minimalDeliveryInterval = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an EventDeliveryConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ApplicationConfigs.EventDeliveryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ApplicationConfigs.EventDeliveryConfig} EventDeliveryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EventDeliveryConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EventDeliveryConfig message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ApplicationConfigs.EventDeliveryConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EventDeliveryConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.channel != null && message.hasOwnProperty("channel")) + if (!$util.isString(message.channel)) + return "channel: string expected"; + if (message.minimalDeliveryInterval != null && message.hasOwnProperty("minimalDeliveryInterval")) { + var error = $root.google.protobuf.Duration.verify(message.minimalDeliveryInterval, long + 1); + if (error) + return "minimalDeliveryInterval." + error; + } + return null; + }; + + /** + * Creates an EventDeliveryConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ApplicationConfigs.EventDeliveryConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ApplicationConfigs.EventDeliveryConfig} EventDeliveryConfig + */ + EventDeliveryConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ApplicationConfigs.EventDeliveryConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ApplicationConfigs.EventDeliveryConfig(); + if (object.channel != null) + message.channel = String(object.channel); + if (object.minimalDeliveryInterval != null) { + if (typeof object.minimalDeliveryInterval !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ApplicationConfigs.EventDeliveryConfig.minimalDeliveryInterval: object expected"); + message.minimalDeliveryInterval = $root.google.protobuf.Duration.fromObject(object.minimalDeliveryInterval, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an EventDeliveryConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ApplicationConfigs.EventDeliveryConfig + * @static + * @param {google.cloud.visionai.v1alpha1.ApplicationConfigs.EventDeliveryConfig} message EventDeliveryConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EventDeliveryConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.channel = ""; + object.minimalDeliveryInterval = null; + } + if (message.channel != null && message.hasOwnProperty("channel")) + object.channel = message.channel; + if (message.minimalDeliveryInterval != null && message.hasOwnProperty("minimalDeliveryInterval")) + object.minimalDeliveryInterval = $root.google.protobuf.Duration.toObject(message.minimalDeliveryInterval, options); + return object; + }; + + /** + * Converts this EventDeliveryConfig to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ApplicationConfigs.EventDeliveryConfig + * @instance + * @returns {Object.} JSON object + */ + EventDeliveryConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EventDeliveryConfig + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ApplicationConfigs.EventDeliveryConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EventDeliveryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ApplicationConfigs.EventDeliveryConfig"; + }; + + return EventDeliveryConfig; + })(); + + return ApplicationConfigs; + })(); + + v1alpha1.Node = (function() { + + /** + * Properties of a Node. + * @memberof google.cloud.visionai.v1alpha1 + * @interface INode + * @property {boolean|null} [outputAllOutputChannelsToStream] Node outputAllOutputChannelsToStream + * @property {string|null} [name] Node name + * @property {string|null} [displayName] Node displayName + * @property {google.cloud.visionai.v1alpha1.IProcessorConfig|null} [nodeConfig] Node nodeConfig + * @property {string|null} [processor] Node processor + * @property {Array.|null} [parents] Node parents + */ + + /** + * Constructs a new Node. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a Node. + * @implements INode + * @constructor + * @param {google.cloud.visionai.v1alpha1.INode=} [properties] Properties to set + */ + function Node(properties) { + this.parents = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Node outputAllOutputChannelsToStream. + * @member {boolean|null|undefined} outputAllOutputChannelsToStream + * @memberof google.cloud.visionai.v1alpha1.Node + * @instance + */ + Node.prototype.outputAllOutputChannelsToStream = null; + + /** + * Node name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.Node + * @instance + */ + Node.prototype.name = ""; + + /** + * Node displayName. + * @member {string} displayName + * @memberof google.cloud.visionai.v1alpha1.Node + * @instance + */ + Node.prototype.displayName = ""; + + /** + * Node nodeConfig. + * @member {google.cloud.visionai.v1alpha1.IProcessorConfig|null|undefined} nodeConfig + * @memberof google.cloud.visionai.v1alpha1.Node + * @instance + */ + Node.prototype.nodeConfig = null; + + /** + * Node processor. + * @member {string} processor + * @memberof google.cloud.visionai.v1alpha1.Node + * @instance + */ + Node.prototype.processor = ""; + + /** + * Node parents. + * @member {Array.} parents + * @memberof google.cloud.visionai.v1alpha1.Node + * @instance + */ + Node.prototype.parents = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Node streamOutputConfig. + * @member {"outputAllOutputChannelsToStream"|undefined} streamOutputConfig + * @memberof google.cloud.visionai.v1alpha1.Node + * @instance + */ + Object.defineProperty(Node.prototype, "streamOutputConfig", { + get: $util.oneOfGetter($oneOfFields = ["outputAllOutputChannelsToStream"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Node instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.Node + * @static + * @param {google.cloud.visionai.v1alpha1.INode=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.Node} Node instance + */ + Node.create = function create(properties) { + return new Node(properties); + }; + + /** + * Encodes the specified Node message. Does not implicitly {@link google.cloud.visionai.v1alpha1.Node.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.Node + * @static + * @param {google.cloud.visionai.v1alpha1.INode} message Node message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Node.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.nodeConfig != null && Object.hasOwnProperty.call(message, "nodeConfig")) + $root.google.cloud.visionai.v1alpha1.ProcessorConfig.encode(message.nodeConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.processor != null && Object.hasOwnProperty.call(message, "processor")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.processor); + if (message.parents != null && message.parents.length) + for (var i = 0; i < message.parents.length; ++i) + $root.google.cloud.visionai.v1alpha1.Node.InputEdge.encode(message.parents[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.outputAllOutputChannelsToStream != null && Object.hasOwnProperty.call(message, "outputAllOutputChannelsToStream")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.outputAllOutputChannelsToStream); + return writer; + }; + + /** + * Encodes the specified Node message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.Node.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.Node + * @static + * @param {google.cloud.visionai.v1alpha1.INode} message Node message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Node.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Node message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.Node + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.Node} Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Node.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.Node(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 6: { + message.outputAllOutputChannelsToStream = reader.bool(); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.nodeConfig = $root.google.cloud.visionai.v1alpha1.ProcessorConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.processor = reader.string(); + break; + } + case 5: { + if (!(message.parents && message.parents.length)) + message.parents = []; + message.parents.push($root.google.cloud.visionai.v1alpha1.Node.InputEdge.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Node message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.Node + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.Node} Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Node.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Node message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.Node + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Node.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.outputAllOutputChannelsToStream != null && message.hasOwnProperty("outputAllOutputChannelsToStream")) { + properties.streamOutputConfig = 1; + if (typeof message.outputAllOutputChannelsToStream !== "boolean") + return "outputAllOutputChannelsToStream: boolean expected"; + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.nodeConfig != null && message.hasOwnProperty("nodeConfig")) { + var error = $root.google.cloud.visionai.v1alpha1.ProcessorConfig.verify(message.nodeConfig, long + 1); + if (error) + return "nodeConfig." + error; + } + if (message.processor != null && message.hasOwnProperty("processor")) + if (!$util.isString(message.processor)) + return "processor: string expected"; + if (message.parents != null && message.hasOwnProperty("parents")) { + if (!Array.isArray(message.parents)) + return "parents: array expected"; + for (var i = 0; i < message.parents.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.Node.InputEdge.verify(message.parents[i], long + 1); + if (error) + return "parents." + error; + } + } + return null; + }; + + /** + * Creates a Node message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.Node + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.Node} Node + */ + Node.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.Node) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.Node(); + if (object.outputAllOutputChannelsToStream != null) + message.outputAllOutputChannelsToStream = Boolean(object.outputAllOutputChannelsToStream); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.nodeConfig != null) { + if (typeof object.nodeConfig !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Node.nodeConfig: object expected"); + message.nodeConfig = $root.google.cloud.visionai.v1alpha1.ProcessorConfig.fromObject(object.nodeConfig, long + 1); + } + if (object.processor != null) + message.processor = String(object.processor); + if (object.parents) { + if (!Array.isArray(object.parents)) + throw TypeError(".google.cloud.visionai.v1alpha1.Node.parents: array expected"); + message.parents = []; + for (var i = 0; i < object.parents.length; ++i) { + if (typeof object.parents[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Node.parents: object expected"); + message.parents[i] = $root.google.cloud.visionai.v1alpha1.Node.InputEdge.fromObject(object.parents[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a Node message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.Node + * @static + * @param {google.cloud.visionai.v1alpha1.Node} message Node + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Node.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.parents = []; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.nodeConfig = null; + object.processor = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.nodeConfig != null && message.hasOwnProperty("nodeConfig")) + object.nodeConfig = $root.google.cloud.visionai.v1alpha1.ProcessorConfig.toObject(message.nodeConfig, options); + if (message.processor != null && message.hasOwnProperty("processor")) + object.processor = message.processor; + if (message.parents && message.parents.length) { + object.parents = []; + for (var j = 0; j < message.parents.length; ++j) + object.parents[j] = $root.google.cloud.visionai.v1alpha1.Node.InputEdge.toObject(message.parents[j], options); + } + if (message.outputAllOutputChannelsToStream != null && message.hasOwnProperty("outputAllOutputChannelsToStream")) { + object.outputAllOutputChannelsToStream = message.outputAllOutputChannelsToStream; + if (options.oneofs) + object.streamOutputConfig = "outputAllOutputChannelsToStream"; + } + return object; + }; + + /** + * Converts this Node to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.Node + * @instance + * @returns {Object.} JSON object + */ + Node.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Node + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.Node + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Node.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.Node"; + }; + + Node.InputEdge = (function() { + + /** + * Properties of an InputEdge. + * @memberof google.cloud.visionai.v1alpha1.Node + * @interface IInputEdge + * @property {string|null} [parentNode] InputEdge parentNode + * @property {string|null} [parentOutputChannel] InputEdge parentOutputChannel + * @property {string|null} [connectedInputChannel] InputEdge connectedInputChannel + */ + + /** + * Constructs a new InputEdge. + * @memberof google.cloud.visionai.v1alpha1.Node + * @classdesc Represents an InputEdge. + * @implements IInputEdge + * @constructor + * @param {google.cloud.visionai.v1alpha1.Node.IInputEdge=} [properties] Properties to set + */ + function InputEdge(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * InputEdge parentNode. + * @member {string} parentNode + * @memberof google.cloud.visionai.v1alpha1.Node.InputEdge + * @instance + */ + InputEdge.prototype.parentNode = ""; + + /** + * InputEdge parentOutputChannel. + * @member {string} parentOutputChannel + * @memberof google.cloud.visionai.v1alpha1.Node.InputEdge + * @instance + */ + InputEdge.prototype.parentOutputChannel = ""; + + /** + * InputEdge connectedInputChannel. + * @member {string} connectedInputChannel + * @memberof google.cloud.visionai.v1alpha1.Node.InputEdge + * @instance + */ + InputEdge.prototype.connectedInputChannel = ""; + + /** + * Creates a new InputEdge instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.Node.InputEdge + * @static + * @param {google.cloud.visionai.v1alpha1.Node.IInputEdge=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.Node.InputEdge} InputEdge instance + */ + InputEdge.create = function create(properties) { + return new InputEdge(properties); + }; + + /** + * Encodes the specified InputEdge message. Does not implicitly {@link google.cloud.visionai.v1alpha1.Node.InputEdge.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.Node.InputEdge + * @static + * @param {google.cloud.visionai.v1alpha1.Node.IInputEdge} message InputEdge message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InputEdge.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parentNode != null && Object.hasOwnProperty.call(message, "parentNode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parentNode); + if (message.parentOutputChannel != null && Object.hasOwnProperty.call(message, "parentOutputChannel")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.parentOutputChannel); + if (message.connectedInputChannel != null && Object.hasOwnProperty.call(message, "connectedInputChannel")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.connectedInputChannel); + return writer; + }; + + /** + * Encodes the specified InputEdge message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.Node.InputEdge.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.Node.InputEdge + * @static + * @param {google.cloud.visionai.v1alpha1.Node.IInputEdge} message InputEdge message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InputEdge.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InputEdge message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.Node.InputEdge + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.Node.InputEdge} InputEdge + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InputEdge.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.Node.InputEdge(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parentNode = reader.string(); + break; + } + case 2: { + message.parentOutputChannel = reader.string(); + break; + } + case 3: { + message.connectedInputChannel = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an InputEdge message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.Node.InputEdge + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.Node.InputEdge} InputEdge + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InputEdge.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InputEdge message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.Node.InputEdge + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InputEdge.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parentNode != null && message.hasOwnProperty("parentNode")) + if (!$util.isString(message.parentNode)) + return "parentNode: string expected"; + if (message.parentOutputChannel != null && message.hasOwnProperty("parentOutputChannel")) + if (!$util.isString(message.parentOutputChannel)) + return "parentOutputChannel: string expected"; + if (message.connectedInputChannel != null && message.hasOwnProperty("connectedInputChannel")) + if (!$util.isString(message.connectedInputChannel)) + return "connectedInputChannel: string expected"; + return null; + }; + + /** + * Creates an InputEdge message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.Node.InputEdge + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.Node.InputEdge} InputEdge + */ + InputEdge.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.Node.InputEdge) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.Node.InputEdge(); + if (object.parentNode != null) + message.parentNode = String(object.parentNode); + if (object.parentOutputChannel != null) + message.parentOutputChannel = String(object.parentOutputChannel); + if (object.connectedInputChannel != null) + message.connectedInputChannel = String(object.connectedInputChannel); + return message; + }; + + /** + * Creates a plain object from an InputEdge message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.Node.InputEdge + * @static + * @param {google.cloud.visionai.v1alpha1.Node.InputEdge} message InputEdge + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InputEdge.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parentNode = ""; + object.parentOutputChannel = ""; + object.connectedInputChannel = ""; + } + if (message.parentNode != null && message.hasOwnProperty("parentNode")) + object.parentNode = message.parentNode; + if (message.parentOutputChannel != null && message.hasOwnProperty("parentOutputChannel")) + object.parentOutputChannel = message.parentOutputChannel; + if (message.connectedInputChannel != null && message.hasOwnProperty("connectedInputChannel")) + object.connectedInputChannel = message.connectedInputChannel; + return object; + }; + + /** + * Converts this InputEdge to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.Node.InputEdge + * @instance + * @returns {Object.} JSON object + */ + InputEdge.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InputEdge + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.Node.InputEdge + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InputEdge.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.Node.InputEdge"; + }; + + return InputEdge; + })(); + + return Node; + })(); + + v1alpha1.Draft = (function() { + + /** + * Properties of a Draft. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IDraft + * @property {string|null} [name] Draft name + * @property {google.protobuf.ITimestamp|null} [createTime] Draft createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Draft updateTime + * @property {Object.|null} [labels] Draft labels + * @property {string|null} [displayName] Draft displayName + * @property {string|null} [description] Draft description + * @property {google.cloud.visionai.v1alpha1.IApplicationConfigs|null} [draftApplicationConfigs] Draft draftApplicationConfigs + */ + + /** + * Constructs a new Draft. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a Draft. + * @implements IDraft + * @constructor + * @param {google.cloud.visionai.v1alpha1.IDraft=} [properties] Properties to set + */ + function Draft(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Draft name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.Draft + * @instance + */ + Draft.prototype.name = ""; + + /** + * Draft createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.visionai.v1alpha1.Draft + * @instance + */ + Draft.prototype.createTime = null; + + /** + * Draft updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.visionai.v1alpha1.Draft + * @instance + */ + Draft.prototype.updateTime = null; + + /** + * Draft labels. + * @member {Object.} labels + * @memberof google.cloud.visionai.v1alpha1.Draft + * @instance + */ + Draft.prototype.labels = $util.emptyObject; + + /** + * Draft displayName. + * @member {string} displayName + * @memberof google.cloud.visionai.v1alpha1.Draft + * @instance + */ + Draft.prototype.displayName = ""; + + /** + * Draft description. + * @member {string} description + * @memberof google.cloud.visionai.v1alpha1.Draft + * @instance + */ + Draft.prototype.description = ""; + + /** + * Draft draftApplicationConfigs. + * @member {google.cloud.visionai.v1alpha1.IApplicationConfigs|null|undefined} draftApplicationConfigs + * @memberof google.cloud.visionai.v1alpha1.Draft + * @instance + */ + Draft.prototype.draftApplicationConfigs = null; + + /** + * Creates a new Draft instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.Draft + * @static + * @param {google.cloud.visionai.v1alpha1.IDraft=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.Draft} Draft instance + */ + Draft.create = function create(properties) { + return new Draft(properties); + }; + + /** + * Encodes the specified Draft message. Does not implicitly {@link google.cloud.visionai.v1alpha1.Draft.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.Draft + * @static + * @param {google.cloud.visionai.v1alpha1.IDraft} message Draft message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Draft.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + if (message.draftApplicationConfigs != null && Object.hasOwnProperty.call(message, "draftApplicationConfigs")) + $root.google.cloud.visionai.v1alpha1.ApplicationConfigs.encode(message.draftApplicationConfigs, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Draft message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.Draft.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.Draft + * @static + * @param {google.cloud.visionai.v1alpha1.IDraft} message Draft message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Draft.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Draft message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.Draft + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.Draft} Draft + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Draft.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.Draft(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.labels, key); + message.labels[key] = value; + break; + } + case 4: { + message.displayName = reader.string(); + break; + } + case 5: { + message.description = reader.string(); + break; + } + case 6: { + message.draftApplicationConfigs = $root.google.cloud.visionai.v1alpha1.ApplicationConfigs.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Draft message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.Draft + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.Draft} Draft + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Draft.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Draft message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.Draft + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Draft.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime, long + 1); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime, long + 1); + if (error) + return "updateTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.draftApplicationConfigs != null && message.hasOwnProperty("draftApplicationConfigs")) { + var error = $root.google.cloud.visionai.v1alpha1.ApplicationConfigs.verify(message.draftApplicationConfigs, long + 1); + if (error) + return "draftApplicationConfigs." + error; + } + return null; + }; + + /** + * Creates a Draft message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.Draft + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.Draft} Draft + */ + Draft.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.Draft) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.Draft(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Draft.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime, long + 1); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Draft.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime, long + 1); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Draft.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.labels, keys[i]); + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + } + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.draftApplicationConfigs != null) { + if (typeof object.draftApplicationConfigs !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Draft.draftApplicationConfigs: object expected"); + message.draftApplicationConfigs = $root.google.cloud.visionai.v1alpha1.ApplicationConfigs.fromObject(object.draftApplicationConfigs, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a Draft message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.Draft + * @static + * @param {google.cloud.visionai.v1alpha1.Draft} message Draft + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Draft.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.displayName = ""; + object.description = ""; + object.draftApplicationConfigs = null; + object.updateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.labels, keys2[j]); + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.draftApplicationConfigs != null && message.hasOwnProperty("draftApplicationConfigs")) + object.draftApplicationConfigs = $root.google.cloud.visionai.v1alpha1.ApplicationConfigs.toObject(message.draftApplicationConfigs, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this Draft to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.Draft + * @instance + * @returns {Object.} JSON object + */ + Draft.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Draft + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.Draft + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Draft.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.Draft"; + }; + + return Draft; + })(); + + v1alpha1.Instance = (function() { + + /** + * Properties of an Instance. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IInstance + * @property {string|null} [name] Instance name + * @property {google.protobuf.ITimestamp|null} [createTime] Instance createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Instance updateTime + * @property {Object.|null} [labels] Instance labels + * @property {string|null} [displayName] Instance displayName + * @property {string|null} [description] Instance description + * @property {Array.|null} [inputResources] Instance inputResources + * @property {Array.|null} [outputResources] Instance outputResources + * @property {google.cloud.visionai.v1alpha1.Instance.State|null} [state] Instance state + */ + + /** + * Constructs a new Instance. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents an Instance. + * @implements IInstance + * @constructor + * @param {google.cloud.visionai.v1alpha1.IInstance=} [properties] Properties to set + */ + function Instance(properties) { + this.labels = {}; + this.inputResources = []; + this.outputResources = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Instance name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.Instance + * @instance + */ + Instance.prototype.name = ""; + + /** + * Instance createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.visionai.v1alpha1.Instance + * @instance + */ + Instance.prototype.createTime = null; + + /** + * Instance updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.visionai.v1alpha1.Instance + * @instance + */ + Instance.prototype.updateTime = null; + + /** + * Instance labels. + * @member {Object.} labels + * @memberof google.cloud.visionai.v1alpha1.Instance + * @instance + */ + Instance.prototype.labels = $util.emptyObject; + + /** + * Instance displayName. + * @member {string} displayName + * @memberof google.cloud.visionai.v1alpha1.Instance + * @instance + */ + Instance.prototype.displayName = ""; + + /** + * Instance description. + * @member {string} description + * @memberof google.cloud.visionai.v1alpha1.Instance + * @instance + */ + Instance.prototype.description = ""; + + /** + * Instance inputResources. + * @member {Array.} inputResources + * @memberof google.cloud.visionai.v1alpha1.Instance + * @instance + */ + Instance.prototype.inputResources = $util.emptyArray; + + /** + * Instance outputResources. + * @member {Array.} outputResources + * @memberof google.cloud.visionai.v1alpha1.Instance + * @instance + */ + Instance.prototype.outputResources = $util.emptyArray; + + /** + * Instance state. + * @member {google.cloud.visionai.v1alpha1.Instance.State} state + * @memberof google.cloud.visionai.v1alpha1.Instance + * @instance + */ + Instance.prototype.state = 0; + + /** + * Creates a new Instance instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.Instance + * @static + * @param {google.cloud.visionai.v1alpha1.IInstance=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.Instance} Instance instance + */ + Instance.create = function create(properties) { + return new Instance(properties); + }; + + /** + * Encodes the specified Instance message. Does not implicitly {@link google.cloud.visionai.v1alpha1.Instance.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.Instance + * @static + * @param {google.cloud.visionai.v1alpha1.IInstance} message Instance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Instance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + if (message.inputResources != null && message.inputResources.length) + for (var i = 0; i < message.inputResources.length; ++i) + $root.google.cloud.visionai.v1alpha1.Instance.InputResource.encode(message.inputResources[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.outputResources != null && message.outputResources.length) + for (var i = 0; i < message.outputResources.length; ++i) + $root.google.cloud.visionai.v1alpha1.Instance.OutputResource.encode(message.outputResources[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.state); + return writer; + }; + + /** + * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.Instance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.Instance + * @static + * @param {google.cloud.visionai.v1alpha1.IInstance} message Instance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Instance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Instance message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.Instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.Instance} Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Instance.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.Instance(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 8: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.labels, key); + message.labels[key] = value; + break; + } + case 4: { + message.displayName = reader.string(); + break; + } + case 5: { + message.description = reader.string(); + break; + } + case 6: { + if (!(message.inputResources && message.inputResources.length)) + message.inputResources = []; + message.inputResources.push($root.google.cloud.visionai.v1alpha1.Instance.InputResource.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 7: { + if (!(message.outputResources && message.outputResources.length)) + message.outputResources = []; + message.outputResources.push($root.google.cloud.visionai.v1alpha1.Instance.OutputResource.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 9: { + message.state = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an Instance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.Instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.Instance} Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Instance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Instance message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.Instance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Instance.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime, long + 1); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime, long + 1); + if (error) + return "updateTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.inputResources != null && message.hasOwnProperty("inputResources")) { + if (!Array.isArray(message.inputResources)) + return "inputResources: array expected"; + for (var i = 0; i < message.inputResources.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.Instance.InputResource.verify(message.inputResources[i], long + 1); + if (error) + return "inputResources." + error; + } + } + if (message.outputResources != null && message.hasOwnProperty("outputResources")) { + if (!Array.isArray(message.outputResources)) + return "outputResources: array expected"; + for (var i = 0; i < message.outputResources.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.Instance.OutputResource.verify(message.outputResources[i], long + 1); + if (error) + return "outputResources." + error; + } + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + break; + } + return null; + }; + + /** + * Creates an Instance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.Instance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.Instance} Instance + */ + Instance.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.Instance) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.Instance(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Instance.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime, long + 1); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Instance.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime, long + 1); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Instance.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.labels, keys[i]); + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + } + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.inputResources) { + if (!Array.isArray(object.inputResources)) + throw TypeError(".google.cloud.visionai.v1alpha1.Instance.inputResources: array expected"); + message.inputResources = []; + for (var i = 0; i < object.inputResources.length; ++i) { + if (typeof object.inputResources[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Instance.inputResources: object expected"); + message.inputResources[i] = $root.google.cloud.visionai.v1alpha1.Instance.InputResource.fromObject(object.inputResources[i], long + 1); + } + } + if (object.outputResources) { + if (!Array.isArray(object.outputResources)) + throw TypeError(".google.cloud.visionai.v1alpha1.Instance.outputResources: array expected"); + message.outputResources = []; + for (var i = 0; i < object.outputResources.length; ++i) { + if (typeof object.outputResources[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Instance.outputResources: object expected"); + message.outputResources[i] = $root.google.cloud.visionai.v1alpha1.Instance.OutputResource.fromObject(object.outputResources[i], long + 1); + } + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATING": + case 1: + message.state = 1; + break; + case "CREATED": + case 2: + message.state = 2; + break; + case "DEPLOYING": + case 3: + message.state = 3; + break; + case "DEPLOYED": + case 4: + message.state = 4; + break; + case "UNDEPLOYING": + case 5: + message.state = 5; + break; + case "DELETED": + case 6: + message.state = 6; + break; + case "ERROR": + case 7: + message.state = 7; + break; + case "UPDATING": + case 8: + message.state = 8; + break; + case "DELETING": + case 9: + message.state = 9; + break; + case "FIXING": + case 10: + message.state = 10; + break; + } + return message; + }; + + /** + * Creates a plain object from an Instance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.Instance + * @static + * @param {google.cloud.visionai.v1alpha1.Instance} message Instance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Instance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.inputResources = []; + object.outputResources = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.displayName = ""; + object.description = ""; + object.updateTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.labels, keys2[j]); + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.inputResources && message.inputResources.length) { + object.inputResources = []; + for (var j = 0; j < message.inputResources.length; ++j) + object.inputResources[j] = $root.google.cloud.visionai.v1alpha1.Instance.InputResource.toObject(message.inputResources[j], options); + } + if (message.outputResources && message.outputResources.length) { + object.outputResources = []; + for (var j = 0; j < message.outputResources.length; ++j) + object.outputResources[j] = $root.google.cloud.visionai.v1alpha1.Instance.OutputResource.toObject(message.outputResources[j], options); + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.visionai.v1alpha1.Instance.State[message.state] === undefined ? message.state : $root.google.cloud.visionai.v1alpha1.Instance.State[message.state] : message.state; + return object; + }; + + /** + * Converts this Instance to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.Instance + * @instance + * @returns {Object.} JSON object + */ + Instance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Instance + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.Instance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Instance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.Instance"; + }; + + Instance.InputResource = (function() { + + /** + * Properties of an InputResource. + * @memberof google.cloud.visionai.v1alpha1.Instance + * @interface IInputResource + * @property {string|null} [inputResource] InputResource inputResource + * @property {google.cloud.visionai.v1alpha1.IStreamWithAnnotation|null} [annotatedStream] InputResource annotatedStream + * @property {string|null} [consumerNode] InputResource consumerNode + * @property {string|null} [inputResourceBinding] InputResource inputResourceBinding + * @property {google.cloud.visionai.v1alpha1.IResourceAnnotations|null} [annotations] InputResource annotations + */ + + /** + * Constructs a new InputResource. + * @memberof google.cloud.visionai.v1alpha1.Instance + * @classdesc Represents an InputResource. + * @implements IInputResource + * @constructor + * @param {google.cloud.visionai.v1alpha1.Instance.IInputResource=} [properties] Properties to set + */ + function InputResource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * InputResource inputResource. + * @member {string|null|undefined} inputResource + * @memberof google.cloud.visionai.v1alpha1.Instance.InputResource + * @instance + */ + InputResource.prototype.inputResource = null; + + /** + * InputResource annotatedStream. + * @member {google.cloud.visionai.v1alpha1.IStreamWithAnnotation|null|undefined} annotatedStream + * @memberof google.cloud.visionai.v1alpha1.Instance.InputResource + * @instance + */ + InputResource.prototype.annotatedStream = null; + + /** + * InputResource consumerNode. + * @member {string} consumerNode + * @memberof google.cloud.visionai.v1alpha1.Instance.InputResource + * @instance + */ + InputResource.prototype.consumerNode = ""; + + /** + * InputResource inputResourceBinding. + * @member {string} inputResourceBinding + * @memberof google.cloud.visionai.v1alpha1.Instance.InputResource + * @instance + */ + InputResource.prototype.inputResourceBinding = ""; + + /** + * InputResource annotations. + * @member {google.cloud.visionai.v1alpha1.IResourceAnnotations|null|undefined} annotations + * @memberof google.cloud.visionai.v1alpha1.Instance.InputResource + * @instance + */ + InputResource.prototype.annotations = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InputResource inputResourceInformation. + * @member {"inputResource"|"annotatedStream"|undefined} inputResourceInformation + * @memberof google.cloud.visionai.v1alpha1.Instance.InputResource + * @instance + */ + Object.defineProperty(InputResource.prototype, "inputResourceInformation", { + get: $util.oneOfGetter($oneOfFields = ["inputResource", "annotatedStream"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InputResource instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.Instance.InputResource + * @static + * @param {google.cloud.visionai.v1alpha1.Instance.IInputResource=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.Instance.InputResource} InputResource instance + */ + InputResource.create = function create(properties) { + return new InputResource(properties); + }; + + /** + * Encodes the specified InputResource message. Does not implicitly {@link google.cloud.visionai.v1alpha1.Instance.InputResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.Instance.InputResource + * @static + * @param {google.cloud.visionai.v1alpha1.Instance.IInputResource} message InputResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InputResource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputResource != null && Object.hasOwnProperty.call(message, "inputResource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.inputResource); + if (message.consumerNode != null && Object.hasOwnProperty.call(message, "consumerNode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.consumerNode); + if (message.inputResourceBinding != null && Object.hasOwnProperty.call(message, "inputResourceBinding")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.inputResourceBinding); + if (message.annotatedStream != null && Object.hasOwnProperty.call(message, "annotatedStream")) + $root.google.cloud.visionai.v1alpha1.StreamWithAnnotation.encode(message.annotatedStream, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + $root.google.cloud.visionai.v1alpha1.ResourceAnnotations.encode(message.annotations, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InputResource message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.Instance.InputResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.Instance.InputResource + * @static + * @param {google.cloud.visionai.v1alpha1.Instance.IInputResource} message InputResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InputResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InputResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.Instance.InputResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.Instance.InputResource} InputResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InputResource.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.Instance.InputResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.inputResource = reader.string(); + break; + } + case 4: { + message.annotatedStream = $root.google.cloud.visionai.v1alpha1.StreamWithAnnotation.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.consumerNode = reader.string(); + break; + } + case 3: { + message.inputResourceBinding = reader.string(); + break; + } + case 5: { + message.annotations = $root.google.cloud.visionai.v1alpha1.ResourceAnnotations.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an InputResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.Instance.InputResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.Instance.InputResource} InputResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InputResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InputResource message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.Instance.InputResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InputResource.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.inputResource != null && message.hasOwnProperty("inputResource")) { + properties.inputResourceInformation = 1; + if (!$util.isString(message.inputResource)) + return "inputResource: string expected"; + } + if (message.annotatedStream != null && message.hasOwnProperty("annotatedStream")) { + if (properties.inputResourceInformation === 1) + return "inputResourceInformation: multiple values"; + properties.inputResourceInformation = 1; + { + var error = $root.google.cloud.visionai.v1alpha1.StreamWithAnnotation.verify(message.annotatedStream, long + 1); + if (error) + return "annotatedStream." + error; + } + } + if (message.consumerNode != null && message.hasOwnProperty("consumerNode")) + if (!$util.isString(message.consumerNode)) + return "consumerNode: string expected"; + if (message.inputResourceBinding != null && message.hasOwnProperty("inputResourceBinding")) + if (!$util.isString(message.inputResourceBinding)) + return "inputResourceBinding: string expected"; + if (message.annotations != null && message.hasOwnProperty("annotations")) { + var error = $root.google.cloud.visionai.v1alpha1.ResourceAnnotations.verify(message.annotations, long + 1); + if (error) + return "annotations." + error; + } + return null; + }; + + /** + * Creates an InputResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.Instance.InputResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.Instance.InputResource} InputResource + */ + InputResource.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.Instance.InputResource) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.Instance.InputResource(); + if (object.inputResource != null) + message.inputResource = String(object.inputResource); + if (object.annotatedStream != null) { + if (typeof object.annotatedStream !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Instance.InputResource.annotatedStream: object expected"); + message.annotatedStream = $root.google.cloud.visionai.v1alpha1.StreamWithAnnotation.fromObject(object.annotatedStream, long + 1); + } + if (object.consumerNode != null) + message.consumerNode = String(object.consumerNode); + if (object.inputResourceBinding != null) + message.inputResourceBinding = String(object.inputResourceBinding); + if (object.annotations != null) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Instance.InputResource.annotations: object expected"); + message.annotations = $root.google.cloud.visionai.v1alpha1.ResourceAnnotations.fromObject(object.annotations, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an InputResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.Instance.InputResource + * @static + * @param {google.cloud.visionai.v1alpha1.Instance.InputResource} message InputResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InputResource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.consumerNode = ""; + object.inputResourceBinding = ""; + object.annotations = null; + } + if (message.inputResource != null && message.hasOwnProperty("inputResource")) { + object.inputResource = message.inputResource; + if (options.oneofs) + object.inputResourceInformation = "inputResource"; + } + if (message.consumerNode != null && message.hasOwnProperty("consumerNode")) + object.consumerNode = message.consumerNode; + if (message.inputResourceBinding != null && message.hasOwnProperty("inputResourceBinding")) + object.inputResourceBinding = message.inputResourceBinding; + if (message.annotatedStream != null && message.hasOwnProperty("annotatedStream")) { + object.annotatedStream = $root.google.cloud.visionai.v1alpha1.StreamWithAnnotation.toObject(message.annotatedStream, options); + if (options.oneofs) + object.inputResourceInformation = "annotatedStream"; + } + if (message.annotations != null && message.hasOwnProperty("annotations")) + object.annotations = $root.google.cloud.visionai.v1alpha1.ResourceAnnotations.toObject(message.annotations, options); + return object; + }; + + /** + * Converts this InputResource to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.Instance.InputResource + * @instance + * @returns {Object.} JSON object + */ + InputResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InputResource + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.Instance.InputResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InputResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.Instance.InputResource"; + }; + + return InputResource; + })(); + + Instance.OutputResource = (function() { + + /** + * Properties of an OutputResource. + * @memberof google.cloud.visionai.v1alpha1.Instance + * @interface IOutputResource + * @property {string|null} [outputResource] OutputResource outputResource + * @property {string|null} [producerNode] OutputResource producerNode + * @property {string|null} [outputResourceBinding] OutputResource outputResourceBinding + * @property {boolean|null} [isTemporary] OutputResource isTemporary + * @property {boolean|null} [autogen] OutputResource autogen + */ + + /** + * Constructs a new OutputResource. + * @memberof google.cloud.visionai.v1alpha1.Instance + * @classdesc Represents an OutputResource. + * @implements IOutputResource + * @constructor + * @param {google.cloud.visionai.v1alpha1.Instance.IOutputResource=} [properties] Properties to set + */ + function OutputResource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * OutputResource outputResource. + * @member {string} outputResource + * @memberof google.cloud.visionai.v1alpha1.Instance.OutputResource + * @instance + */ + OutputResource.prototype.outputResource = ""; + + /** + * OutputResource producerNode. + * @member {string} producerNode + * @memberof google.cloud.visionai.v1alpha1.Instance.OutputResource + * @instance + */ + OutputResource.prototype.producerNode = ""; + + /** + * OutputResource outputResourceBinding. + * @member {string} outputResourceBinding + * @memberof google.cloud.visionai.v1alpha1.Instance.OutputResource + * @instance + */ + OutputResource.prototype.outputResourceBinding = ""; + + /** + * OutputResource isTemporary. + * @member {boolean} isTemporary + * @memberof google.cloud.visionai.v1alpha1.Instance.OutputResource + * @instance + */ + OutputResource.prototype.isTemporary = false; + + /** + * OutputResource autogen. + * @member {boolean} autogen + * @memberof google.cloud.visionai.v1alpha1.Instance.OutputResource + * @instance + */ + OutputResource.prototype.autogen = false; + + /** + * Creates a new OutputResource instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.Instance.OutputResource + * @static + * @param {google.cloud.visionai.v1alpha1.Instance.IOutputResource=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.Instance.OutputResource} OutputResource instance + */ + OutputResource.create = function create(properties) { + return new OutputResource(properties); + }; + + /** + * Encodes the specified OutputResource message. Does not implicitly {@link google.cloud.visionai.v1alpha1.Instance.OutputResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.Instance.OutputResource + * @static + * @param {google.cloud.visionai.v1alpha1.Instance.IOutputResource} message OutputResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputResource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.outputResource != null && Object.hasOwnProperty.call(message, "outputResource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.outputResource); + if (message.producerNode != null && Object.hasOwnProperty.call(message, "producerNode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.producerNode); + if (message.isTemporary != null && Object.hasOwnProperty.call(message, "isTemporary")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.isTemporary); + if (message.outputResourceBinding != null && Object.hasOwnProperty.call(message, "outputResourceBinding")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.outputResourceBinding); + if (message.autogen != null && Object.hasOwnProperty.call(message, "autogen")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.autogen); + return writer; + }; + + /** + * Encodes the specified OutputResource message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.Instance.OutputResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.Instance.OutputResource + * @static + * @param {google.cloud.visionai.v1alpha1.Instance.IOutputResource} message OutputResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OutputResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.Instance.OutputResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.Instance.OutputResource} OutputResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputResource.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.Instance.OutputResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.outputResource = reader.string(); + break; + } + case 2: { + message.producerNode = reader.string(); + break; + } + case 4: { + message.outputResourceBinding = reader.string(); + break; + } + case 3: { + message.isTemporary = reader.bool(); + break; + } + case 5: { + message.autogen = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an OutputResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.Instance.OutputResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.Instance.OutputResource} OutputResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OutputResource message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.Instance.OutputResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OutputResource.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.outputResource != null && message.hasOwnProperty("outputResource")) + if (!$util.isString(message.outputResource)) + return "outputResource: string expected"; + if (message.producerNode != null && message.hasOwnProperty("producerNode")) + if (!$util.isString(message.producerNode)) + return "producerNode: string expected"; + if (message.outputResourceBinding != null && message.hasOwnProperty("outputResourceBinding")) + if (!$util.isString(message.outputResourceBinding)) + return "outputResourceBinding: string expected"; + if (message.isTemporary != null && message.hasOwnProperty("isTemporary")) + if (typeof message.isTemporary !== "boolean") + return "isTemporary: boolean expected"; + if (message.autogen != null && message.hasOwnProperty("autogen")) + if (typeof message.autogen !== "boolean") + return "autogen: boolean expected"; + return null; + }; + + /** + * Creates an OutputResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.Instance.OutputResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.Instance.OutputResource} OutputResource + */ + OutputResource.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.Instance.OutputResource) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.Instance.OutputResource(); + if (object.outputResource != null) + message.outputResource = String(object.outputResource); + if (object.producerNode != null) + message.producerNode = String(object.producerNode); + if (object.outputResourceBinding != null) + message.outputResourceBinding = String(object.outputResourceBinding); + if (object.isTemporary != null) + message.isTemporary = Boolean(object.isTemporary); + if (object.autogen != null) + message.autogen = Boolean(object.autogen); + return message; + }; + + /** + * Creates a plain object from an OutputResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.Instance.OutputResource + * @static + * @param {google.cloud.visionai.v1alpha1.Instance.OutputResource} message OutputResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OutputResource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.outputResource = ""; + object.producerNode = ""; + object.isTemporary = false; + object.outputResourceBinding = ""; + object.autogen = false; + } + if (message.outputResource != null && message.hasOwnProperty("outputResource")) + object.outputResource = message.outputResource; + if (message.producerNode != null && message.hasOwnProperty("producerNode")) + object.producerNode = message.producerNode; + if (message.isTemporary != null && message.hasOwnProperty("isTemporary")) + object.isTemporary = message.isTemporary; + if (message.outputResourceBinding != null && message.hasOwnProperty("outputResourceBinding")) + object.outputResourceBinding = message.outputResourceBinding; + if (message.autogen != null && message.hasOwnProperty("autogen")) + object.autogen = message.autogen; + return object; + }; + + /** + * Converts this OutputResource to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.Instance.OutputResource + * @instance + * @returns {Object.} JSON object + */ + OutputResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OutputResource + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.Instance.OutputResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OutputResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.Instance.OutputResource"; + }; + + return OutputResource; + })(); + + /** + * State enum. + * @name google.cloud.visionai.v1alpha1.Instance.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} CREATED=2 CREATED value + * @property {number} DEPLOYING=3 DEPLOYING value + * @property {number} DEPLOYED=4 DEPLOYED value + * @property {number} UNDEPLOYING=5 UNDEPLOYING value + * @property {number} DELETED=6 DELETED value + * @property {number} ERROR=7 ERROR value + * @property {number} UPDATING=8 UPDATING value + * @property {number} DELETING=9 DELETING value + * @property {number} FIXING=10 FIXING value + */ + Instance.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "CREATED"] = 2; + values[valuesById[3] = "DEPLOYING"] = 3; + values[valuesById[4] = "DEPLOYED"] = 4; + values[valuesById[5] = "UNDEPLOYING"] = 5; + values[valuesById[6] = "DELETED"] = 6; + values[valuesById[7] = "ERROR"] = 7; + values[valuesById[8] = "UPDATING"] = 8; + values[valuesById[9] = "DELETING"] = 9; + values[valuesById[10] = "FIXING"] = 10; + return values; + })(); + + return Instance; + })(); + + v1alpha1.ApplicationInstance = (function() { + + /** + * Properties of an ApplicationInstance. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IApplicationInstance + * @property {string|null} [instanceId] ApplicationInstance instanceId + * @property {google.cloud.visionai.v1alpha1.IInstance|null} [instance] ApplicationInstance instance + */ + + /** + * Constructs a new ApplicationInstance. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents an ApplicationInstance. + * @implements IApplicationInstance + * @constructor + * @param {google.cloud.visionai.v1alpha1.IApplicationInstance=} [properties] Properties to set + */ + function ApplicationInstance(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ApplicationInstance instanceId. + * @member {string} instanceId + * @memberof google.cloud.visionai.v1alpha1.ApplicationInstance + * @instance + */ + ApplicationInstance.prototype.instanceId = ""; + + /** + * ApplicationInstance instance. + * @member {google.cloud.visionai.v1alpha1.IInstance|null|undefined} instance + * @memberof google.cloud.visionai.v1alpha1.ApplicationInstance + * @instance + */ + ApplicationInstance.prototype.instance = null; + + /** + * Creates a new ApplicationInstance instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ApplicationInstance + * @static + * @param {google.cloud.visionai.v1alpha1.IApplicationInstance=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ApplicationInstance} ApplicationInstance instance + */ + ApplicationInstance.create = function create(properties) { + return new ApplicationInstance(properties); + }; + + /** + * Encodes the specified ApplicationInstance message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ApplicationInstance.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ApplicationInstance + * @static + * @param {google.cloud.visionai.v1alpha1.IApplicationInstance} message ApplicationInstance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApplicationInstance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.instanceId); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + $root.google.cloud.visionai.v1alpha1.Instance.encode(message.instance, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ApplicationInstance message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ApplicationInstance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ApplicationInstance + * @static + * @param {google.cloud.visionai.v1alpha1.IApplicationInstance} message ApplicationInstance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApplicationInstance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApplicationInstance message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ApplicationInstance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ApplicationInstance} ApplicationInstance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApplicationInstance.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ApplicationInstance(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.instanceId = reader.string(); + break; + } + case 2: { + message.instance = $root.google.cloud.visionai.v1alpha1.Instance.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ApplicationInstance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ApplicationInstance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ApplicationInstance} ApplicationInstance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApplicationInstance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApplicationInstance message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ApplicationInstance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApplicationInstance.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (!$util.isString(message.instanceId)) + return "instanceId: string expected"; + if (message.instance != null && message.hasOwnProperty("instance")) { + var error = $root.google.cloud.visionai.v1alpha1.Instance.verify(message.instance, long + 1); + if (error) + return "instance." + error; + } + return null; + }; + + /** + * Creates an ApplicationInstance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ApplicationInstance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ApplicationInstance} ApplicationInstance + */ + ApplicationInstance.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ApplicationInstance) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ApplicationInstance(); + if (object.instanceId != null) + message.instanceId = String(object.instanceId); + if (object.instance != null) { + if (typeof object.instance !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ApplicationInstance.instance: object expected"); + message.instance = $root.google.cloud.visionai.v1alpha1.Instance.fromObject(object.instance, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an ApplicationInstance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ApplicationInstance + * @static + * @param {google.cloud.visionai.v1alpha1.ApplicationInstance} message ApplicationInstance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApplicationInstance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.instanceId = ""; + object.instance = null; + } + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + object.instanceId = message.instanceId; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = $root.google.cloud.visionai.v1alpha1.Instance.toObject(message.instance, options); + return object; + }; + + /** + * Converts this ApplicationInstance to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ApplicationInstance + * @instance + * @returns {Object.} JSON object + */ + ApplicationInstance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ApplicationInstance + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ApplicationInstance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ApplicationInstance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ApplicationInstance"; + }; + + return ApplicationInstance; + })(); + + v1alpha1.Processor = (function() { + + /** + * Properties of a Processor. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IProcessor + * @property {string|null} [name] Processor name + * @property {google.protobuf.ITimestamp|null} [createTime] Processor createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Processor updateTime + * @property {Object.|null} [labels] Processor labels + * @property {string|null} [displayName] Processor displayName + * @property {string|null} [description] Processor description + * @property {google.cloud.visionai.v1alpha1.Processor.ProcessorType|null} [processorType] Processor processorType + * @property {google.cloud.visionai.v1alpha1.ModelType|null} [modelType] Processor modelType + * @property {google.cloud.visionai.v1alpha1.ICustomProcessorSourceInfo|null} [customProcessorSourceInfo] Processor customProcessorSourceInfo + * @property {google.cloud.visionai.v1alpha1.Processor.ProcessorState|null} [state] Processor state + * @property {google.cloud.visionai.v1alpha1.IProcessorIOSpec|null} [processorIoSpec] Processor processorIoSpec + * @property {string|null} [configurationTypeurl] Processor configurationTypeurl + * @property {Array.|null} [supportedAnnotationTypes] Processor supportedAnnotationTypes + * @property {boolean|null} [supportsPostProcessing] Processor supportsPostProcessing + */ + + /** + * Constructs a new Processor. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a Processor. + * @implements IProcessor + * @constructor + * @param {google.cloud.visionai.v1alpha1.IProcessor=} [properties] Properties to set + */ + function Processor(properties) { + this.labels = {}; + this.supportedAnnotationTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Processor name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.Processor + * @instance + */ + Processor.prototype.name = ""; + + /** + * Processor createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.visionai.v1alpha1.Processor + * @instance + */ + Processor.prototype.createTime = null; + + /** + * Processor updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.visionai.v1alpha1.Processor + * @instance + */ + Processor.prototype.updateTime = null; + + /** + * Processor labels. + * @member {Object.} labels + * @memberof google.cloud.visionai.v1alpha1.Processor + * @instance + */ + Processor.prototype.labels = $util.emptyObject; + + /** + * Processor displayName. + * @member {string} displayName + * @memberof google.cloud.visionai.v1alpha1.Processor + * @instance + */ + Processor.prototype.displayName = ""; + + /** + * Processor description. + * @member {string} description + * @memberof google.cloud.visionai.v1alpha1.Processor + * @instance + */ + Processor.prototype.description = ""; + + /** + * Processor processorType. + * @member {google.cloud.visionai.v1alpha1.Processor.ProcessorType} processorType + * @memberof google.cloud.visionai.v1alpha1.Processor + * @instance + */ + Processor.prototype.processorType = 0; + + /** + * Processor modelType. + * @member {google.cloud.visionai.v1alpha1.ModelType} modelType + * @memberof google.cloud.visionai.v1alpha1.Processor + * @instance + */ + Processor.prototype.modelType = 0; + + /** + * Processor customProcessorSourceInfo. + * @member {google.cloud.visionai.v1alpha1.ICustomProcessorSourceInfo|null|undefined} customProcessorSourceInfo + * @memberof google.cloud.visionai.v1alpha1.Processor + * @instance + */ + Processor.prototype.customProcessorSourceInfo = null; + + /** + * Processor state. + * @member {google.cloud.visionai.v1alpha1.Processor.ProcessorState} state + * @memberof google.cloud.visionai.v1alpha1.Processor + * @instance + */ + Processor.prototype.state = 0; + + /** + * Processor processorIoSpec. + * @member {google.cloud.visionai.v1alpha1.IProcessorIOSpec|null|undefined} processorIoSpec + * @memberof google.cloud.visionai.v1alpha1.Processor + * @instance + */ + Processor.prototype.processorIoSpec = null; + + /** + * Processor configurationTypeurl. + * @member {string} configurationTypeurl + * @memberof google.cloud.visionai.v1alpha1.Processor + * @instance + */ + Processor.prototype.configurationTypeurl = ""; + + /** + * Processor supportedAnnotationTypes. + * @member {Array.} supportedAnnotationTypes + * @memberof google.cloud.visionai.v1alpha1.Processor + * @instance + */ + Processor.prototype.supportedAnnotationTypes = $util.emptyArray; + + /** + * Processor supportsPostProcessing. + * @member {boolean} supportsPostProcessing + * @memberof google.cloud.visionai.v1alpha1.Processor + * @instance + */ + Processor.prototype.supportsPostProcessing = false; + + /** + * Creates a new Processor instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.Processor + * @static + * @param {google.cloud.visionai.v1alpha1.IProcessor=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.Processor} Processor instance + */ + Processor.create = function create(properties) { + return new Processor(properties); + }; + + /** + * Encodes the specified Processor message. Does not implicitly {@link google.cloud.visionai.v1alpha1.Processor.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.Processor + * @static + * @param {google.cloud.visionai.v1alpha1.IProcessor} message Processor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Processor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.displayName); + if (message.processorType != null && Object.hasOwnProperty.call(message, "processorType")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.processorType); + if (message.customProcessorSourceInfo != null && Object.hasOwnProperty.call(message, "customProcessorSourceInfo")) + $root.google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.encode(message.customProcessorSourceInfo, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.state); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.description); + if (message.processorIoSpec != null && Object.hasOwnProperty.call(message, "processorIoSpec")) + $root.google.cloud.visionai.v1alpha1.ProcessorIOSpec.encode(message.processorIoSpec, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.modelType != null && Object.hasOwnProperty.call(message, "modelType")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.modelType); + if (message.configurationTypeurl != null && Object.hasOwnProperty.call(message, "configurationTypeurl")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.configurationTypeurl); + if (message.supportedAnnotationTypes != null && message.supportedAnnotationTypes.length) { + writer.uint32(/* id 15, wireType 2 =*/122).fork(); + for (var i = 0; i < message.supportedAnnotationTypes.length; ++i) + writer.int32(message.supportedAnnotationTypes[i]); + writer.ldelim(); + } + if (message.supportsPostProcessing != null && Object.hasOwnProperty.call(message, "supportsPostProcessing")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.supportsPostProcessing); + return writer; + }; + + /** + * Encodes the specified Processor message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.Processor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.Processor + * @static + * @param {google.cloud.visionai.v1alpha1.IProcessor} message Processor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Processor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Processor message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.Processor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.Processor} Processor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Processor.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.Processor(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.labels, key); + message.labels[key] = value; + break; + } + case 5: { + message.displayName = reader.string(); + break; + } + case 10: { + message.description = reader.string(); + break; + } + case 6: { + message.processorType = reader.int32(); + break; + } + case 13: { + message.modelType = reader.int32(); + break; + } + case 7: { + message.customProcessorSourceInfo = $root.google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 8: { + message.state = reader.int32(); + break; + } + case 11: { + message.processorIoSpec = $root.google.cloud.visionai.v1alpha1.ProcessorIOSpec.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 14: { + message.configurationTypeurl = reader.string(); + break; + } + case 15: { + if (!(message.supportedAnnotationTypes && message.supportedAnnotationTypes.length)) + message.supportedAnnotationTypes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.supportedAnnotationTypes.push(reader.int32()); + } else + message.supportedAnnotationTypes.push(reader.int32()); + break; + } + case 17: { + message.supportsPostProcessing = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Processor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.Processor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.Processor} Processor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Processor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Processor message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.Processor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Processor.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime, long + 1); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime, long + 1); + if (error) + return "updateTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.processorType != null && message.hasOwnProperty("processorType")) + switch (message.processorType) { + default: + return "processorType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.modelType != null && message.hasOwnProperty("modelType")) + switch (message.modelType) { + default: + return "modelType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + if (message.customProcessorSourceInfo != null && message.hasOwnProperty("customProcessorSourceInfo")) { + var error = $root.google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.verify(message.customProcessorSourceInfo, long + 1); + if (error) + return "customProcessorSourceInfo." + error; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.processorIoSpec != null && message.hasOwnProperty("processorIoSpec")) { + var error = $root.google.cloud.visionai.v1alpha1.ProcessorIOSpec.verify(message.processorIoSpec, long + 1); + if (error) + return "processorIoSpec." + error; + } + if (message.configurationTypeurl != null && message.hasOwnProperty("configurationTypeurl")) + if (!$util.isString(message.configurationTypeurl)) + return "configurationTypeurl: string expected"; + if (message.supportedAnnotationTypes != null && message.hasOwnProperty("supportedAnnotationTypes")) { + if (!Array.isArray(message.supportedAnnotationTypes)) + return "supportedAnnotationTypes: array expected"; + for (var i = 0; i < message.supportedAnnotationTypes.length; ++i) + switch (message.supportedAnnotationTypes[i]) { + default: + return "supportedAnnotationTypes: enum value[] expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.supportsPostProcessing != null && message.hasOwnProperty("supportsPostProcessing")) + if (typeof message.supportsPostProcessing !== "boolean") + return "supportsPostProcessing: boolean expected"; + return null; + }; + + /** + * Creates a Processor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.Processor + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.Processor} Processor + */ + Processor.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.Processor) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.Processor(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Processor.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime, long + 1); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Processor.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime, long + 1); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Processor.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.labels, keys[i]); + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + } + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + switch (object.processorType) { + default: + if (typeof object.processorType === "number") { + message.processorType = object.processorType; + break; + } + break; + case "PROCESSOR_TYPE_UNSPECIFIED": + case 0: + message.processorType = 0; + break; + case "PRETRAINED": + case 1: + message.processorType = 1; + break; + case "CUSTOM": + case 2: + message.processorType = 2; + break; + case "CONNECTOR": + case 3: + message.processorType = 3; + break; + } + switch (object.modelType) { + default: + if (typeof object.modelType === "number") { + message.modelType = object.modelType; + break; + } + break; + case "MODEL_TYPE_UNSPECIFIED": + case 0: + message.modelType = 0; + break; + case "IMAGE_CLASSIFICATION": + case 1: + message.modelType = 1; + break; + case "OBJECT_DETECTION": + case 2: + message.modelType = 2; + break; + case "VIDEO_CLASSIFICATION": + case 3: + message.modelType = 3; + break; + case "VIDEO_OBJECT_TRACKING": + case 4: + message.modelType = 4; + break; + case "VIDEO_ACTION_RECOGNITION": + case 5: + message.modelType = 5; + break; + case "OCCUPANCY_COUNTING": + case 6: + message.modelType = 6; + break; + case "PERSON_BLUR": + case 7: + message.modelType = 7; + break; + case "VERTEX_CUSTOM": + case 8: + message.modelType = 8; + break; + } + if (object.customProcessorSourceInfo != null) { + if (typeof object.customProcessorSourceInfo !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Processor.customProcessorSourceInfo: object expected"); + message.customProcessorSourceInfo = $root.google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.fromObject(object.customProcessorSourceInfo, long + 1); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "PROCESSOR_STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATING": + case 1: + message.state = 1; + break; + case "ACTIVE": + case 2: + message.state = 2; + break; + case "DELETING": + case 3: + message.state = 3; + break; + case "FAILED": + case 4: + message.state = 4; + break; + } + if (object.processorIoSpec != null) { + if (typeof object.processorIoSpec !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Processor.processorIoSpec: object expected"); + message.processorIoSpec = $root.google.cloud.visionai.v1alpha1.ProcessorIOSpec.fromObject(object.processorIoSpec, long + 1); + } + if (object.configurationTypeurl != null) + message.configurationTypeurl = String(object.configurationTypeurl); + if (object.supportedAnnotationTypes) { + if (!Array.isArray(object.supportedAnnotationTypes)) + throw TypeError(".google.cloud.visionai.v1alpha1.Processor.supportedAnnotationTypes: array expected"); + message.supportedAnnotationTypes = []; + for (var i = 0; i < object.supportedAnnotationTypes.length; ++i) + switch (object.supportedAnnotationTypes[i]) { + default: + if (typeof object.supportedAnnotationTypes[i] === "number") { + message.supportedAnnotationTypes[i] = object.supportedAnnotationTypes[i]; + break; + } + case "STREAM_ANNOTATION_TYPE_UNSPECIFIED": + case 0: + message.supportedAnnotationTypes[i] = 0; + break; + case "STREAM_ANNOTATION_TYPE_ACTIVE_ZONE": + case 1: + message.supportedAnnotationTypes[i] = 1; + break; + case "STREAM_ANNOTATION_TYPE_CROSSING_LINE": + case 2: + message.supportedAnnotationTypes[i] = 2; + break; + } + } + if (object.supportsPostProcessing != null) + message.supportsPostProcessing = Boolean(object.supportsPostProcessing); + return message; + }; + + /** + * Creates a plain object from a Processor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.Processor + * @static + * @param {google.cloud.visionai.v1alpha1.Processor} message Processor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Processor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.supportedAnnotationTypes = []; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.displayName = ""; + object.processorType = options.enums === String ? "PROCESSOR_TYPE_UNSPECIFIED" : 0; + object.customProcessorSourceInfo = null; + object.state = options.enums === String ? "PROCESSOR_STATE_UNSPECIFIED" : 0; + object.description = ""; + object.processorIoSpec = null; + object.modelType = options.enums === String ? "MODEL_TYPE_UNSPECIFIED" : 0; + object.configurationTypeurl = ""; + object.supportsPostProcessing = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.labels, keys2[j]); + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.processorType != null && message.hasOwnProperty("processorType")) + object.processorType = options.enums === String ? $root.google.cloud.visionai.v1alpha1.Processor.ProcessorType[message.processorType] === undefined ? message.processorType : $root.google.cloud.visionai.v1alpha1.Processor.ProcessorType[message.processorType] : message.processorType; + if (message.customProcessorSourceInfo != null && message.hasOwnProperty("customProcessorSourceInfo")) + object.customProcessorSourceInfo = $root.google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.toObject(message.customProcessorSourceInfo, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.visionai.v1alpha1.Processor.ProcessorState[message.state] === undefined ? message.state : $root.google.cloud.visionai.v1alpha1.Processor.ProcessorState[message.state] : message.state; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.processorIoSpec != null && message.hasOwnProperty("processorIoSpec")) + object.processorIoSpec = $root.google.cloud.visionai.v1alpha1.ProcessorIOSpec.toObject(message.processorIoSpec, options); + if (message.modelType != null && message.hasOwnProperty("modelType")) + object.modelType = options.enums === String ? $root.google.cloud.visionai.v1alpha1.ModelType[message.modelType] === undefined ? message.modelType : $root.google.cloud.visionai.v1alpha1.ModelType[message.modelType] : message.modelType; + if (message.configurationTypeurl != null && message.hasOwnProperty("configurationTypeurl")) + object.configurationTypeurl = message.configurationTypeurl; + if (message.supportedAnnotationTypes && message.supportedAnnotationTypes.length) { + object.supportedAnnotationTypes = []; + for (var j = 0; j < message.supportedAnnotationTypes.length; ++j) + object.supportedAnnotationTypes[j] = options.enums === String ? $root.google.cloud.visionai.v1alpha1.StreamAnnotationType[message.supportedAnnotationTypes[j]] === undefined ? message.supportedAnnotationTypes[j] : $root.google.cloud.visionai.v1alpha1.StreamAnnotationType[message.supportedAnnotationTypes[j]] : message.supportedAnnotationTypes[j]; + } + if (message.supportsPostProcessing != null && message.hasOwnProperty("supportsPostProcessing")) + object.supportsPostProcessing = message.supportsPostProcessing; + return object; + }; + + /** + * Converts this Processor to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.Processor + * @instance + * @returns {Object.} JSON object + */ + Processor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Processor + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.Processor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Processor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.Processor"; + }; + + /** + * ProcessorType enum. + * @name google.cloud.visionai.v1alpha1.Processor.ProcessorType + * @enum {number} + * @property {number} PROCESSOR_TYPE_UNSPECIFIED=0 PROCESSOR_TYPE_UNSPECIFIED value + * @property {number} PRETRAINED=1 PRETRAINED value + * @property {number} CUSTOM=2 CUSTOM value + * @property {number} CONNECTOR=3 CONNECTOR value + */ + Processor.ProcessorType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PROCESSOR_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PRETRAINED"] = 1; + values[valuesById[2] = "CUSTOM"] = 2; + values[valuesById[3] = "CONNECTOR"] = 3; + return values; + })(); + + /** + * ProcessorState enum. + * @name google.cloud.visionai.v1alpha1.Processor.ProcessorState + * @enum {number} + * @property {number} PROCESSOR_STATE_UNSPECIFIED=0 PROCESSOR_STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} ACTIVE=2 ACTIVE value + * @property {number} DELETING=3 DELETING value + * @property {number} FAILED=4 FAILED value + */ + Processor.ProcessorState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PROCESSOR_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "ACTIVE"] = 2; + values[valuesById[3] = "DELETING"] = 3; + values[valuesById[4] = "FAILED"] = 4; + return values; + })(); + + return Processor; + })(); + + v1alpha1.ProcessorIOSpec = (function() { + + /** + * Properties of a ProcessorIOSpec. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IProcessorIOSpec + * @property {Array.|null} [graphInputChannelSpecs] ProcessorIOSpec graphInputChannelSpecs + * @property {Array.|null} [graphOutputChannelSpecs] ProcessorIOSpec graphOutputChannelSpecs + * @property {Array.|null} [instanceResourceInputBindingSpecs] ProcessorIOSpec instanceResourceInputBindingSpecs + * @property {Array.|null} [instanceResourceOutputBindingSpecs] ProcessorIOSpec instanceResourceOutputBindingSpecs + */ + + /** + * Constructs a new ProcessorIOSpec. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a ProcessorIOSpec. + * @implements IProcessorIOSpec + * @constructor + * @param {google.cloud.visionai.v1alpha1.IProcessorIOSpec=} [properties] Properties to set + */ + function ProcessorIOSpec(properties) { + this.graphInputChannelSpecs = []; + this.graphOutputChannelSpecs = []; + this.instanceResourceInputBindingSpecs = []; + this.instanceResourceOutputBindingSpecs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProcessorIOSpec graphInputChannelSpecs. + * @member {Array.} graphInputChannelSpecs + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec + * @instance + */ + ProcessorIOSpec.prototype.graphInputChannelSpecs = $util.emptyArray; + + /** + * ProcessorIOSpec graphOutputChannelSpecs. + * @member {Array.} graphOutputChannelSpecs + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec + * @instance + */ + ProcessorIOSpec.prototype.graphOutputChannelSpecs = $util.emptyArray; + + /** + * ProcessorIOSpec instanceResourceInputBindingSpecs. + * @member {Array.} instanceResourceInputBindingSpecs + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec + * @instance + */ + ProcessorIOSpec.prototype.instanceResourceInputBindingSpecs = $util.emptyArray; + + /** + * ProcessorIOSpec instanceResourceOutputBindingSpecs. + * @member {Array.} instanceResourceOutputBindingSpecs + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec + * @instance + */ + ProcessorIOSpec.prototype.instanceResourceOutputBindingSpecs = $util.emptyArray; + + /** + * Creates a new ProcessorIOSpec instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec + * @static + * @param {google.cloud.visionai.v1alpha1.IProcessorIOSpec=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ProcessorIOSpec} ProcessorIOSpec instance + */ + ProcessorIOSpec.create = function create(properties) { + return new ProcessorIOSpec(properties); + }; + + /** + * Encodes the specified ProcessorIOSpec message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ProcessorIOSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec + * @static + * @param {google.cloud.visionai.v1alpha1.IProcessorIOSpec} message ProcessorIOSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProcessorIOSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.graphInputChannelSpecs != null && message.graphInputChannelSpecs.length) + for (var i = 0; i < message.graphInputChannelSpecs.length; ++i) + $root.google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphInputChannelSpec.encode(message.graphInputChannelSpecs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.graphOutputChannelSpecs != null && message.graphOutputChannelSpecs.length) + for (var i = 0; i < message.graphOutputChannelSpecs.length; ++i) + $root.google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphOutputChannelSpec.encode(message.graphOutputChannelSpecs[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.instanceResourceInputBindingSpecs != null && message.instanceResourceInputBindingSpecs.length) + for (var i = 0; i < message.instanceResourceInputBindingSpecs.length; ++i) + $root.google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceInputBindingSpec.encode(message.instanceResourceInputBindingSpecs[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.instanceResourceOutputBindingSpecs != null && message.instanceResourceOutputBindingSpecs.length) + for (var i = 0; i < message.instanceResourceOutputBindingSpecs.length; ++i) + $root.google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceOutputBindingSpec.encode(message.instanceResourceOutputBindingSpecs[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ProcessorIOSpec message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ProcessorIOSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec + * @static + * @param {google.cloud.visionai.v1alpha1.IProcessorIOSpec} message ProcessorIOSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProcessorIOSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProcessorIOSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ProcessorIOSpec} ProcessorIOSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProcessorIOSpec.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ProcessorIOSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + if (!(message.graphInputChannelSpecs && message.graphInputChannelSpecs.length)) + message.graphInputChannelSpecs = []; + message.graphInputChannelSpecs.push($root.google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphInputChannelSpec.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 4: { + if (!(message.graphOutputChannelSpecs && message.graphOutputChannelSpecs.length)) + message.graphOutputChannelSpecs = []; + message.graphOutputChannelSpecs.push($root.google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphOutputChannelSpec.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 5: { + if (!(message.instanceResourceInputBindingSpecs && message.instanceResourceInputBindingSpecs.length)) + message.instanceResourceInputBindingSpecs = []; + message.instanceResourceInputBindingSpecs.push($root.google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceInputBindingSpec.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 6: { + if (!(message.instanceResourceOutputBindingSpecs && message.instanceResourceOutputBindingSpecs.length)) + message.instanceResourceOutputBindingSpecs = []; + message.instanceResourceOutputBindingSpecs.push($root.google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceOutputBindingSpec.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ProcessorIOSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ProcessorIOSpec} ProcessorIOSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProcessorIOSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProcessorIOSpec message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProcessorIOSpec.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.graphInputChannelSpecs != null && message.hasOwnProperty("graphInputChannelSpecs")) { + if (!Array.isArray(message.graphInputChannelSpecs)) + return "graphInputChannelSpecs: array expected"; + for (var i = 0; i < message.graphInputChannelSpecs.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphInputChannelSpec.verify(message.graphInputChannelSpecs[i], long + 1); + if (error) + return "graphInputChannelSpecs." + error; + } + } + if (message.graphOutputChannelSpecs != null && message.hasOwnProperty("graphOutputChannelSpecs")) { + if (!Array.isArray(message.graphOutputChannelSpecs)) + return "graphOutputChannelSpecs: array expected"; + for (var i = 0; i < message.graphOutputChannelSpecs.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphOutputChannelSpec.verify(message.graphOutputChannelSpecs[i], long + 1); + if (error) + return "graphOutputChannelSpecs." + error; + } + } + if (message.instanceResourceInputBindingSpecs != null && message.hasOwnProperty("instanceResourceInputBindingSpecs")) { + if (!Array.isArray(message.instanceResourceInputBindingSpecs)) + return "instanceResourceInputBindingSpecs: array expected"; + for (var i = 0; i < message.instanceResourceInputBindingSpecs.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceInputBindingSpec.verify(message.instanceResourceInputBindingSpecs[i], long + 1); + if (error) + return "instanceResourceInputBindingSpecs." + error; + } + } + if (message.instanceResourceOutputBindingSpecs != null && message.hasOwnProperty("instanceResourceOutputBindingSpecs")) { + if (!Array.isArray(message.instanceResourceOutputBindingSpecs)) + return "instanceResourceOutputBindingSpecs: array expected"; + for (var i = 0; i < message.instanceResourceOutputBindingSpecs.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceOutputBindingSpec.verify(message.instanceResourceOutputBindingSpecs[i], long + 1); + if (error) + return "instanceResourceOutputBindingSpecs." + error; + } + } + return null; + }; + + /** + * Creates a ProcessorIOSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ProcessorIOSpec} ProcessorIOSpec + */ + ProcessorIOSpec.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ProcessorIOSpec) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ProcessorIOSpec(); + if (object.graphInputChannelSpecs) { + if (!Array.isArray(object.graphInputChannelSpecs)) + throw TypeError(".google.cloud.visionai.v1alpha1.ProcessorIOSpec.graphInputChannelSpecs: array expected"); + message.graphInputChannelSpecs = []; + for (var i = 0; i < object.graphInputChannelSpecs.length; ++i) { + if (typeof object.graphInputChannelSpecs[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ProcessorIOSpec.graphInputChannelSpecs: object expected"); + message.graphInputChannelSpecs[i] = $root.google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphInputChannelSpec.fromObject(object.graphInputChannelSpecs[i], long + 1); + } + } + if (object.graphOutputChannelSpecs) { + if (!Array.isArray(object.graphOutputChannelSpecs)) + throw TypeError(".google.cloud.visionai.v1alpha1.ProcessorIOSpec.graphOutputChannelSpecs: array expected"); + message.graphOutputChannelSpecs = []; + for (var i = 0; i < object.graphOutputChannelSpecs.length; ++i) { + if (typeof object.graphOutputChannelSpecs[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ProcessorIOSpec.graphOutputChannelSpecs: object expected"); + message.graphOutputChannelSpecs[i] = $root.google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphOutputChannelSpec.fromObject(object.graphOutputChannelSpecs[i], long + 1); + } + } + if (object.instanceResourceInputBindingSpecs) { + if (!Array.isArray(object.instanceResourceInputBindingSpecs)) + throw TypeError(".google.cloud.visionai.v1alpha1.ProcessorIOSpec.instanceResourceInputBindingSpecs: array expected"); + message.instanceResourceInputBindingSpecs = []; + for (var i = 0; i < object.instanceResourceInputBindingSpecs.length; ++i) { + if (typeof object.instanceResourceInputBindingSpecs[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ProcessorIOSpec.instanceResourceInputBindingSpecs: object expected"); + message.instanceResourceInputBindingSpecs[i] = $root.google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceInputBindingSpec.fromObject(object.instanceResourceInputBindingSpecs[i], long + 1); + } + } + if (object.instanceResourceOutputBindingSpecs) { + if (!Array.isArray(object.instanceResourceOutputBindingSpecs)) + throw TypeError(".google.cloud.visionai.v1alpha1.ProcessorIOSpec.instanceResourceOutputBindingSpecs: array expected"); + message.instanceResourceOutputBindingSpecs = []; + for (var i = 0; i < object.instanceResourceOutputBindingSpecs.length; ++i) { + if (typeof object.instanceResourceOutputBindingSpecs[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ProcessorIOSpec.instanceResourceOutputBindingSpecs: object expected"); + message.instanceResourceOutputBindingSpecs[i] = $root.google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceOutputBindingSpec.fromObject(object.instanceResourceOutputBindingSpecs[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a ProcessorIOSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec + * @static + * @param {google.cloud.visionai.v1alpha1.ProcessorIOSpec} message ProcessorIOSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProcessorIOSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.graphInputChannelSpecs = []; + object.graphOutputChannelSpecs = []; + object.instanceResourceInputBindingSpecs = []; + object.instanceResourceOutputBindingSpecs = []; + } + if (message.graphInputChannelSpecs && message.graphInputChannelSpecs.length) { + object.graphInputChannelSpecs = []; + for (var j = 0; j < message.graphInputChannelSpecs.length; ++j) + object.graphInputChannelSpecs[j] = $root.google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphInputChannelSpec.toObject(message.graphInputChannelSpecs[j], options); + } + if (message.graphOutputChannelSpecs && message.graphOutputChannelSpecs.length) { + object.graphOutputChannelSpecs = []; + for (var j = 0; j < message.graphOutputChannelSpecs.length; ++j) + object.graphOutputChannelSpecs[j] = $root.google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphOutputChannelSpec.toObject(message.graphOutputChannelSpecs[j], options); + } + if (message.instanceResourceInputBindingSpecs && message.instanceResourceInputBindingSpecs.length) { + object.instanceResourceInputBindingSpecs = []; + for (var j = 0; j < message.instanceResourceInputBindingSpecs.length; ++j) + object.instanceResourceInputBindingSpecs[j] = $root.google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceInputBindingSpec.toObject(message.instanceResourceInputBindingSpecs[j], options); + } + if (message.instanceResourceOutputBindingSpecs && message.instanceResourceOutputBindingSpecs.length) { + object.instanceResourceOutputBindingSpecs = []; + for (var j = 0; j < message.instanceResourceOutputBindingSpecs.length; ++j) + object.instanceResourceOutputBindingSpecs[j] = $root.google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceOutputBindingSpec.toObject(message.instanceResourceOutputBindingSpecs[j], options); + } + return object; + }; + + /** + * Converts this ProcessorIOSpec to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec + * @instance + * @returns {Object.} JSON object + */ + ProcessorIOSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ProcessorIOSpec + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ProcessorIOSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ProcessorIOSpec"; + }; + + ProcessorIOSpec.GraphInputChannelSpec = (function() { + + /** + * Properties of a GraphInputChannelSpec. + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec + * @interface IGraphInputChannelSpec + * @property {string|null} [name] GraphInputChannelSpec name + * @property {google.cloud.visionai.v1alpha1.ProcessorIOSpec.DataType|null} [dataType] GraphInputChannelSpec dataType + * @property {Array.|null} [acceptedDataTypeUris] GraphInputChannelSpec acceptedDataTypeUris + * @property {boolean|null} [required] GraphInputChannelSpec required + * @property {number|Long|null} [maxConnectionAllowed] GraphInputChannelSpec maxConnectionAllowed + */ + + /** + * Constructs a new GraphInputChannelSpec. + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec + * @classdesc Represents a GraphInputChannelSpec. + * @implements IGraphInputChannelSpec + * @constructor + * @param {google.cloud.visionai.v1alpha1.ProcessorIOSpec.IGraphInputChannelSpec=} [properties] Properties to set + */ + function GraphInputChannelSpec(properties) { + this.acceptedDataTypeUris = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GraphInputChannelSpec name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphInputChannelSpec + * @instance + */ + GraphInputChannelSpec.prototype.name = ""; + + /** + * GraphInputChannelSpec dataType. + * @member {google.cloud.visionai.v1alpha1.ProcessorIOSpec.DataType} dataType + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphInputChannelSpec + * @instance + */ + GraphInputChannelSpec.prototype.dataType = 0; + + /** + * GraphInputChannelSpec acceptedDataTypeUris. + * @member {Array.} acceptedDataTypeUris + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphInputChannelSpec + * @instance + */ + GraphInputChannelSpec.prototype.acceptedDataTypeUris = $util.emptyArray; + + /** + * GraphInputChannelSpec required. + * @member {boolean} required + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphInputChannelSpec + * @instance + */ + GraphInputChannelSpec.prototype.required = false; + + /** + * GraphInputChannelSpec maxConnectionAllowed. + * @member {number|Long} maxConnectionAllowed + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphInputChannelSpec + * @instance + */ + GraphInputChannelSpec.prototype.maxConnectionAllowed = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new GraphInputChannelSpec instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphInputChannelSpec + * @static + * @param {google.cloud.visionai.v1alpha1.ProcessorIOSpec.IGraphInputChannelSpec=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphInputChannelSpec} GraphInputChannelSpec instance + */ + GraphInputChannelSpec.create = function create(properties) { + return new GraphInputChannelSpec(properties); + }; + + /** + * Encodes the specified GraphInputChannelSpec message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphInputChannelSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphInputChannelSpec + * @static + * @param {google.cloud.visionai.v1alpha1.ProcessorIOSpec.IGraphInputChannelSpec} message GraphInputChannelSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GraphInputChannelSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.dataType != null && Object.hasOwnProperty.call(message, "dataType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.dataType); + if (message.required != null && Object.hasOwnProperty.call(message, "required")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.required); + if (message.maxConnectionAllowed != null && Object.hasOwnProperty.call(message, "maxConnectionAllowed")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.maxConnectionAllowed); + if (message.acceptedDataTypeUris != null && message.acceptedDataTypeUris.length) + for (var i = 0; i < message.acceptedDataTypeUris.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.acceptedDataTypeUris[i]); + return writer; + }; + + /** + * Encodes the specified GraphInputChannelSpec message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphInputChannelSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphInputChannelSpec + * @static + * @param {google.cloud.visionai.v1alpha1.ProcessorIOSpec.IGraphInputChannelSpec} message GraphInputChannelSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GraphInputChannelSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GraphInputChannelSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphInputChannelSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphInputChannelSpec} GraphInputChannelSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GraphInputChannelSpec.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphInputChannelSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.dataType = reader.int32(); + break; + } + case 5: { + if (!(message.acceptedDataTypeUris && message.acceptedDataTypeUris.length)) + message.acceptedDataTypeUris = []; + message.acceptedDataTypeUris.push(reader.string()); + break; + } + case 3: { + message.required = reader.bool(); + break; + } + case 4: { + message.maxConnectionAllowed = reader.int64(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GraphInputChannelSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphInputChannelSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphInputChannelSpec} GraphInputChannelSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GraphInputChannelSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GraphInputChannelSpec message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphInputChannelSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GraphInputChannelSpec.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.dataType != null && message.hasOwnProperty("dataType")) + switch (message.dataType) { + default: + return "dataType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.acceptedDataTypeUris != null && message.hasOwnProperty("acceptedDataTypeUris")) { + if (!Array.isArray(message.acceptedDataTypeUris)) + return "acceptedDataTypeUris: array expected"; + for (var i = 0; i < message.acceptedDataTypeUris.length; ++i) + if (!$util.isString(message.acceptedDataTypeUris[i])) + return "acceptedDataTypeUris: string[] expected"; + } + if (message.required != null && message.hasOwnProperty("required")) + if (typeof message.required !== "boolean") + return "required: boolean expected"; + if (message.maxConnectionAllowed != null && message.hasOwnProperty("maxConnectionAllowed")) + if (!$util.isInteger(message.maxConnectionAllowed) && !(message.maxConnectionAllowed && $util.isInteger(message.maxConnectionAllowed.low) && $util.isInteger(message.maxConnectionAllowed.high))) + return "maxConnectionAllowed: integer|Long expected"; + return null; + }; + + /** + * Creates a GraphInputChannelSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphInputChannelSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphInputChannelSpec} GraphInputChannelSpec + */ + GraphInputChannelSpec.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphInputChannelSpec) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphInputChannelSpec(); + if (object.name != null) + message.name = String(object.name); + switch (object.dataType) { + default: + if (typeof object.dataType === "number") { + message.dataType = object.dataType; + break; + } + break; + case "DATA_TYPE_UNSPECIFIED": + case 0: + message.dataType = 0; + break; + case "VIDEO": + case 1: + message.dataType = 1; + break; + case "PROTO": + case 2: + message.dataType = 2; + break; + } + if (object.acceptedDataTypeUris) { + if (!Array.isArray(object.acceptedDataTypeUris)) + throw TypeError(".google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphInputChannelSpec.acceptedDataTypeUris: array expected"); + message.acceptedDataTypeUris = []; + for (var i = 0; i < object.acceptedDataTypeUris.length; ++i) + message.acceptedDataTypeUris[i] = String(object.acceptedDataTypeUris[i]); + } + if (object.required != null) + message.required = Boolean(object.required); + if (object.maxConnectionAllowed != null) + if ($util.Long) + (message.maxConnectionAllowed = $util.Long.fromValue(object.maxConnectionAllowed)).unsigned = false; + else if (typeof object.maxConnectionAllowed === "string") + message.maxConnectionAllowed = parseInt(object.maxConnectionAllowed, 10); + else if (typeof object.maxConnectionAllowed === "number") + message.maxConnectionAllowed = object.maxConnectionAllowed; + else if (typeof object.maxConnectionAllowed === "object") + message.maxConnectionAllowed = new $util.LongBits(object.maxConnectionAllowed.low >>> 0, object.maxConnectionAllowed.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a GraphInputChannelSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphInputChannelSpec + * @static + * @param {google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphInputChannelSpec} message GraphInputChannelSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GraphInputChannelSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.acceptedDataTypeUris = []; + if (options.defaults) { + object.name = ""; + object.dataType = options.enums === String ? "DATA_TYPE_UNSPECIFIED" : 0; + object.required = false; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.maxConnectionAllowed = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.maxConnectionAllowed = options.longs === String ? "0" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.dataType != null && message.hasOwnProperty("dataType")) + object.dataType = options.enums === String ? $root.google.cloud.visionai.v1alpha1.ProcessorIOSpec.DataType[message.dataType] === undefined ? message.dataType : $root.google.cloud.visionai.v1alpha1.ProcessorIOSpec.DataType[message.dataType] : message.dataType; + if (message.required != null && message.hasOwnProperty("required")) + object.required = message.required; + if (message.maxConnectionAllowed != null && message.hasOwnProperty("maxConnectionAllowed")) + if (typeof message.maxConnectionAllowed === "number") + object.maxConnectionAllowed = options.longs === String ? String(message.maxConnectionAllowed) : message.maxConnectionAllowed; + else + object.maxConnectionAllowed = options.longs === String ? $util.Long.prototype.toString.call(message.maxConnectionAllowed) : options.longs === Number ? new $util.LongBits(message.maxConnectionAllowed.low >>> 0, message.maxConnectionAllowed.high >>> 0).toNumber() : message.maxConnectionAllowed; + if (message.acceptedDataTypeUris && message.acceptedDataTypeUris.length) { + object.acceptedDataTypeUris = []; + for (var j = 0; j < message.acceptedDataTypeUris.length; ++j) + object.acceptedDataTypeUris[j] = message.acceptedDataTypeUris[j]; + } + return object; + }; + + /** + * Converts this GraphInputChannelSpec to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphInputChannelSpec + * @instance + * @returns {Object.} JSON object + */ + GraphInputChannelSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GraphInputChannelSpec + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphInputChannelSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GraphInputChannelSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphInputChannelSpec"; + }; + + return GraphInputChannelSpec; + })(); + + ProcessorIOSpec.GraphOutputChannelSpec = (function() { + + /** + * Properties of a GraphOutputChannelSpec. + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec + * @interface IGraphOutputChannelSpec + * @property {string|null} [name] GraphOutputChannelSpec name + * @property {google.cloud.visionai.v1alpha1.ProcessorIOSpec.DataType|null} [dataType] GraphOutputChannelSpec dataType + * @property {string|null} [dataTypeUri] GraphOutputChannelSpec dataTypeUri + */ + + /** + * Constructs a new GraphOutputChannelSpec. + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec + * @classdesc Represents a GraphOutputChannelSpec. + * @implements IGraphOutputChannelSpec + * @constructor + * @param {google.cloud.visionai.v1alpha1.ProcessorIOSpec.IGraphOutputChannelSpec=} [properties] Properties to set + */ + function GraphOutputChannelSpec(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GraphOutputChannelSpec name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphOutputChannelSpec + * @instance + */ + GraphOutputChannelSpec.prototype.name = ""; + + /** + * GraphOutputChannelSpec dataType. + * @member {google.cloud.visionai.v1alpha1.ProcessorIOSpec.DataType} dataType + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphOutputChannelSpec + * @instance + */ + GraphOutputChannelSpec.prototype.dataType = 0; + + /** + * GraphOutputChannelSpec dataTypeUri. + * @member {string} dataTypeUri + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphOutputChannelSpec + * @instance + */ + GraphOutputChannelSpec.prototype.dataTypeUri = ""; + + /** + * Creates a new GraphOutputChannelSpec instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphOutputChannelSpec + * @static + * @param {google.cloud.visionai.v1alpha1.ProcessorIOSpec.IGraphOutputChannelSpec=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphOutputChannelSpec} GraphOutputChannelSpec instance + */ + GraphOutputChannelSpec.create = function create(properties) { + return new GraphOutputChannelSpec(properties); + }; + + /** + * Encodes the specified GraphOutputChannelSpec message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphOutputChannelSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphOutputChannelSpec + * @static + * @param {google.cloud.visionai.v1alpha1.ProcessorIOSpec.IGraphOutputChannelSpec} message GraphOutputChannelSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GraphOutputChannelSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.dataType != null && Object.hasOwnProperty.call(message, "dataType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.dataType); + if (message.dataTypeUri != null && Object.hasOwnProperty.call(message, "dataTypeUri")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dataTypeUri); + return writer; + }; + + /** + * Encodes the specified GraphOutputChannelSpec message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphOutputChannelSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphOutputChannelSpec + * @static + * @param {google.cloud.visionai.v1alpha1.ProcessorIOSpec.IGraphOutputChannelSpec} message GraphOutputChannelSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GraphOutputChannelSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GraphOutputChannelSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphOutputChannelSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphOutputChannelSpec} GraphOutputChannelSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GraphOutputChannelSpec.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphOutputChannelSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.dataType = reader.int32(); + break; + } + case 3: { + message.dataTypeUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GraphOutputChannelSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphOutputChannelSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphOutputChannelSpec} GraphOutputChannelSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GraphOutputChannelSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GraphOutputChannelSpec message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphOutputChannelSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GraphOutputChannelSpec.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.dataType != null && message.hasOwnProperty("dataType")) + switch (message.dataType) { + default: + return "dataType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.dataTypeUri != null && message.hasOwnProperty("dataTypeUri")) + if (!$util.isString(message.dataTypeUri)) + return "dataTypeUri: string expected"; + return null; + }; + + /** + * Creates a GraphOutputChannelSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphOutputChannelSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphOutputChannelSpec} GraphOutputChannelSpec + */ + GraphOutputChannelSpec.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphOutputChannelSpec) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphOutputChannelSpec(); + if (object.name != null) + message.name = String(object.name); + switch (object.dataType) { + default: + if (typeof object.dataType === "number") { + message.dataType = object.dataType; + break; + } + break; + case "DATA_TYPE_UNSPECIFIED": + case 0: + message.dataType = 0; + break; + case "VIDEO": + case 1: + message.dataType = 1; + break; + case "PROTO": + case 2: + message.dataType = 2; + break; + } + if (object.dataTypeUri != null) + message.dataTypeUri = String(object.dataTypeUri); + return message; + }; + + /** + * Creates a plain object from a GraphOutputChannelSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphOutputChannelSpec + * @static + * @param {google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphOutputChannelSpec} message GraphOutputChannelSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GraphOutputChannelSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.dataType = options.enums === String ? "DATA_TYPE_UNSPECIFIED" : 0; + object.dataTypeUri = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.dataType != null && message.hasOwnProperty("dataType")) + object.dataType = options.enums === String ? $root.google.cloud.visionai.v1alpha1.ProcessorIOSpec.DataType[message.dataType] === undefined ? message.dataType : $root.google.cloud.visionai.v1alpha1.ProcessorIOSpec.DataType[message.dataType] : message.dataType; + if (message.dataTypeUri != null && message.hasOwnProperty("dataTypeUri")) + object.dataTypeUri = message.dataTypeUri; + return object; + }; + + /** + * Converts this GraphOutputChannelSpec to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphOutputChannelSpec + * @instance + * @returns {Object.} JSON object + */ + GraphOutputChannelSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GraphOutputChannelSpec + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphOutputChannelSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GraphOutputChannelSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ProcessorIOSpec.GraphOutputChannelSpec"; + }; + + return GraphOutputChannelSpec; + })(); + + ProcessorIOSpec.InstanceResourceInputBindingSpec = (function() { + + /** + * Properties of an InstanceResourceInputBindingSpec. + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec + * @interface IInstanceResourceInputBindingSpec + * @property {string|null} [configTypeUri] InstanceResourceInputBindingSpec configTypeUri + * @property {string|null} [resourceTypeUri] InstanceResourceInputBindingSpec resourceTypeUri + * @property {string|null} [name] InstanceResourceInputBindingSpec name + */ + + /** + * Constructs a new InstanceResourceInputBindingSpec. + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec + * @classdesc Represents an InstanceResourceInputBindingSpec. + * @implements IInstanceResourceInputBindingSpec + * @constructor + * @param {google.cloud.visionai.v1alpha1.ProcessorIOSpec.IInstanceResourceInputBindingSpec=} [properties] Properties to set + */ + function InstanceResourceInputBindingSpec(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceResourceInputBindingSpec configTypeUri. + * @member {string|null|undefined} configTypeUri + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceInputBindingSpec + * @instance + */ + InstanceResourceInputBindingSpec.prototype.configTypeUri = null; + + /** + * InstanceResourceInputBindingSpec resourceTypeUri. + * @member {string|null|undefined} resourceTypeUri + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceInputBindingSpec + * @instance + */ + InstanceResourceInputBindingSpec.prototype.resourceTypeUri = null; + + /** + * InstanceResourceInputBindingSpec name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceInputBindingSpec + * @instance + */ + InstanceResourceInputBindingSpec.prototype.name = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InstanceResourceInputBindingSpec resourceType. + * @member {"configTypeUri"|"resourceTypeUri"|undefined} resourceType + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceInputBindingSpec + * @instance + */ + Object.defineProperty(InstanceResourceInputBindingSpec.prototype, "resourceType", { + get: $util.oneOfGetter($oneOfFields = ["configTypeUri", "resourceTypeUri"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InstanceResourceInputBindingSpec instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceInputBindingSpec + * @static + * @param {google.cloud.visionai.v1alpha1.ProcessorIOSpec.IInstanceResourceInputBindingSpec=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceInputBindingSpec} InstanceResourceInputBindingSpec instance + */ + InstanceResourceInputBindingSpec.create = function create(properties) { + return new InstanceResourceInputBindingSpec(properties); + }; + + /** + * Encodes the specified InstanceResourceInputBindingSpec message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceInputBindingSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceInputBindingSpec + * @static + * @param {google.cloud.visionai.v1alpha1.ProcessorIOSpec.IInstanceResourceInputBindingSpec} message InstanceResourceInputBindingSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceResourceInputBindingSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.configTypeUri != null && Object.hasOwnProperty.call(message, "configTypeUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.configTypeUri); + if (message.resourceTypeUri != null && Object.hasOwnProperty.call(message, "resourceTypeUri")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.resourceTypeUri); + return writer; + }; + + /** + * Encodes the specified InstanceResourceInputBindingSpec message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceInputBindingSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceInputBindingSpec + * @static + * @param {google.cloud.visionai.v1alpha1.ProcessorIOSpec.IInstanceResourceInputBindingSpec} message InstanceResourceInputBindingSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceResourceInputBindingSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceResourceInputBindingSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceInputBindingSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceInputBindingSpec} InstanceResourceInputBindingSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceResourceInputBindingSpec.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceInputBindingSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.configTypeUri = reader.string(); + break; + } + case 3: { + message.resourceTypeUri = reader.string(); + break; + } + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceResourceInputBindingSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceInputBindingSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceInputBindingSpec} InstanceResourceInputBindingSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceResourceInputBindingSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceResourceInputBindingSpec message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceInputBindingSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceResourceInputBindingSpec.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.configTypeUri != null && message.hasOwnProperty("configTypeUri")) { + properties.resourceType = 1; + if (!$util.isString(message.configTypeUri)) + return "configTypeUri: string expected"; + } + if (message.resourceTypeUri != null && message.hasOwnProperty("resourceTypeUri")) { + if (properties.resourceType === 1) + return "resourceType: multiple values"; + properties.resourceType = 1; + if (!$util.isString(message.resourceTypeUri)) + return "resourceTypeUri: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates an InstanceResourceInputBindingSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceInputBindingSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceInputBindingSpec} InstanceResourceInputBindingSpec + */ + InstanceResourceInputBindingSpec.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceInputBindingSpec) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceInputBindingSpec(); + if (object.configTypeUri != null) + message.configTypeUri = String(object.configTypeUri); + if (object.resourceTypeUri != null) + message.resourceTypeUri = String(object.resourceTypeUri); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from an InstanceResourceInputBindingSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceInputBindingSpec + * @static + * @param {google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceInputBindingSpec} message InstanceResourceInputBindingSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceResourceInputBindingSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.configTypeUri != null && message.hasOwnProperty("configTypeUri")) { + object.configTypeUri = message.configTypeUri; + if (options.oneofs) + object.resourceType = "configTypeUri"; + } + if (message.resourceTypeUri != null && message.hasOwnProperty("resourceTypeUri")) { + object.resourceTypeUri = message.resourceTypeUri; + if (options.oneofs) + object.resourceType = "resourceTypeUri"; + } + return object; + }; + + /** + * Converts this InstanceResourceInputBindingSpec to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceInputBindingSpec + * @instance + * @returns {Object.} JSON object + */ + InstanceResourceInputBindingSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InstanceResourceInputBindingSpec + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceInputBindingSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InstanceResourceInputBindingSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceInputBindingSpec"; + }; + + return InstanceResourceInputBindingSpec; + })(); + + ProcessorIOSpec.InstanceResourceOutputBindingSpec = (function() { + + /** + * Properties of an InstanceResourceOutputBindingSpec. + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec + * @interface IInstanceResourceOutputBindingSpec + * @property {string|null} [name] InstanceResourceOutputBindingSpec name + * @property {string|null} [resourceTypeUri] InstanceResourceOutputBindingSpec resourceTypeUri + * @property {boolean|null} [explicit] InstanceResourceOutputBindingSpec explicit + */ + + /** + * Constructs a new InstanceResourceOutputBindingSpec. + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec + * @classdesc Represents an InstanceResourceOutputBindingSpec. + * @implements IInstanceResourceOutputBindingSpec + * @constructor + * @param {google.cloud.visionai.v1alpha1.ProcessorIOSpec.IInstanceResourceOutputBindingSpec=} [properties] Properties to set + */ + function InstanceResourceOutputBindingSpec(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceResourceOutputBindingSpec name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceOutputBindingSpec + * @instance + */ + InstanceResourceOutputBindingSpec.prototype.name = ""; + + /** + * InstanceResourceOutputBindingSpec resourceTypeUri. + * @member {string} resourceTypeUri + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceOutputBindingSpec + * @instance + */ + InstanceResourceOutputBindingSpec.prototype.resourceTypeUri = ""; + + /** + * InstanceResourceOutputBindingSpec explicit. + * @member {boolean} explicit + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceOutputBindingSpec + * @instance + */ + InstanceResourceOutputBindingSpec.prototype.explicit = false; + + /** + * Creates a new InstanceResourceOutputBindingSpec instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceOutputBindingSpec + * @static + * @param {google.cloud.visionai.v1alpha1.ProcessorIOSpec.IInstanceResourceOutputBindingSpec=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceOutputBindingSpec} InstanceResourceOutputBindingSpec instance + */ + InstanceResourceOutputBindingSpec.create = function create(properties) { + return new InstanceResourceOutputBindingSpec(properties); + }; + + /** + * Encodes the specified InstanceResourceOutputBindingSpec message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceOutputBindingSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceOutputBindingSpec + * @static + * @param {google.cloud.visionai.v1alpha1.ProcessorIOSpec.IInstanceResourceOutputBindingSpec} message InstanceResourceOutputBindingSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceResourceOutputBindingSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.resourceTypeUri != null && Object.hasOwnProperty.call(message, "resourceTypeUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceTypeUri); + if (message.explicit != null && Object.hasOwnProperty.call(message, "explicit")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.explicit); + return writer; + }; + + /** + * Encodes the specified InstanceResourceOutputBindingSpec message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceOutputBindingSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceOutputBindingSpec + * @static + * @param {google.cloud.visionai.v1alpha1.ProcessorIOSpec.IInstanceResourceOutputBindingSpec} message InstanceResourceOutputBindingSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceResourceOutputBindingSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceResourceOutputBindingSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceOutputBindingSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceOutputBindingSpec} InstanceResourceOutputBindingSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceResourceOutputBindingSpec.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceOutputBindingSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.resourceTypeUri = reader.string(); + break; + } + case 3: { + message.explicit = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceResourceOutputBindingSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceOutputBindingSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceOutputBindingSpec} InstanceResourceOutputBindingSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceResourceOutputBindingSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceResourceOutputBindingSpec message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceOutputBindingSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceResourceOutputBindingSpec.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.resourceTypeUri != null && message.hasOwnProperty("resourceTypeUri")) + if (!$util.isString(message.resourceTypeUri)) + return "resourceTypeUri: string expected"; + if (message.explicit != null && message.hasOwnProperty("explicit")) + if (typeof message.explicit !== "boolean") + return "explicit: boolean expected"; + return null; + }; + + /** + * Creates an InstanceResourceOutputBindingSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceOutputBindingSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceOutputBindingSpec} InstanceResourceOutputBindingSpec + */ + InstanceResourceOutputBindingSpec.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceOutputBindingSpec) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceOutputBindingSpec(); + if (object.name != null) + message.name = String(object.name); + if (object.resourceTypeUri != null) + message.resourceTypeUri = String(object.resourceTypeUri); + if (object.explicit != null) + message.explicit = Boolean(object.explicit); + return message; + }; + + /** + * Creates a plain object from an InstanceResourceOutputBindingSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceOutputBindingSpec + * @static + * @param {google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceOutputBindingSpec} message InstanceResourceOutputBindingSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceResourceOutputBindingSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.resourceTypeUri = ""; + object.explicit = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.resourceTypeUri != null && message.hasOwnProperty("resourceTypeUri")) + object.resourceTypeUri = message.resourceTypeUri; + if (message.explicit != null && message.hasOwnProperty("explicit")) + object.explicit = message.explicit; + return object; + }; + + /** + * Converts this InstanceResourceOutputBindingSpec to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceOutputBindingSpec + * @instance + * @returns {Object.} JSON object + */ + InstanceResourceOutputBindingSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InstanceResourceOutputBindingSpec + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceOutputBindingSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InstanceResourceOutputBindingSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ProcessorIOSpec.InstanceResourceOutputBindingSpec"; + }; + + return InstanceResourceOutputBindingSpec; + })(); + + /** + * DataType enum. + * @name google.cloud.visionai.v1alpha1.ProcessorIOSpec.DataType + * @enum {number} + * @property {number} DATA_TYPE_UNSPECIFIED=0 DATA_TYPE_UNSPECIFIED value + * @property {number} VIDEO=1 VIDEO value + * @property {number} PROTO=2 PROTO value + */ + ProcessorIOSpec.DataType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATA_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "VIDEO"] = 1; + values[valuesById[2] = "PROTO"] = 2; + return values; + })(); + + return ProcessorIOSpec; + })(); + + v1alpha1.CustomProcessorSourceInfo = (function() { + + /** + * Properties of a CustomProcessorSourceInfo. + * @memberof google.cloud.visionai.v1alpha1 + * @interface ICustomProcessorSourceInfo + * @property {string|null} [vertexModel] CustomProcessorSourceInfo vertexModel + * @property {google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.SourceType|null} [sourceType] CustomProcessorSourceInfo sourceType + * @property {Object.|null} [additionalInfo] CustomProcessorSourceInfo additionalInfo + * @property {google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.IModelSchema|null} [modelSchema] CustomProcessorSourceInfo modelSchema + */ + + /** + * Constructs a new CustomProcessorSourceInfo. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a CustomProcessorSourceInfo. + * @implements ICustomProcessorSourceInfo + * @constructor + * @param {google.cloud.visionai.v1alpha1.ICustomProcessorSourceInfo=} [properties] Properties to set + */ + function CustomProcessorSourceInfo(properties) { + this.additionalInfo = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomProcessorSourceInfo vertexModel. + * @member {string|null|undefined} vertexModel + * @memberof google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo + * @instance + */ + CustomProcessorSourceInfo.prototype.vertexModel = null; + + /** + * CustomProcessorSourceInfo sourceType. + * @member {google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.SourceType} sourceType + * @memberof google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo + * @instance + */ + CustomProcessorSourceInfo.prototype.sourceType = 0; + + /** + * CustomProcessorSourceInfo additionalInfo. + * @member {Object.} additionalInfo + * @memberof google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo + * @instance + */ + CustomProcessorSourceInfo.prototype.additionalInfo = $util.emptyObject; + + /** + * CustomProcessorSourceInfo modelSchema. + * @member {google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.IModelSchema|null|undefined} modelSchema + * @memberof google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo + * @instance + */ + CustomProcessorSourceInfo.prototype.modelSchema = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CustomProcessorSourceInfo artifactPath. + * @member {"vertexModel"|undefined} artifactPath + * @memberof google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo + * @instance + */ + Object.defineProperty(CustomProcessorSourceInfo.prototype, "artifactPath", { + get: $util.oneOfGetter($oneOfFields = ["vertexModel"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomProcessorSourceInfo instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo + * @static + * @param {google.cloud.visionai.v1alpha1.ICustomProcessorSourceInfo=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo} CustomProcessorSourceInfo instance + */ + CustomProcessorSourceInfo.create = function create(properties) { + return new CustomProcessorSourceInfo(properties); + }; + + /** + * Encodes the specified CustomProcessorSourceInfo message. Does not implicitly {@link google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo + * @static + * @param {google.cloud.visionai.v1alpha1.ICustomProcessorSourceInfo} message CustomProcessorSourceInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomProcessorSourceInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sourceType != null && Object.hasOwnProperty.call(message, "sourceType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.sourceType); + if (message.vertexModel != null && Object.hasOwnProperty.call(message, "vertexModel")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.vertexModel); + if (message.additionalInfo != null && Object.hasOwnProperty.call(message, "additionalInfo")) + for (var keys = Object.keys(message.additionalInfo), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.additionalInfo[keys[i]]).ldelim(); + if (message.modelSchema != null && Object.hasOwnProperty.call(message, "modelSchema")) + $root.google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.ModelSchema.encode(message.modelSchema, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CustomProcessorSourceInfo message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo + * @static + * @param {google.cloud.visionai.v1alpha1.ICustomProcessorSourceInfo} message CustomProcessorSourceInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomProcessorSourceInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomProcessorSourceInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo} CustomProcessorSourceInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomProcessorSourceInfo.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.vertexModel = reader.string(); + break; + } + case 1: { + message.sourceType = reader.int32(); + break; + } + case 4: { + if (message.additionalInfo === $util.emptyObject) + message.additionalInfo = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.additionalInfo, key); + message.additionalInfo[key] = value; + break; + } + case 5: { + message.modelSchema = $root.google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.ModelSchema.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CustomProcessorSourceInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo} CustomProcessorSourceInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomProcessorSourceInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomProcessorSourceInfo message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomProcessorSourceInfo.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.vertexModel != null && message.hasOwnProperty("vertexModel")) { + properties.artifactPath = 1; + if (!$util.isString(message.vertexModel)) + return "vertexModel: string expected"; + } + if (message.sourceType != null && message.hasOwnProperty("sourceType")) + switch (message.sourceType) { + default: + return "sourceType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.additionalInfo != null && message.hasOwnProperty("additionalInfo")) { + if (!$util.isObject(message.additionalInfo)) + return "additionalInfo: object expected"; + var key = Object.keys(message.additionalInfo); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.additionalInfo[key[i]])) + return "additionalInfo: string{k:string} expected"; + } + if (message.modelSchema != null && message.hasOwnProperty("modelSchema")) { + var error = $root.google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.ModelSchema.verify(message.modelSchema, long + 1); + if (error) + return "modelSchema." + error; + } + return null; + }; + + /** + * Creates a CustomProcessorSourceInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo} CustomProcessorSourceInfo + */ + CustomProcessorSourceInfo.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo(); + if (object.vertexModel != null) + message.vertexModel = String(object.vertexModel); + switch (object.sourceType) { + default: + if (typeof object.sourceType === "number") { + message.sourceType = object.sourceType; + break; + } + break; + case "SOURCE_TYPE_UNSPECIFIED": + case 0: + message.sourceType = 0; + break; + case "VERTEX_AUTOML": + case 1: + message.sourceType = 1; + break; + case "VERTEX_CUSTOM": + case 2: + message.sourceType = 2; + break; + } + if (object.additionalInfo) { + if (typeof object.additionalInfo !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.additionalInfo: object expected"); + message.additionalInfo = {}; + for (var keys = Object.keys(object.additionalInfo), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.additionalInfo, keys[i]); + message.additionalInfo[keys[i]] = String(object.additionalInfo[keys[i]]); + } + } + if (object.modelSchema != null) { + if (typeof object.modelSchema !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.modelSchema: object expected"); + message.modelSchema = $root.google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.ModelSchema.fromObject(object.modelSchema, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a CustomProcessorSourceInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo + * @static + * @param {google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo} message CustomProcessorSourceInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomProcessorSourceInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.additionalInfo = {}; + if (options.defaults) { + object.sourceType = options.enums === String ? "SOURCE_TYPE_UNSPECIFIED" : 0; + object.modelSchema = null; + } + if (message.sourceType != null && message.hasOwnProperty("sourceType")) + object.sourceType = options.enums === String ? $root.google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.SourceType[message.sourceType] === undefined ? message.sourceType : $root.google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.SourceType[message.sourceType] : message.sourceType; + if (message.vertexModel != null && message.hasOwnProperty("vertexModel")) { + object.vertexModel = message.vertexModel; + if (options.oneofs) + object.artifactPath = "vertexModel"; + } + var keys2; + if (message.additionalInfo && (keys2 = Object.keys(message.additionalInfo)).length) { + object.additionalInfo = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.additionalInfo, keys2[j]); + object.additionalInfo[keys2[j]] = message.additionalInfo[keys2[j]]; + } + } + if (message.modelSchema != null && message.hasOwnProperty("modelSchema")) + object.modelSchema = $root.google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.ModelSchema.toObject(message.modelSchema, options); + return object; + }; + + /** + * Converts this CustomProcessorSourceInfo to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo + * @instance + * @returns {Object.} JSON object + */ + CustomProcessorSourceInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomProcessorSourceInfo + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomProcessorSourceInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo"; + }; + + CustomProcessorSourceInfo.ModelSchema = (function() { + + /** + * Properties of a ModelSchema. + * @memberof google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo + * @interface IModelSchema + * @property {google.cloud.visionai.v1alpha1.IGcsSource|null} [instancesSchema] ModelSchema instancesSchema + * @property {google.cloud.visionai.v1alpha1.IGcsSource|null} [parametersSchema] ModelSchema parametersSchema + * @property {google.cloud.visionai.v1alpha1.IGcsSource|null} [predictionsSchema] ModelSchema predictionsSchema + */ + + /** + * Constructs a new ModelSchema. + * @memberof google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo + * @classdesc Represents a ModelSchema. + * @implements IModelSchema + * @constructor + * @param {google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.IModelSchema=} [properties] Properties to set + */ + function ModelSchema(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ModelSchema instancesSchema. + * @member {google.cloud.visionai.v1alpha1.IGcsSource|null|undefined} instancesSchema + * @memberof google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.ModelSchema + * @instance + */ + ModelSchema.prototype.instancesSchema = null; + + /** + * ModelSchema parametersSchema. + * @member {google.cloud.visionai.v1alpha1.IGcsSource|null|undefined} parametersSchema + * @memberof google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.ModelSchema + * @instance + */ + ModelSchema.prototype.parametersSchema = null; + + /** + * ModelSchema predictionsSchema. + * @member {google.cloud.visionai.v1alpha1.IGcsSource|null|undefined} predictionsSchema + * @memberof google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.ModelSchema + * @instance + */ + ModelSchema.prototype.predictionsSchema = null; + + /** + * Creates a new ModelSchema instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.ModelSchema + * @static + * @param {google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.IModelSchema=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.ModelSchema} ModelSchema instance + */ + ModelSchema.create = function create(properties) { + return new ModelSchema(properties); + }; + + /** + * Encodes the specified ModelSchema message. Does not implicitly {@link google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.ModelSchema.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.ModelSchema + * @static + * @param {google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.IModelSchema} message ModelSchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelSchema.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instancesSchema != null && Object.hasOwnProperty.call(message, "instancesSchema")) + $root.google.cloud.visionai.v1alpha1.GcsSource.encode(message.instancesSchema, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.parametersSchema != null && Object.hasOwnProperty.call(message, "parametersSchema")) + $root.google.cloud.visionai.v1alpha1.GcsSource.encode(message.parametersSchema, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.predictionsSchema != null && Object.hasOwnProperty.call(message, "predictionsSchema")) + $root.google.cloud.visionai.v1alpha1.GcsSource.encode(message.predictionsSchema, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ModelSchema message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.ModelSchema.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.ModelSchema + * @static + * @param {google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.IModelSchema} message ModelSchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelSchema.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ModelSchema message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.ModelSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.ModelSchema} ModelSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelSchema.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.ModelSchema(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.instancesSchema = $root.google.cloud.visionai.v1alpha1.GcsSource.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.parametersSchema = $root.google.cloud.visionai.v1alpha1.GcsSource.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.predictionsSchema = $root.google.cloud.visionai.v1alpha1.GcsSource.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ModelSchema message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.ModelSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.ModelSchema} ModelSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelSchema.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ModelSchema message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.ModelSchema + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ModelSchema.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.instancesSchema != null && message.hasOwnProperty("instancesSchema")) { + var error = $root.google.cloud.visionai.v1alpha1.GcsSource.verify(message.instancesSchema, long + 1); + if (error) + return "instancesSchema." + error; + } + if (message.parametersSchema != null && message.hasOwnProperty("parametersSchema")) { + var error = $root.google.cloud.visionai.v1alpha1.GcsSource.verify(message.parametersSchema, long + 1); + if (error) + return "parametersSchema." + error; + } + if (message.predictionsSchema != null && message.hasOwnProperty("predictionsSchema")) { + var error = $root.google.cloud.visionai.v1alpha1.GcsSource.verify(message.predictionsSchema, long + 1); + if (error) + return "predictionsSchema." + error; + } + return null; + }; + + /** + * Creates a ModelSchema message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.ModelSchema + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.ModelSchema} ModelSchema + */ + ModelSchema.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.ModelSchema) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.ModelSchema(); + if (object.instancesSchema != null) { + if (typeof object.instancesSchema !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.ModelSchema.instancesSchema: object expected"); + message.instancesSchema = $root.google.cloud.visionai.v1alpha1.GcsSource.fromObject(object.instancesSchema, long + 1); + } + if (object.parametersSchema != null) { + if (typeof object.parametersSchema !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.ModelSchema.parametersSchema: object expected"); + message.parametersSchema = $root.google.cloud.visionai.v1alpha1.GcsSource.fromObject(object.parametersSchema, long + 1); + } + if (object.predictionsSchema != null) { + if (typeof object.predictionsSchema !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.ModelSchema.predictionsSchema: object expected"); + message.predictionsSchema = $root.google.cloud.visionai.v1alpha1.GcsSource.fromObject(object.predictionsSchema, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a ModelSchema message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.ModelSchema + * @static + * @param {google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.ModelSchema} message ModelSchema + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ModelSchema.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.instancesSchema = null; + object.parametersSchema = null; + object.predictionsSchema = null; + } + if (message.instancesSchema != null && message.hasOwnProperty("instancesSchema")) + object.instancesSchema = $root.google.cloud.visionai.v1alpha1.GcsSource.toObject(message.instancesSchema, options); + if (message.parametersSchema != null && message.hasOwnProperty("parametersSchema")) + object.parametersSchema = $root.google.cloud.visionai.v1alpha1.GcsSource.toObject(message.parametersSchema, options); + if (message.predictionsSchema != null && message.hasOwnProperty("predictionsSchema")) + object.predictionsSchema = $root.google.cloud.visionai.v1alpha1.GcsSource.toObject(message.predictionsSchema, options); + return object; + }; + + /** + * Converts this ModelSchema to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.ModelSchema + * @instance + * @returns {Object.} JSON object + */ + ModelSchema.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ModelSchema + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.ModelSchema + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ModelSchema.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.ModelSchema"; + }; + + return ModelSchema; + })(); + + /** + * SourceType enum. + * @name google.cloud.visionai.v1alpha1.CustomProcessorSourceInfo.SourceType + * @enum {number} + * @property {number} SOURCE_TYPE_UNSPECIFIED=0 SOURCE_TYPE_UNSPECIFIED value + * @property {number} VERTEX_AUTOML=1 VERTEX_AUTOML value + * @property {number} VERTEX_CUSTOM=2 VERTEX_CUSTOM value + */ + CustomProcessorSourceInfo.SourceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SOURCE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "VERTEX_AUTOML"] = 1; + values[valuesById[2] = "VERTEX_CUSTOM"] = 2; + return values; + })(); + + return CustomProcessorSourceInfo; + })(); + + v1alpha1.ProcessorConfig = (function() { + + /** + * Properties of a ProcessorConfig. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IProcessorConfig + * @property {google.cloud.visionai.v1alpha1.IVideoStreamInputConfig|null} [videoStreamInputConfig] ProcessorConfig videoStreamInputConfig + * @property {google.cloud.visionai.v1alpha1.IAIEnabledDevicesInputConfig|null} [aiEnabledDevicesInputConfig] ProcessorConfig aiEnabledDevicesInputConfig + * @property {google.cloud.visionai.v1alpha1.IMediaWarehouseConfig|null} [mediaWarehouseConfig] ProcessorConfig mediaWarehouseConfig + * @property {google.cloud.visionai.v1alpha1.IPersonBlurConfig|null} [personBlurConfig] ProcessorConfig personBlurConfig + * @property {google.cloud.visionai.v1alpha1.IOccupancyCountConfig|null} [occupancyCountConfig] ProcessorConfig occupancyCountConfig + * @property {google.cloud.visionai.v1alpha1.IPersonVehicleDetectionConfig|null} [personVehicleDetectionConfig] ProcessorConfig personVehicleDetectionConfig + * @property {google.cloud.visionai.v1alpha1.IVertexAutoMLVisionConfig|null} [vertexAutomlVisionConfig] ProcessorConfig vertexAutomlVisionConfig + * @property {google.cloud.visionai.v1alpha1.IVertexAutoMLVideoConfig|null} [vertexAutomlVideoConfig] ProcessorConfig vertexAutomlVideoConfig + * @property {google.cloud.visionai.v1alpha1.IVertexCustomConfig|null} [vertexCustomConfig] ProcessorConfig vertexCustomConfig + * @property {google.cloud.visionai.v1alpha1.IGeneralObjectDetectionConfig|null} [generalObjectDetectionConfig] ProcessorConfig generalObjectDetectionConfig + * @property {google.cloud.visionai.v1alpha1.IBigQueryConfig|null} [bigQueryConfig] ProcessorConfig bigQueryConfig + * @property {google.cloud.visionai.v1alpha1.IPersonalProtectiveEquipmentDetectionConfig|null} [personalProtectiveEquipmentDetectionConfig] ProcessorConfig personalProtectiveEquipmentDetectionConfig + */ + + /** + * Constructs a new ProcessorConfig. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a ProcessorConfig. + * @implements IProcessorConfig + * @constructor + * @param {google.cloud.visionai.v1alpha1.IProcessorConfig=} [properties] Properties to set + */ + function ProcessorConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProcessorConfig videoStreamInputConfig. + * @member {google.cloud.visionai.v1alpha1.IVideoStreamInputConfig|null|undefined} videoStreamInputConfig + * @memberof google.cloud.visionai.v1alpha1.ProcessorConfig + * @instance + */ + ProcessorConfig.prototype.videoStreamInputConfig = null; + + /** + * ProcessorConfig aiEnabledDevicesInputConfig. + * @member {google.cloud.visionai.v1alpha1.IAIEnabledDevicesInputConfig|null|undefined} aiEnabledDevicesInputConfig + * @memberof google.cloud.visionai.v1alpha1.ProcessorConfig + * @instance + */ + ProcessorConfig.prototype.aiEnabledDevicesInputConfig = null; + + /** + * ProcessorConfig mediaWarehouseConfig. + * @member {google.cloud.visionai.v1alpha1.IMediaWarehouseConfig|null|undefined} mediaWarehouseConfig + * @memberof google.cloud.visionai.v1alpha1.ProcessorConfig + * @instance + */ + ProcessorConfig.prototype.mediaWarehouseConfig = null; + + /** + * ProcessorConfig personBlurConfig. + * @member {google.cloud.visionai.v1alpha1.IPersonBlurConfig|null|undefined} personBlurConfig + * @memberof google.cloud.visionai.v1alpha1.ProcessorConfig + * @instance + */ + ProcessorConfig.prototype.personBlurConfig = null; + + /** + * ProcessorConfig occupancyCountConfig. + * @member {google.cloud.visionai.v1alpha1.IOccupancyCountConfig|null|undefined} occupancyCountConfig + * @memberof google.cloud.visionai.v1alpha1.ProcessorConfig + * @instance + */ + ProcessorConfig.prototype.occupancyCountConfig = null; + + /** + * ProcessorConfig personVehicleDetectionConfig. + * @member {google.cloud.visionai.v1alpha1.IPersonVehicleDetectionConfig|null|undefined} personVehicleDetectionConfig + * @memberof google.cloud.visionai.v1alpha1.ProcessorConfig + * @instance + */ + ProcessorConfig.prototype.personVehicleDetectionConfig = null; + + /** + * ProcessorConfig vertexAutomlVisionConfig. + * @member {google.cloud.visionai.v1alpha1.IVertexAutoMLVisionConfig|null|undefined} vertexAutomlVisionConfig + * @memberof google.cloud.visionai.v1alpha1.ProcessorConfig + * @instance + */ + ProcessorConfig.prototype.vertexAutomlVisionConfig = null; + + /** + * ProcessorConfig vertexAutomlVideoConfig. + * @member {google.cloud.visionai.v1alpha1.IVertexAutoMLVideoConfig|null|undefined} vertexAutomlVideoConfig + * @memberof google.cloud.visionai.v1alpha1.ProcessorConfig + * @instance + */ + ProcessorConfig.prototype.vertexAutomlVideoConfig = null; + + /** + * ProcessorConfig vertexCustomConfig. + * @member {google.cloud.visionai.v1alpha1.IVertexCustomConfig|null|undefined} vertexCustomConfig + * @memberof google.cloud.visionai.v1alpha1.ProcessorConfig + * @instance + */ + ProcessorConfig.prototype.vertexCustomConfig = null; + + /** + * ProcessorConfig generalObjectDetectionConfig. + * @member {google.cloud.visionai.v1alpha1.IGeneralObjectDetectionConfig|null|undefined} generalObjectDetectionConfig + * @memberof google.cloud.visionai.v1alpha1.ProcessorConfig + * @instance + */ + ProcessorConfig.prototype.generalObjectDetectionConfig = null; + + /** + * ProcessorConfig bigQueryConfig. + * @member {google.cloud.visionai.v1alpha1.IBigQueryConfig|null|undefined} bigQueryConfig + * @memberof google.cloud.visionai.v1alpha1.ProcessorConfig + * @instance + */ + ProcessorConfig.prototype.bigQueryConfig = null; + + /** + * ProcessorConfig personalProtectiveEquipmentDetectionConfig. + * @member {google.cloud.visionai.v1alpha1.IPersonalProtectiveEquipmentDetectionConfig|null|undefined} personalProtectiveEquipmentDetectionConfig + * @memberof google.cloud.visionai.v1alpha1.ProcessorConfig + * @instance + */ + ProcessorConfig.prototype.personalProtectiveEquipmentDetectionConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ProcessorConfig processorConfig. + * @member {"videoStreamInputConfig"|"aiEnabledDevicesInputConfig"|"mediaWarehouseConfig"|"personBlurConfig"|"occupancyCountConfig"|"personVehicleDetectionConfig"|"vertexAutomlVisionConfig"|"vertexAutomlVideoConfig"|"vertexCustomConfig"|"generalObjectDetectionConfig"|"bigQueryConfig"|"personalProtectiveEquipmentDetectionConfig"|undefined} processorConfig + * @memberof google.cloud.visionai.v1alpha1.ProcessorConfig + * @instance + */ + Object.defineProperty(ProcessorConfig.prototype, "processorConfig", { + get: $util.oneOfGetter($oneOfFields = ["videoStreamInputConfig", "aiEnabledDevicesInputConfig", "mediaWarehouseConfig", "personBlurConfig", "occupancyCountConfig", "personVehicleDetectionConfig", "vertexAutomlVisionConfig", "vertexAutomlVideoConfig", "vertexCustomConfig", "generalObjectDetectionConfig", "bigQueryConfig", "personalProtectiveEquipmentDetectionConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ProcessorConfig instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ProcessorConfig + * @static + * @param {google.cloud.visionai.v1alpha1.IProcessorConfig=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ProcessorConfig} ProcessorConfig instance + */ + ProcessorConfig.create = function create(properties) { + return new ProcessorConfig(properties); + }; + + /** + * Encodes the specified ProcessorConfig message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ProcessorConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ProcessorConfig + * @static + * @param {google.cloud.visionai.v1alpha1.IProcessorConfig} message ProcessorConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProcessorConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.videoStreamInputConfig != null && Object.hasOwnProperty.call(message, "videoStreamInputConfig")) + $root.google.cloud.visionai.v1alpha1.VideoStreamInputConfig.encode(message.videoStreamInputConfig, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.mediaWarehouseConfig != null && Object.hasOwnProperty.call(message, "mediaWarehouseConfig")) + $root.google.cloud.visionai.v1alpha1.MediaWarehouseConfig.encode(message.mediaWarehouseConfig, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.personBlurConfig != null && Object.hasOwnProperty.call(message, "personBlurConfig")) + $root.google.cloud.visionai.v1alpha1.PersonBlurConfig.encode(message.personBlurConfig, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.occupancyCountConfig != null && Object.hasOwnProperty.call(message, "occupancyCountConfig")) + $root.google.cloud.visionai.v1alpha1.OccupancyCountConfig.encode(message.occupancyCountConfig, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.vertexAutomlVisionConfig != null && Object.hasOwnProperty.call(message, "vertexAutomlVisionConfig")) + $root.google.cloud.visionai.v1alpha1.VertexAutoMLVisionConfig.encode(message.vertexAutomlVisionConfig, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.vertexAutomlVideoConfig != null && Object.hasOwnProperty.call(message, "vertexAutomlVideoConfig")) + $root.google.cloud.visionai.v1alpha1.VertexAutoMLVideoConfig.encode(message.vertexAutomlVideoConfig, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.personVehicleDetectionConfig != null && Object.hasOwnProperty.call(message, "personVehicleDetectionConfig")) + $root.google.cloud.visionai.v1alpha1.PersonVehicleDetectionConfig.encode(message.personVehicleDetectionConfig, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.vertexCustomConfig != null && Object.hasOwnProperty.call(message, "vertexCustomConfig")) + $root.google.cloud.visionai.v1alpha1.VertexCustomConfig.encode(message.vertexCustomConfig, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.generalObjectDetectionConfig != null && Object.hasOwnProperty.call(message, "generalObjectDetectionConfig")) + $root.google.cloud.visionai.v1alpha1.GeneralObjectDetectionConfig.encode(message.generalObjectDetectionConfig, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.bigQueryConfig != null && Object.hasOwnProperty.call(message, "bigQueryConfig")) + $root.google.cloud.visionai.v1alpha1.BigQueryConfig.encode(message.bigQueryConfig, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.aiEnabledDevicesInputConfig != null && Object.hasOwnProperty.call(message, "aiEnabledDevicesInputConfig")) + $root.google.cloud.visionai.v1alpha1.AIEnabledDevicesInputConfig.encode(message.aiEnabledDevicesInputConfig, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.personalProtectiveEquipmentDetectionConfig != null && Object.hasOwnProperty.call(message, "personalProtectiveEquipmentDetectionConfig")) + $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionConfig.encode(message.personalProtectiveEquipmentDetectionConfig, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ProcessorConfig message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ProcessorConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ProcessorConfig + * @static + * @param {google.cloud.visionai.v1alpha1.IProcessorConfig} message ProcessorConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProcessorConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProcessorConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ProcessorConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ProcessorConfig} ProcessorConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProcessorConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ProcessorConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 9: { + message.videoStreamInputConfig = $root.google.cloud.visionai.v1alpha1.VideoStreamInputConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 20: { + message.aiEnabledDevicesInputConfig = $root.google.cloud.visionai.v1alpha1.AIEnabledDevicesInputConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 10: { + message.mediaWarehouseConfig = $root.google.cloud.visionai.v1alpha1.MediaWarehouseConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 11: { + message.personBlurConfig = $root.google.cloud.visionai.v1alpha1.PersonBlurConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 12: { + message.occupancyCountConfig = $root.google.cloud.visionai.v1alpha1.OccupancyCountConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 15: { + message.personVehicleDetectionConfig = $root.google.cloud.visionai.v1alpha1.PersonVehicleDetectionConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 13: { + message.vertexAutomlVisionConfig = $root.google.cloud.visionai.v1alpha1.VertexAutoMLVisionConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 14: { + message.vertexAutomlVideoConfig = $root.google.cloud.visionai.v1alpha1.VertexAutoMLVideoConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 17: { + message.vertexCustomConfig = $root.google.cloud.visionai.v1alpha1.VertexCustomConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 18: { + message.generalObjectDetectionConfig = $root.google.cloud.visionai.v1alpha1.GeneralObjectDetectionConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 19: { + message.bigQueryConfig = $root.google.cloud.visionai.v1alpha1.BigQueryConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 22: { + message.personalProtectiveEquipmentDetectionConfig = $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ProcessorConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ProcessorConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ProcessorConfig} ProcessorConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProcessorConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProcessorConfig message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ProcessorConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProcessorConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.videoStreamInputConfig != null && message.hasOwnProperty("videoStreamInputConfig")) { + properties.processorConfig = 1; + { + var error = $root.google.cloud.visionai.v1alpha1.VideoStreamInputConfig.verify(message.videoStreamInputConfig, long + 1); + if (error) + return "videoStreamInputConfig." + error; + } + } + if (message.aiEnabledDevicesInputConfig != null && message.hasOwnProperty("aiEnabledDevicesInputConfig")) { + if (properties.processorConfig === 1) + return "processorConfig: multiple values"; + properties.processorConfig = 1; + { + var error = $root.google.cloud.visionai.v1alpha1.AIEnabledDevicesInputConfig.verify(message.aiEnabledDevicesInputConfig, long + 1); + if (error) + return "aiEnabledDevicesInputConfig." + error; + } + } + if (message.mediaWarehouseConfig != null && message.hasOwnProperty("mediaWarehouseConfig")) { + if (properties.processorConfig === 1) + return "processorConfig: multiple values"; + properties.processorConfig = 1; + { + var error = $root.google.cloud.visionai.v1alpha1.MediaWarehouseConfig.verify(message.mediaWarehouseConfig, long + 1); + if (error) + return "mediaWarehouseConfig." + error; + } + } + if (message.personBlurConfig != null && message.hasOwnProperty("personBlurConfig")) { + if (properties.processorConfig === 1) + return "processorConfig: multiple values"; + properties.processorConfig = 1; + { + var error = $root.google.cloud.visionai.v1alpha1.PersonBlurConfig.verify(message.personBlurConfig, long + 1); + if (error) + return "personBlurConfig." + error; + } + } + if (message.occupancyCountConfig != null && message.hasOwnProperty("occupancyCountConfig")) { + if (properties.processorConfig === 1) + return "processorConfig: multiple values"; + properties.processorConfig = 1; + { + var error = $root.google.cloud.visionai.v1alpha1.OccupancyCountConfig.verify(message.occupancyCountConfig, long + 1); + if (error) + return "occupancyCountConfig." + error; + } + } + if (message.personVehicleDetectionConfig != null && message.hasOwnProperty("personVehicleDetectionConfig")) { + if (properties.processorConfig === 1) + return "processorConfig: multiple values"; + properties.processorConfig = 1; + { + var error = $root.google.cloud.visionai.v1alpha1.PersonVehicleDetectionConfig.verify(message.personVehicleDetectionConfig, long + 1); + if (error) + return "personVehicleDetectionConfig." + error; + } + } + if (message.vertexAutomlVisionConfig != null && message.hasOwnProperty("vertexAutomlVisionConfig")) { + if (properties.processorConfig === 1) + return "processorConfig: multiple values"; + properties.processorConfig = 1; + { + var error = $root.google.cloud.visionai.v1alpha1.VertexAutoMLVisionConfig.verify(message.vertexAutomlVisionConfig, long + 1); + if (error) + return "vertexAutomlVisionConfig." + error; + } + } + if (message.vertexAutomlVideoConfig != null && message.hasOwnProperty("vertexAutomlVideoConfig")) { + if (properties.processorConfig === 1) + return "processorConfig: multiple values"; + properties.processorConfig = 1; + { + var error = $root.google.cloud.visionai.v1alpha1.VertexAutoMLVideoConfig.verify(message.vertexAutomlVideoConfig, long + 1); + if (error) + return "vertexAutomlVideoConfig." + error; + } + } + if (message.vertexCustomConfig != null && message.hasOwnProperty("vertexCustomConfig")) { + if (properties.processorConfig === 1) + return "processorConfig: multiple values"; + properties.processorConfig = 1; + { + var error = $root.google.cloud.visionai.v1alpha1.VertexCustomConfig.verify(message.vertexCustomConfig, long + 1); + if (error) + return "vertexCustomConfig." + error; + } + } + if (message.generalObjectDetectionConfig != null && message.hasOwnProperty("generalObjectDetectionConfig")) { + if (properties.processorConfig === 1) + return "processorConfig: multiple values"; + properties.processorConfig = 1; + { + var error = $root.google.cloud.visionai.v1alpha1.GeneralObjectDetectionConfig.verify(message.generalObjectDetectionConfig, long + 1); + if (error) + return "generalObjectDetectionConfig." + error; + } + } + if (message.bigQueryConfig != null && message.hasOwnProperty("bigQueryConfig")) { + if (properties.processorConfig === 1) + return "processorConfig: multiple values"; + properties.processorConfig = 1; + { + var error = $root.google.cloud.visionai.v1alpha1.BigQueryConfig.verify(message.bigQueryConfig, long + 1); + if (error) + return "bigQueryConfig." + error; + } + } + if (message.personalProtectiveEquipmentDetectionConfig != null && message.hasOwnProperty("personalProtectiveEquipmentDetectionConfig")) { + if (properties.processorConfig === 1) + return "processorConfig: multiple values"; + properties.processorConfig = 1; + { + var error = $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionConfig.verify(message.personalProtectiveEquipmentDetectionConfig, long + 1); + if (error) + return "personalProtectiveEquipmentDetectionConfig." + error; + } + } + return null; + }; + + /** + * Creates a ProcessorConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ProcessorConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ProcessorConfig} ProcessorConfig + */ + ProcessorConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ProcessorConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ProcessorConfig(); + if (object.videoStreamInputConfig != null) { + if (typeof object.videoStreamInputConfig !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ProcessorConfig.videoStreamInputConfig: object expected"); + message.videoStreamInputConfig = $root.google.cloud.visionai.v1alpha1.VideoStreamInputConfig.fromObject(object.videoStreamInputConfig, long + 1); + } + if (object.aiEnabledDevicesInputConfig != null) { + if (typeof object.aiEnabledDevicesInputConfig !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ProcessorConfig.aiEnabledDevicesInputConfig: object expected"); + message.aiEnabledDevicesInputConfig = $root.google.cloud.visionai.v1alpha1.AIEnabledDevicesInputConfig.fromObject(object.aiEnabledDevicesInputConfig, long + 1); + } + if (object.mediaWarehouseConfig != null) { + if (typeof object.mediaWarehouseConfig !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ProcessorConfig.mediaWarehouseConfig: object expected"); + message.mediaWarehouseConfig = $root.google.cloud.visionai.v1alpha1.MediaWarehouseConfig.fromObject(object.mediaWarehouseConfig, long + 1); + } + if (object.personBlurConfig != null) { + if (typeof object.personBlurConfig !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ProcessorConfig.personBlurConfig: object expected"); + message.personBlurConfig = $root.google.cloud.visionai.v1alpha1.PersonBlurConfig.fromObject(object.personBlurConfig, long + 1); + } + if (object.occupancyCountConfig != null) { + if (typeof object.occupancyCountConfig !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ProcessorConfig.occupancyCountConfig: object expected"); + message.occupancyCountConfig = $root.google.cloud.visionai.v1alpha1.OccupancyCountConfig.fromObject(object.occupancyCountConfig, long + 1); + } + if (object.personVehicleDetectionConfig != null) { + if (typeof object.personVehicleDetectionConfig !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ProcessorConfig.personVehicleDetectionConfig: object expected"); + message.personVehicleDetectionConfig = $root.google.cloud.visionai.v1alpha1.PersonVehicleDetectionConfig.fromObject(object.personVehicleDetectionConfig, long + 1); + } + if (object.vertexAutomlVisionConfig != null) { + if (typeof object.vertexAutomlVisionConfig !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ProcessorConfig.vertexAutomlVisionConfig: object expected"); + message.vertexAutomlVisionConfig = $root.google.cloud.visionai.v1alpha1.VertexAutoMLVisionConfig.fromObject(object.vertexAutomlVisionConfig, long + 1); + } + if (object.vertexAutomlVideoConfig != null) { + if (typeof object.vertexAutomlVideoConfig !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ProcessorConfig.vertexAutomlVideoConfig: object expected"); + message.vertexAutomlVideoConfig = $root.google.cloud.visionai.v1alpha1.VertexAutoMLVideoConfig.fromObject(object.vertexAutomlVideoConfig, long + 1); + } + if (object.vertexCustomConfig != null) { + if (typeof object.vertexCustomConfig !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ProcessorConfig.vertexCustomConfig: object expected"); + message.vertexCustomConfig = $root.google.cloud.visionai.v1alpha1.VertexCustomConfig.fromObject(object.vertexCustomConfig, long + 1); + } + if (object.generalObjectDetectionConfig != null) { + if (typeof object.generalObjectDetectionConfig !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ProcessorConfig.generalObjectDetectionConfig: object expected"); + message.generalObjectDetectionConfig = $root.google.cloud.visionai.v1alpha1.GeneralObjectDetectionConfig.fromObject(object.generalObjectDetectionConfig, long + 1); + } + if (object.bigQueryConfig != null) { + if (typeof object.bigQueryConfig !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ProcessorConfig.bigQueryConfig: object expected"); + message.bigQueryConfig = $root.google.cloud.visionai.v1alpha1.BigQueryConfig.fromObject(object.bigQueryConfig, long + 1); + } + if (object.personalProtectiveEquipmentDetectionConfig != null) { + if (typeof object.personalProtectiveEquipmentDetectionConfig !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ProcessorConfig.personalProtectiveEquipmentDetectionConfig: object expected"); + message.personalProtectiveEquipmentDetectionConfig = $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionConfig.fromObject(object.personalProtectiveEquipmentDetectionConfig, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a ProcessorConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ProcessorConfig + * @static + * @param {google.cloud.visionai.v1alpha1.ProcessorConfig} message ProcessorConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProcessorConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.videoStreamInputConfig != null && message.hasOwnProperty("videoStreamInputConfig")) { + object.videoStreamInputConfig = $root.google.cloud.visionai.v1alpha1.VideoStreamInputConfig.toObject(message.videoStreamInputConfig, options); + if (options.oneofs) + object.processorConfig = "videoStreamInputConfig"; + } + if (message.mediaWarehouseConfig != null && message.hasOwnProperty("mediaWarehouseConfig")) { + object.mediaWarehouseConfig = $root.google.cloud.visionai.v1alpha1.MediaWarehouseConfig.toObject(message.mediaWarehouseConfig, options); + if (options.oneofs) + object.processorConfig = "mediaWarehouseConfig"; + } + if (message.personBlurConfig != null && message.hasOwnProperty("personBlurConfig")) { + object.personBlurConfig = $root.google.cloud.visionai.v1alpha1.PersonBlurConfig.toObject(message.personBlurConfig, options); + if (options.oneofs) + object.processorConfig = "personBlurConfig"; + } + if (message.occupancyCountConfig != null && message.hasOwnProperty("occupancyCountConfig")) { + object.occupancyCountConfig = $root.google.cloud.visionai.v1alpha1.OccupancyCountConfig.toObject(message.occupancyCountConfig, options); + if (options.oneofs) + object.processorConfig = "occupancyCountConfig"; + } + if (message.vertexAutomlVisionConfig != null && message.hasOwnProperty("vertexAutomlVisionConfig")) { + object.vertexAutomlVisionConfig = $root.google.cloud.visionai.v1alpha1.VertexAutoMLVisionConfig.toObject(message.vertexAutomlVisionConfig, options); + if (options.oneofs) + object.processorConfig = "vertexAutomlVisionConfig"; + } + if (message.vertexAutomlVideoConfig != null && message.hasOwnProperty("vertexAutomlVideoConfig")) { + object.vertexAutomlVideoConfig = $root.google.cloud.visionai.v1alpha1.VertexAutoMLVideoConfig.toObject(message.vertexAutomlVideoConfig, options); + if (options.oneofs) + object.processorConfig = "vertexAutomlVideoConfig"; + } + if (message.personVehicleDetectionConfig != null && message.hasOwnProperty("personVehicleDetectionConfig")) { + object.personVehicleDetectionConfig = $root.google.cloud.visionai.v1alpha1.PersonVehicleDetectionConfig.toObject(message.personVehicleDetectionConfig, options); + if (options.oneofs) + object.processorConfig = "personVehicleDetectionConfig"; + } + if (message.vertexCustomConfig != null && message.hasOwnProperty("vertexCustomConfig")) { + object.vertexCustomConfig = $root.google.cloud.visionai.v1alpha1.VertexCustomConfig.toObject(message.vertexCustomConfig, options); + if (options.oneofs) + object.processorConfig = "vertexCustomConfig"; + } + if (message.generalObjectDetectionConfig != null && message.hasOwnProperty("generalObjectDetectionConfig")) { + object.generalObjectDetectionConfig = $root.google.cloud.visionai.v1alpha1.GeneralObjectDetectionConfig.toObject(message.generalObjectDetectionConfig, options); + if (options.oneofs) + object.processorConfig = "generalObjectDetectionConfig"; + } + if (message.bigQueryConfig != null && message.hasOwnProperty("bigQueryConfig")) { + object.bigQueryConfig = $root.google.cloud.visionai.v1alpha1.BigQueryConfig.toObject(message.bigQueryConfig, options); + if (options.oneofs) + object.processorConfig = "bigQueryConfig"; + } + if (message.aiEnabledDevicesInputConfig != null && message.hasOwnProperty("aiEnabledDevicesInputConfig")) { + object.aiEnabledDevicesInputConfig = $root.google.cloud.visionai.v1alpha1.AIEnabledDevicesInputConfig.toObject(message.aiEnabledDevicesInputConfig, options); + if (options.oneofs) + object.processorConfig = "aiEnabledDevicesInputConfig"; + } + if (message.personalProtectiveEquipmentDetectionConfig != null && message.hasOwnProperty("personalProtectiveEquipmentDetectionConfig")) { + object.personalProtectiveEquipmentDetectionConfig = $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionConfig.toObject(message.personalProtectiveEquipmentDetectionConfig, options); + if (options.oneofs) + object.processorConfig = "personalProtectiveEquipmentDetectionConfig"; + } + return object; + }; + + /** + * Converts this ProcessorConfig to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ProcessorConfig + * @instance + * @returns {Object.} JSON object + */ + ProcessorConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ProcessorConfig + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ProcessorConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ProcessorConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ProcessorConfig"; + }; + + return ProcessorConfig; + })(); + + v1alpha1.StreamWithAnnotation = (function() { + + /** + * Properties of a StreamWithAnnotation. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IStreamWithAnnotation + * @property {string|null} [stream] StreamWithAnnotation stream + * @property {Array.|null} [applicationAnnotations] StreamWithAnnotation applicationAnnotations + * @property {Array.|null} [nodeAnnotations] StreamWithAnnotation nodeAnnotations + */ + + /** + * Constructs a new StreamWithAnnotation. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a StreamWithAnnotation. + * @implements IStreamWithAnnotation + * @constructor + * @param {google.cloud.visionai.v1alpha1.IStreamWithAnnotation=} [properties] Properties to set + */ + function StreamWithAnnotation(properties) { + this.applicationAnnotations = []; + this.nodeAnnotations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamWithAnnotation stream. + * @member {string} stream + * @memberof google.cloud.visionai.v1alpha1.StreamWithAnnotation + * @instance + */ + StreamWithAnnotation.prototype.stream = ""; + + /** + * StreamWithAnnotation applicationAnnotations. + * @member {Array.} applicationAnnotations + * @memberof google.cloud.visionai.v1alpha1.StreamWithAnnotation + * @instance + */ + StreamWithAnnotation.prototype.applicationAnnotations = $util.emptyArray; + + /** + * StreamWithAnnotation nodeAnnotations. + * @member {Array.} nodeAnnotations + * @memberof google.cloud.visionai.v1alpha1.StreamWithAnnotation + * @instance + */ + StreamWithAnnotation.prototype.nodeAnnotations = $util.emptyArray; + + /** + * Creates a new StreamWithAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.StreamWithAnnotation + * @static + * @param {google.cloud.visionai.v1alpha1.IStreamWithAnnotation=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.StreamWithAnnotation} StreamWithAnnotation instance + */ + StreamWithAnnotation.create = function create(properties) { + return new StreamWithAnnotation(properties); + }; + + /** + * Encodes the specified StreamWithAnnotation message. Does not implicitly {@link google.cloud.visionai.v1alpha1.StreamWithAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.StreamWithAnnotation + * @static + * @param {google.cloud.visionai.v1alpha1.IStreamWithAnnotation} message StreamWithAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamWithAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stream != null && Object.hasOwnProperty.call(message, "stream")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.stream); + if (message.applicationAnnotations != null && message.applicationAnnotations.length) + for (var i = 0; i < message.applicationAnnotations.length; ++i) + $root.google.cloud.visionai.v1alpha1.StreamAnnotation.encode(message.applicationAnnotations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nodeAnnotations != null && message.nodeAnnotations.length) + for (var i = 0; i < message.nodeAnnotations.length; ++i) + $root.google.cloud.visionai.v1alpha1.StreamWithAnnotation.NodeAnnotation.encode(message.nodeAnnotations[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StreamWithAnnotation message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.StreamWithAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.StreamWithAnnotation + * @static + * @param {google.cloud.visionai.v1alpha1.IStreamWithAnnotation} message StreamWithAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamWithAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamWithAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.StreamWithAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.StreamWithAnnotation} StreamWithAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamWithAnnotation.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.StreamWithAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.stream = reader.string(); + break; + } + case 2: { + if (!(message.applicationAnnotations && message.applicationAnnotations.length)) + message.applicationAnnotations = []; + message.applicationAnnotations.push($root.google.cloud.visionai.v1alpha1.StreamAnnotation.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 3: { + if (!(message.nodeAnnotations && message.nodeAnnotations.length)) + message.nodeAnnotations = []; + message.nodeAnnotations.push($root.google.cloud.visionai.v1alpha1.StreamWithAnnotation.NodeAnnotation.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a StreamWithAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.StreamWithAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.StreamWithAnnotation} StreamWithAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamWithAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamWithAnnotation message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.StreamWithAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamWithAnnotation.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.stream != null && message.hasOwnProperty("stream")) + if (!$util.isString(message.stream)) + return "stream: string expected"; + if (message.applicationAnnotations != null && message.hasOwnProperty("applicationAnnotations")) { + if (!Array.isArray(message.applicationAnnotations)) + return "applicationAnnotations: array expected"; + for (var i = 0; i < message.applicationAnnotations.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.StreamAnnotation.verify(message.applicationAnnotations[i], long + 1); + if (error) + return "applicationAnnotations." + error; + } + } + if (message.nodeAnnotations != null && message.hasOwnProperty("nodeAnnotations")) { + if (!Array.isArray(message.nodeAnnotations)) + return "nodeAnnotations: array expected"; + for (var i = 0; i < message.nodeAnnotations.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.StreamWithAnnotation.NodeAnnotation.verify(message.nodeAnnotations[i], long + 1); + if (error) + return "nodeAnnotations." + error; + } + } + return null; + }; + + /** + * Creates a StreamWithAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.StreamWithAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.StreamWithAnnotation} StreamWithAnnotation + */ + StreamWithAnnotation.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.StreamWithAnnotation) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.StreamWithAnnotation(); + if (object.stream != null) + message.stream = String(object.stream); + if (object.applicationAnnotations) { + if (!Array.isArray(object.applicationAnnotations)) + throw TypeError(".google.cloud.visionai.v1alpha1.StreamWithAnnotation.applicationAnnotations: array expected"); + message.applicationAnnotations = []; + for (var i = 0; i < object.applicationAnnotations.length; ++i) { + if (typeof object.applicationAnnotations[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.StreamWithAnnotation.applicationAnnotations: object expected"); + message.applicationAnnotations[i] = $root.google.cloud.visionai.v1alpha1.StreamAnnotation.fromObject(object.applicationAnnotations[i], long + 1); + } + } + if (object.nodeAnnotations) { + if (!Array.isArray(object.nodeAnnotations)) + throw TypeError(".google.cloud.visionai.v1alpha1.StreamWithAnnotation.nodeAnnotations: array expected"); + message.nodeAnnotations = []; + for (var i = 0; i < object.nodeAnnotations.length; ++i) { + if (typeof object.nodeAnnotations[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.StreamWithAnnotation.nodeAnnotations: object expected"); + message.nodeAnnotations[i] = $root.google.cloud.visionai.v1alpha1.StreamWithAnnotation.NodeAnnotation.fromObject(object.nodeAnnotations[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a StreamWithAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.StreamWithAnnotation + * @static + * @param {google.cloud.visionai.v1alpha1.StreamWithAnnotation} message StreamWithAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamWithAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.applicationAnnotations = []; + object.nodeAnnotations = []; + } + if (options.defaults) + object.stream = ""; + if (message.stream != null && message.hasOwnProperty("stream")) + object.stream = message.stream; + if (message.applicationAnnotations && message.applicationAnnotations.length) { + object.applicationAnnotations = []; + for (var j = 0; j < message.applicationAnnotations.length; ++j) + object.applicationAnnotations[j] = $root.google.cloud.visionai.v1alpha1.StreamAnnotation.toObject(message.applicationAnnotations[j], options); + } + if (message.nodeAnnotations && message.nodeAnnotations.length) { + object.nodeAnnotations = []; + for (var j = 0; j < message.nodeAnnotations.length; ++j) + object.nodeAnnotations[j] = $root.google.cloud.visionai.v1alpha1.StreamWithAnnotation.NodeAnnotation.toObject(message.nodeAnnotations[j], options); + } + return object; + }; + + /** + * Converts this StreamWithAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.StreamWithAnnotation + * @instance + * @returns {Object.} JSON object + */ + StreamWithAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamWithAnnotation + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.StreamWithAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamWithAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.StreamWithAnnotation"; + }; + + StreamWithAnnotation.NodeAnnotation = (function() { + + /** + * Properties of a NodeAnnotation. + * @memberof google.cloud.visionai.v1alpha1.StreamWithAnnotation + * @interface INodeAnnotation + * @property {string|null} [node] NodeAnnotation node + * @property {Array.|null} [annotations] NodeAnnotation annotations + */ + + /** + * Constructs a new NodeAnnotation. + * @memberof google.cloud.visionai.v1alpha1.StreamWithAnnotation + * @classdesc Represents a NodeAnnotation. + * @implements INodeAnnotation + * @constructor + * @param {google.cloud.visionai.v1alpha1.StreamWithAnnotation.INodeAnnotation=} [properties] Properties to set + */ + function NodeAnnotation(properties) { + this.annotations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeAnnotation node. + * @member {string} node + * @memberof google.cloud.visionai.v1alpha1.StreamWithAnnotation.NodeAnnotation + * @instance + */ + NodeAnnotation.prototype.node = ""; + + /** + * NodeAnnotation annotations. + * @member {Array.} annotations + * @memberof google.cloud.visionai.v1alpha1.StreamWithAnnotation.NodeAnnotation + * @instance + */ + NodeAnnotation.prototype.annotations = $util.emptyArray; + + /** + * Creates a new NodeAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.StreamWithAnnotation.NodeAnnotation + * @static + * @param {google.cloud.visionai.v1alpha1.StreamWithAnnotation.INodeAnnotation=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.StreamWithAnnotation.NodeAnnotation} NodeAnnotation instance + */ + NodeAnnotation.create = function create(properties) { + return new NodeAnnotation(properties); + }; + + /** + * Encodes the specified NodeAnnotation message. Does not implicitly {@link google.cloud.visionai.v1alpha1.StreamWithAnnotation.NodeAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.StreamWithAnnotation.NodeAnnotation + * @static + * @param {google.cloud.visionai.v1alpha1.StreamWithAnnotation.INodeAnnotation} message NodeAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.node != null && Object.hasOwnProperty.call(message, "node")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.node); + if (message.annotations != null && message.annotations.length) + for (var i = 0; i < message.annotations.length; ++i) + $root.google.cloud.visionai.v1alpha1.StreamAnnotation.encode(message.annotations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NodeAnnotation message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.StreamWithAnnotation.NodeAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.StreamWithAnnotation.NodeAnnotation + * @static + * @param {google.cloud.visionai.v1alpha1.StreamWithAnnotation.INodeAnnotation} message NodeAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.StreamWithAnnotation.NodeAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.StreamWithAnnotation.NodeAnnotation} NodeAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAnnotation.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.StreamWithAnnotation.NodeAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.node = reader.string(); + break; + } + case 2: { + if (!(message.annotations && message.annotations.length)) + message.annotations = []; + message.annotations.push($root.google.cloud.visionai.v1alpha1.StreamAnnotation.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a NodeAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.StreamWithAnnotation.NodeAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.StreamWithAnnotation.NodeAnnotation} NodeAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeAnnotation message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.StreamWithAnnotation.NodeAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeAnnotation.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.node != null && message.hasOwnProperty("node")) + if (!$util.isString(message.node)) + return "node: string expected"; + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!Array.isArray(message.annotations)) + return "annotations: array expected"; + for (var i = 0; i < message.annotations.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.StreamAnnotation.verify(message.annotations[i], long + 1); + if (error) + return "annotations." + error; + } + } + return null; + }; + + /** + * Creates a NodeAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.StreamWithAnnotation.NodeAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.StreamWithAnnotation.NodeAnnotation} NodeAnnotation + */ + NodeAnnotation.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.StreamWithAnnotation.NodeAnnotation) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.StreamWithAnnotation.NodeAnnotation(); + if (object.node != null) + message.node = String(object.node); + if (object.annotations) { + if (!Array.isArray(object.annotations)) + throw TypeError(".google.cloud.visionai.v1alpha1.StreamWithAnnotation.NodeAnnotation.annotations: array expected"); + message.annotations = []; + for (var i = 0; i < object.annotations.length; ++i) { + if (typeof object.annotations[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.StreamWithAnnotation.NodeAnnotation.annotations: object expected"); + message.annotations[i] = $root.google.cloud.visionai.v1alpha1.StreamAnnotation.fromObject(object.annotations[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a NodeAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.StreamWithAnnotation.NodeAnnotation + * @static + * @param {google.cloud.visionai.v1alpha1.StreamWithAnnotation.NodeAnnotation} message NodeAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotations = []; + if (options.defaults) + object.node = ""; + if (message.node != null && message.hasOwnProperty("node")) + object.node = message.node; + if (message.annotations && message.annotations.length) { + object.annotations = []; + for (var j = 0; j < message.annotations.length; ++j) + object.annotations[j] = $root.google.cloud.visionai.v1alpha1.StreamAnnotation.toObject(message.annotations[j], options); + } + return object; + }; + + /** + * Converts this NodeAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.StreamWithAnnotation.NodeAnnotation + * @instance + * @returns {Object.} JSON object + */ + NodeAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeAnnotation + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.StreamWithAnnotation.NodeAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.StreamWithAnnotation.NodeAnnotation"; + }; + + return NodeAnnotation; + })(); + + return StreamWithAnnotation; + })(); + + v1alpha1.ApplicationNodeAnnotation = (function() { + + /** + * Properties of an ApplicationNodeAnnotation. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IApplicationNodeAnnotation + * @property {string|null} [node] ApplicationNodeAnnotation node + * @property {Array.|null} [annotations] ApplicationNodeAnnotation annotations + */ + + /** + * Constructs a new ApplicationNodeAnnotation. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents an ApplicationNodeAnnotation. + * @implements IApplicationNodeAnnotation + * @constructor + * @param {google.cloud.visionai.v1alpha1.IApplicationNodeAnnotation=} [properties] Properties to set + */ + function ApplicationNodeAnnotation(properties) { + this.annotations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ApplicationNodeAnnotation node. + * @member {string} node + * @memberof google.cloud.visionai.v1alpha1.ApplicationNodeAnnotation + * @instance + */ + ApplicationNodeAnnotation.prototype.node = ""; + + /** + * ApplicationNodeAnnotation annotations. + * @member {Array.} annotations + * @memberof google.cloud.visionai.v1alpha1.ApplicationNodeAnnotation + * @instance + */ + ApplicationNodeAnnotation.prototype.annotations = $util.emptyArray; + + /** + * Creates a new ApplicationNodeAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ApplicationNodeAnnotation + * @static + * @param {google.cloud.visionai.v1alpha1.IApplicationNodeAnnotation=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ApplicationNodeAnnotation} ApplicationNodeAnnotation instance + */ + ApplicationNodeAnnotation.create = function create(properties) { + return new ApplicationNodeAnnotation(properties); + }; + + /** + * Encodes the specified ApplicationNodeAnnotation message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ApplicationNodeAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ApplicationNodeAnnotation + * @static + * @param {google.cloud.visionai.v1alpha1.IApplicationNodeAnnotation} message ApplicationNodeAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApplicationNodeAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.node != null && Object.hasOwnProperty.call(message, "node")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.node); + if (message.annotations != null && message.annotations.length) + for (var i = 0; i < message.annotations.length; ++i) + $root.google.cloud.visionai.v1alpha1.StreamAnnotation.encode(message.annotations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ApplicationNodeAnnotation message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ApplicationNodeAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ApplicationNodeAnnotation + * @static + * @param {google.cloud.visionai.v1alpha1.IApplicationNodeAnnotation} message ApplicationNodeAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApplicationNodeAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApplicationNodeAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ApplicationNodeAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ApplicationNodeAnnotation} ApplicationNodeAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApplicationNodeAnnotation.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ApplicationNodeAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.node = reader.string(); + break; + } + case 2: { + if (!(message.annotations && message.annotations.length)) + message.annotations = []; + message.annotations.push($root.google.cloud.visionai.v1alpha1.StreamAnnotation.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ApplicationNodeAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ApplicationNodeAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ApplicationNodeAnnotation} ApplicationNodeAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApplicationNodeAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApplicationNodeAnnotation message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ApplicationNodeAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApplicationNodeAnnotation.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.node != null && message.hasOwnProperty("node")) + if (!$util.isString(message.node)) + return "node: string expected"; + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!Array.isArray(message.annotations)) + return "annotations: array expected"; + for (var i = 0; i < message.annotations.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.StreamAnnotation.verify(message.annotations[i], long + 1); + if (error) + return "annotations." + error; + } + } + return null; + }; + + /** + * Creates an ApplicationNodeAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ApplicationNodeAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ApplicationNodeAnnotation} ApplicationNodeAnnotation + */ + ApplicationNodeAnnotation.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ApplicationNodeAnnotation) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ApplicationNodeAnnotation(); + if (object.node != null) + message.node = String(object.node); + if (object.annotations) { + if (!Array.isArray(object.annotations)) + throw TypeError(".google.cloud.visionai.v1alpha1.ApplicationNodeAnnotation.annotations: array expected"); + message.annotations = []; + for (var i = 0; i < object.annotations.length; ++i) { + if (typeof object.annotations[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ApplicationNodeAnnotation.annotations: object expected"); + message.annotations[i] = $root.google.cloud.visionai.v1alpha1.StreamAnnotation.fromObject(object.annotations[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from an ApplicationNodeAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ApplicationNodeAnnotation + * @static + * @param {google.cloud.visionai.v1alpha1.ApplicationNodeAnnotation} message ApplicationNodeAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApplicationNodeAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotations = []; + if (options.defaults) + object.node = ""; + if (message.node != null && message.hasOwnProperty("node")) + object.node = message.node; + if (message.annotations && message.annotations.length) { + object.annotations = []; + for (var j = 0; j < message.annotations.length; ++j) + object.annotations[j] = $root.google.cloud.visionai.v1alpha1.StreamAnnotation.toObject(message.annotations[j], options); + } + return object; + }; + + /** + * Converts this ApplicationNodeAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ApplicationNodeAnnotation + * @instance + * @returns {Object.} JSON object + */ + ApplicationNodeAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ApplicationNodeAnnotation + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ApplicationNodeAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ApplicationNodeAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ApplicationNodeAnnotation"; + }; + + return ApplicationNodeAnnotation; + })(); + + v1alpha1.ResourceAnnotations = (function() { + + /** + * Properties of a ResourceAnnotations. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IResourceAnnotations + * @property {Array.|null} [applicationAnnotations] ResourceAnnotations applicationAnnotations + * @property {Array.|null} [nodeAnnotations] ResourceAnnotations nodeAnnotations + */ + + /** + * Constructs a new ResourceAnnotations. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a ResourceAnnotations. + * @implements IResourceAnnotations + * @constructor + * @param {google.cloud.visionai.v1alpha1.IResourceAnnotations=} [properties] Properties to set + */ + function ResourceAnnotations(properties) { + this.applicationAnnotations = []; + this.nodeAnnotations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceAnnotations applicationAnnotations. + * @member {Array.} applicationAnnotations + * @memberof google.cloud.visionai.v1alpha1.ResourceAnnotations + * @instance + */ + ResourceAnnotations.prototype.applicationAnnotations = $util.emptyArray; + + /** + * ResourceAnnotations nodeAnnotations. + * @member {Array.} nodeAnnotations + * @memberof google.cloud.visionai.v1alpha1.ResourceAnnotations + * @instance + */ + ResourceAnnotations.prototype.nodeAnnotations = $util.emptyArray; + + /** + * Creates a new ResourceAnnotations instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ResourceAnnotations + * @static + * @param {google.cloud.visionai.v1alpha1.IResourceAnnotations=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ResourceAnnotations} ResourceAnnotations instance + */ + ResourceAnnotations.create = function create(properties) { + return new ResourceAnnotations(properties); + }; + + /** + * Encodes the specified ResourceAnnotations message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ResourceAnnotations.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ResourceAnnotations + * @static + * @param {google.cloud.visionai.v1alpha1.IResourceAnnotations} message ResourceAnnotations message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceAnnotations.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.applicationAnnotations != null && message.applicationAnnotations.length) + for (var i = 0; i < message.applicationAnnotations.length; ++i) + $root.google.cloud.visionai.v1alpha1.StreamAnnotation.encode(message.applicationAnnotations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nodeAnnotations != null && message.nodeAnnotations.length) + for (var i = 0; i < message.nodeAnnotations.length; ++i) + $root.google.cloud.visionai.v1alpha1.ApplicationNodeAnnotation.encode(message.nodeAnnotations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ResourceAnnotations message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ResourceAnnotations.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ResourceAnnotations + * @static + * @param {google.cloud.visionai.v1alpha1.IResourceAnnotations} message ResourceAnnotations message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceAnnotations.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceAnnotations message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ResourceAnnotations + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ResourceAnnotations} ResourceAnnotations + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceAnnotations.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ResourceAnnotations(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.applicationAnnotations && message.applicationAnnotations.length)) + message.applicationAnnotations = []; + message.applicationAnnotations.push($root.google.cloud.visionai.v1alpha1.StreamAnnotation.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + if (!(message.nodeAnnotations && message.nodeAnnotations.length)) + message.nodeAnnotations = []; + message.nodeAnnotations.push($root.google.cloud.visionai.v1alpha1.ApplicationNodeAnnotation.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceAnnotations message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ResourceAnnotations + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ResourceAnnotations} ResourceAnnotations + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceAnnotations.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceAnnotations message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ResourceAnnotations + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceAnnotations.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.applicationAnnotations != null && message.hasOwnProperty("applicationAnnotations")) { + if (!Array.isArray(message.applicationAnnotations)) + return "applicationAnnotations: array expected"; + for (var i = 0; i < message.applicationAnnotations.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.StreamAnnotation.verify(message.applicationAnnotations[i], long + 1); + if (error) + return "applicationAnnotations." + error; + } + } + if (message.nodeAnnotations != null && message.hasOwnProperty("nodeAnnotations")) { + if (!Array.isArray(message.nodeAnnotations)) + return "nodeAnnotations: array expected"; + for (var i = 0; i < message.nodeAnnotations.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.ApplicationNodeAnnotation.verify(message.nodeAnnotations[i], long + 1); + if (error) + return "nodeAnnotations." + error; + } + } + return null; + }; + + /** + * Creates a ResourceAnnotations message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ResourceAnnotations + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ResourceAnnotations} ResourceAnnotations + */ + ResourceAnnotations.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ResourceAnnotations) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ResourceAnnotations(); + if (object.applicationAnnotations) { + if (!Array.isArray(object.applicationAnnotations)) + throw TypeError(".google.cloud.visionai.v1alpha1.ResourceAnnotations.applicationAnnotations: array expected"); + message.applicationAnnotations = []; + for (var i = 0; i < object.applicationAnnotations.length; ++i) { + if (typeof object.applicationAnnotations[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ResourceAnnotations.applicationAnnotations: object expected"); + message.applicationAnnotations[i] = $root.google.cloud.visionai.v1alpha1.StreamAnnotation.fromObject(object.applicationAnnotations[i], long + 1); + } + } + if (object.nodeAnnotations) { + if (!Array.isArray(object.nodeAnnotations)) + throw TypeError(".google.cloud.visionai.v1alpha1.ResourceAnnotations.nodeAnnotations: array expected"); + message.nodeAnnotations = []; + for (var i = 0; i < object.nodeAnnotations.length; ++i) { + if (typeof object.nodeAnnotations[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ResourceAnnotations.nodeAnnotations: object expected"); + message.nodeAnnotations[i] = $root.google.cloud.visionai.v1alpha1.ApplicationNodeAnnotation.fromObject(object.nodeAnnotations[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a ResourceAnnotations message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ResourceAnnotations + * @static + * @param {google.cloud.visionai.v1alpha1.ResourceAnnotations} message ResourceAnnotations + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceAnnotations.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.applicationAnnotations = []; + object.nodeAnnotations = []; + } + if (message.applicationAnnotations && message.applicationAnnotations.length) { + object.applicationAnnotations = []; + for (var j = 0; j < message.applicationAnnotations.length; ++j) + object.applicationAnnotations[j] = $root.google.cloud.visionai.v1alpha1.StreamAnnotation.toObject(message.applicationAnnotations[j], options); + } + if (message.nodeAnnotations && message.nodeAnnotations.length) { + object.nodeAnnotations = []; + for (var j = 0; j < message.nodeAnnotations.length; ++j) + object.nodeAnnotations[j] = $root.google.cloud.visionai.v1alpha1.ApplicationNodeAnnotation.toObject(message.nodeAnnotations[j], options); + } + return object; + }; + + /** + * Converts this ResourceAnnotations to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ResourceAnnotations + * @instance + * @returns {Object.} JSON object + */ + ResourceAnnotations.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceAnnotations + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ResourceAnnotations + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceAnnotations.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ResourceAnnotations"; + }; + + return ResourceAnnotations; + })(); + + v1alpha1.VideoStreamInputConfig = (function() { + + /** + * Properties of a VideoStreamInputConfig. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IVideoStreamInputConfig + * @property {Array.|null} [streams] VideoStreamInputConfig streams + * @property {Array.|null} [streamsWithAnnotation] VideoStreamInputConfig streamsWithAnnotation + */ + + /** + * Constructs a new VideoStreamInputConfig. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a VideoStreamInputConfig. + * @implements IVideoStreamInputConfig + * @constructor + * @param {google.cloud.visionai.v1alpha1.IVideoStreamInputConfig=} [properties] Properties to set + */ + function VideoStreamInputConfig(properties) { + this.streams = []; + this.streamsWithAnnotation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * VideoStreamInputConfig streams. + * @member {Array.} streams + * @memberof google.cloud.visionai.v1alpha1.VideoStreamInputConfig + * @instance + */ + VideoStreamInputConfig.prototype.streams = $util.emptyArray; + + /** + * VideoStreamInputConfig streamsWithAnnotation. + * @member {Array.} streamsWithAnnotation + * @memberof google.cloud.visionai.v1alpha1.VideoStreamInputConfig + * @instance + */ + VideoStreamInputConfig.prototype.streamsWithAnnotation = $util.emptyArray; + + /** + * Creates a new VideoStreamInputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.VideoStreamInputConfig + * @static + * @param {google.cloud.visionai.v1alpha1.IVideoStreamInputConfig=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.VideoStreamInputConfig} VideoStreamInputConfig instance + */ + VideoStreamInputConfig.create = function create(properties) { + return new VideoStreamInputConfig(properties); + }; + + /** + * Encodes the specified VideoStreamInputConfig message. Does not implicitly {@link google.cloud.visionai.v1alpha1.VideoStreamInputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.VideoStreamInputConfig + * @static + * @param {google.cloud.visionai.v1alpha1.IVideoStreamInputConfig} message VideoStreamInputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoStreamInputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.streams != null && message.streams.length) + for (var i = 0; i < message.streams.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.streams[i]); + if (message.streamsWithAnnotation != null && message.streamsWithAnnotation.length) + for (var i = 0; i < message.streamsWithAnnotation.length; ++i) + $root.google.cloud.visionai.v1alpha1.StreamWithAnnotation.encode(message.streamsWithAnnotation[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VideoStreamInputConfig message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.VideoStreamInputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.VideoStreamInputConfig + * @static + * @param {google.cloud.visionai.v1alpha1.IVideoStreamInputConfig} message VideoStreamInputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoStreamInputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VideoStreamInputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.VideoStreamInputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.VideoStreamInputConfig} VideoStreamInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoStreamInputConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.VideoStreamInputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.streams && message.streams.length)) + message.streams = []; + message.streams.push(reader.string()); + break; + } + case 2: { + if (!(message.streamsWithAnnotation && message.streamsWithAnnotation.length)) + message.streamsWithAnnotation = []; + message.streamsWithAnnotation.push($root.google.cloud.visionai.v1alpha1.StreamWithAnnotation.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a VideoStreamInputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.VideoStreamInputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.VideoStreamInputConfig} VideoStreamInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoStreamInputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VideoStreamInputConfig message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.VideoStreamInputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VideoStreamInputConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.streams != null && message.hasOwnProperty("streams")) { + if (!Array.isArray(message.streams)) + return "streams: array expected"; + for (var i = 0; i < message.streams.length; ++i) + if (!$util.isString(message.streams[i])) + return "streams: string[] expected"; + } + if (message.streamsWithAnnotation != null && message.hasOwnProperty("streamsWithAnnotation")) { + if (!Array.isArray(message.streamsWithAnnotation)) + return "streamsWithAnnotation: array expected"; + for (var i = 0; i < message.streamsWithAnnotation.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.StreamWithAnnotation.verify(message.streamsWithAnnotation[i], long + 1); + if (error) + return "streamsWithAnnotation." + error; + } + } + return null; + }; + + /** + * Creates a VideoStreamInputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.VideoStreamInputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.VideoStreamInputConfig} VideoStreamInputConfig + */ + VideoStreamInputConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.VideoStreamInputConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.VideoStreamInputConfig(); + if (object.streams) { + if (!Array.isArray(object.streams)) + throw TypeError(".google.cloud.visionai.v1alpha1.VideoStreamInputConfig.streams: array expected"); + message.streams = []; + for (var i = 0; i < object.streams.length; ++i) + message.streams[i] = String(object.streams[i]); + } + if (object.streamsWithAnnotation) { + if (!Array.isArray(object.streamsWithAnnotation)) + throw TypeError(".google.cloud.visionai.v1alpha1.VideoStreamInputConfig.streamsWithAnnotation: array expected"); + message.streamsWithAnnotation = []; + for (var i = 0; i < object.streamsWithAnnotation.length; ++i) { + if (typeof object.streamsWithAnnotation[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.VideoStreamInputConfig.streamsWithAnnotation: object expected"); + message.streamsWithAnnotation[i] = $root.google.cloud.visionai.v1alpha1.StreamWithAnnotation.fromObject(object.streamsWithAnnotation[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a VideoStreamInputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.VideoStreamInputConfig + * @static + * @param {google.cloud.visionai.v1alpha1.VideoStreamInputConfig} message VideoStreamInputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VideoStreamInputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.streams = []; + object.streamsWithAnnotation = []; + } + if (message.streams && message.streams.length) { + object.streams = []; + for (var j = 0; j < message.streams.length; ++j) + object.streams[j] = message.streams[j]; + } + if (message.streamsWithAnnotation && message.streamsWithAnnotation.length) { + object.streamsWithAnnotation = []; + for (var j = 0; j < message.streamsWithAnnotation.length; ++j) + object.streamsWithAnnotation[j] = $root.google.cloud.visionai.v1alpha1.StreamWithAnnotation.toObject(message.streamsWithAnnotation[j], options); + } + return object; + }; + + /** + * Converts this VideoStreamInputConfig to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.VideoStreamInputConfig + * @instance + * @returns {Object.} JSON object + */ + VideoStreamInputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VideoStreamInputConfig + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.VideoStreamInputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VideoStreamInputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.VideoStreamInputConfig"; + }; + + return VideoStreamInputConfig; + })(); + + v1alpha1.AIEnabledDevicesInputConfig = (function() { + + /** + * Properties of a AIEnabledDevicesInputConfig. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IAIEnabledDevicesInputConfig + */ + + /** + * Constructs a new AIEnabledDevicesInputConfig. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a AIEnabledDevicesInputConfig. + * @implements IAIEnabledDevicesInputConfig + * @constructor + * @param {google.cloud.visionai.v1alpha1.IAIEnabledDevicesInputConfig=} [properties] Properties to set + */ + function AIEnabledDevicesInputConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new AIEnabledDevicesInputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.AIEnabledDevicesInputConfig + * @static + * @param {google.cloud.visionai.v1alpha1.IAIEnabledDevicesInputConfig=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.AIEnabledDevicesInputConfig} AIEnabledDevicesInputConfig instance + */ + AIEnabledDevicesInputConfig.create = function create(properties) { + return new AIEnabledDevicesInputConfig(properties); + }; + + /** + * Encodes the specified AIEnabledDevicesInputConfig message. Does not implicitly {@link google.cloud.visionai.v1alpha1.AIEnabledDevicesInputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.AIEnabledDevicesInputConfig + * @static + * @param {google.cloud.visionai.v1alpha1.IAIEnabledDevicesInputConfig} message AIEnabledDevicesInputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AIEnabledDevicesInputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified AIEnabledDevicesInputConfig message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.AIEnabledDevicesInputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.AIEnabledDevicesInputConfig + * @static + * @param {google.cloud.visionai.v1alpha1.IAIEnabledDevicesInputConfig} message AIEnabledDevicesInputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AIEnabledDevicesInputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a AIEnabledDevicesInputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.AIEnabledDevicesInputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.AIEnabledDevicesInputConfig} AIEnabledDevicesInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AIEnabledDevicesInputConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.AIEnabledDevicesInputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a AIEnabledDevicesInputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.AIEnabledDevicesInputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.AIEnabledDevicesInputConfig} AIEnabledDevicesInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AIEnabledDevicesInputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a AIEnabledDevicesInputConfig message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.AIEnabledDevicesInputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AIEnabledDevicesInputConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates a AIEnabledDevicesInputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.AIEnabledDevicesInputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.AIEnabledDevicesInputConfig} AIEnabledDevicesInputConfig + */ + AIEnabledDevicesInputConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.AIEnabledDevicesInputConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.google.cloud.visionai.v1alpha1.AIEnabledDevicesInputConfig(); + }; + + /** + * Creates a plain object from a AIEnabledDevicesInputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.AIEnabledDevicesInputConfig + * @static + * @param {google.cloud.visionai.v1alpha1.AIEnabledDevicesInputConfig} message AIEnabledDevicesInputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AIEnabledDevicesInputConfig.toObject = function toObject() { + return {}; + }; + + /** + * Converts this AIEnabledDevicesInputConfig to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.AIEnabledDevicesInputConfig + * @instance + * @returns {Object.} JSON object + */ + AIEnabledDevicesInputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AIEnabledDevicesInputConfig + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.AIEnabledDevicesInputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AIEnabledDevicesInputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.AIEnabledDevicesInputConfig"; + }; + + return AIEnabledDevicesInputConfig; + })(); + + v1alpha1.MediaWarehouseConfig = (function() { + + /** + * Properties of a MediaWarehouseConfig. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IMediaWarehouseConfig + * @property {string|null} [corpus] MediaWarehouseConfig corpus + * @property {string|null} [region] MediaWarehouseConfig region + * @property {google.protobuf.IDuration|null} [ttl] MediaWarehouseConfig ttl + */ + + /** + * Constructs a new MediaWarehouseConfig. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a MediaWarehouseConfig. + * @implements IMediaWarehouseConfig + * @constructor + * @param {google.cloud.visionai.v1alpha1.IMediaWarehouseConfig=} [properties] Properties to set + */ + function MediaWarehouseConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * MediaWarehouseConfig corpus. + * @member {string} corpus + * @memberof google.cloud.visionai.v1alpha1.MediaWarehouseConfig + * @instance + */ + MediaWarehouseConfig.prototype.corpus = ""; + + /** + * MediaWarehouseConfig region. + * @member {string} region + * @memberof google.cloud.visionai.v1alpha1.MediaWarehouseConfig + * @instance + */ + MediaWarehouseConfig.prototype.region = ""; + + /** + * MediaWarehouseConfig ttl. + * @member {google.protobuf.IDuration|null|undefined} ttl + * @memberof google.cloud.visionai.v1alpha1.MediaWarehouseConfig + * @instance + */ + MediaWarehouseConfig.prototype.ttl = null; + + /** + * Creates a new MediaWarehouseConfig instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.MediaWarehouseConfig + * @static + * @param {google.cloud.visionai.v1alpha1.IMediaWarehouseConfig=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.MediaWarehouseConfig} MediaWarehouseConfig instance + */ + MediaWarehouseConfig.create = function create(properties) { + return new MediaWarehouseConfig(properties); + }; + + /** + * Encodes the specified MediaWarehouseConfig message. Does not implicitly {@link google.cloud.visionai.v1alpha1.MediaWarehouseConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.MediaWarehouseConfig + * @static + * @param {google.cloud.visionai.v1alpha1.IMediaWarehouseConfig} message MediaWarehouseConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MediaWarehouseConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.corpus != null && Object.hasOwnProperty.call(message, "corpus")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.corpus); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.region); + if (message.ttl != null && Object.hasOwnProperty.call(message, "ttl")) + $root.google.protobuf.Duration.encode(message.ttl, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MediaWarehouseConfig message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.MediaWarehouseConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.MediaWarehouseConfig + * @static + * @param {google.cloud.visionai.v1alpha1.IMediaWarehouseConfig} message MediaWarehouseConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MediaWarehouseConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MediaWarehouseConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.MediaWarehouseConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.MediaWarehouseConfig} MediaWarehouseConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MediaWarehouseConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.MediaWarehouseConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.corpus = reader.string(); + break; + } + case 2: { + message.region = reader.string(); + break; + } + case 3: { + message.ttl = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a MediaWarehouseConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.MediaWarehouseConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.MediaWarehouseConfig} MediaWarehouseConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MediaWarehouseConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MediaWarehouseConfig message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.MediaWarehouseConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MediaWarehouseConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.corpus != null && message.hasOwnProperty("corpus")) + if (!$util.isString(message.corpus)) + return "corpus: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.ttl != null && message.hasOwnProperty("ttl")) { + var error = $root.google.protobuf.Duration.verify(message.ttl, long + 1); + if (error) + return "ttl." + error; + } + return null; + }; + + /** + * Creates a MediaWarehouseConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.MediaWarehouseConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.MediaWarehouseConfig} MediaWarehouseConfig + */ + MediaWarehouseConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.MediaWarehouseConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.MediaWarehouseConfig(); + if (object.corpus != null) + message.corpus = String(object.corpus); + if (object.region != null) + message.region = String(object.region); + if (object.ttl != null) { + if (typeof object.ttl !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.MediaWarehouseConfig.ttl: object expected"); + message.ttl = $root.google.protobuf.Duration.fromObject(object.ttl, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a MediaWarehouseConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.MediaWarehouseConfig + * @static + * @param {google.cloud.visionai.v1alpha1.MediaWarehouseConfig} message MediaWarehouseConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MediaWarehouseConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.corpus = ""; + object.region = ""; + object.ttl = null; + } + if (message.corpus != null && message.hasOwnProperty("corpus")) + object.corpus = message.corpus; + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.ttl != null && message.hasOwnProperty("ttl")) + object.ttl = $root.google.protobuf.Duration.toObject(message.ttl, options); + return object; + }; + + /** + * Converts this MediaWarehouseConfig to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.MediaWarehouseConfig + * @instance + * @returns {Object.} JSON object + */ + MediaWarehouseConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MediaWarehouseConfig + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.MediaWarehouseConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MediaWarehouseConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.MediaWarehouseConfig"; + }; + + return MediaWarehouseConfig; + })(); + + v1alpha1.PersonBlurConfig = (function() { + + /** + * Properties of a PersonBlurConfig. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IPersonBlurConfig + * @property {google.cloud.visionai.v1alpha1.PersonBlurConfig.PersonBlurType|null} [personBlurType] PersonBlurConfig personBlurType + * @property {boolean|null} [facesOnly] PersonBlurConfig facesOnly + */ + + /** + * Constructs a new PersonBlurConfig. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a PersonBlurConfig. + * @implements IPersonBlurConfig + * @constructor + * @param {google.cloud.visionai.v1alpha1.IPersonBlurConfig=} [properties] Properties to set + */ + function PersonBlurConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PersonBlurConfig personBlurType. + * @member {google.cloud.visionai.v1alpha1.PersonBlurConfig.PersonBlurType} personBlurType + * @memberof google.cloud.visionai.v1alpha1.PersonBlurConfig + * @instance + */ + PersonBlurConfig.prototype.personBlurType = 0; + + /** + * PersonBlurConfig facesOnly. + * @member {boolean} facesOnly + * @memberof google.cloud.visionai.v1alpha1.PersonBlurConfig + * @instance + */ + PersonBlurConfig.prototype.facesOnly = false; + + /** + * Creates a new PersonBlurConfig instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.PersonBlurConfig + * @static + * @param {google.cloud.visionai.v1alpha1.IPersonBlurConfig=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.PersonBlurConfig} PersonBlurConfig instance + */ + PersonBlurConfig.create = function create(properties) { + return new PersonBlurConfig(properties); + }; + + /** + * Encodes the specified PersonBlurConfig message. Does not implicitly {@link google.cloud.visionai.v1alpha1.PersonBlurConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.PersonBlurConfig + * @static + * @param {google.cloud.visionai.v1alpha1.IPersonBlurConfig} message PersonBlurConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PersonBlurConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.personBlurType != null && Object.hasOwnProperty.call(message, "personBlurType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.personBlurType); + if (message.facesOnly != null && Object.hasOwnProperty.call(message, "facesOnly")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.facesOnly); + return writer; + }; + + /** + * Encodes the specified PersonBlurConfig message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.PersonBlurConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.PersonBlurConfig + * @static + * @param {google.cloud.visionai.v1alpha1.IPersonBlurConfig} message PersonBlurConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PersonBlurConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PersonBlurConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.PersonBlurConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.PersonBlurConfig} PersonBlurConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PersonBlurConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.PersonBlurConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.personBlurType = reader.int32(); + break; + } + case 2: { + message.facesOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PersonBlurConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.PersonBlurConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.PersonBlurConfig} PersonBlurConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PersonBlurConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PersonBlurConfig message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.PersonBlurConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PersonBlurConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.personBlurType != null && message.hasOwnProperty("personBlurType")) + switch (message.personBlurType) { + default: + return "personBlurType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.facesOnly != null && message.hasOwnProperty("facesOnly")) + if (typeof message.facesOnly !== "boolean") + return "facesOnly: boolean expected"; + return null; + }; + + /** + * Creates a PersonBlurConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.PersonBlurConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.PersonBlurConfig} PersonBlurConfig + */ + PersonBlurConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.PersonBlurConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.PersonBlurConfig(); + switch (object.personBlurType) { + default: + if (typeof object.personBlurType === "number") { + message.personBlurType = object.personBlurType; + break; + } + break; + case "PERSON_BLUR_TYPE_UNSPECIFIED": + case 0: + message.personBlurType = 0; + break; + case "FULL_OCCULUSION": + case 1: + message.personBlurType = 1; + break; + case "BLUR_FILTER": + case 2: + message.personBlurType = 2; + break; + } + if (object.facesOnly != null) + message.facesOnly = Boolean(object.facesOnly); + return message; + }; + + /** + * Creates a plain object from a PersonBlurConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.PersonBlurConfig + * @static + * @param {google.cloud.visionai.v1alpha1.PersonBlurConfig} message PersonBlurConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PersonBlurConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.personBlurType = options.enums === String ? "PERSON_BLUR_TYPE_UNSPECIFIED" : 0; + object.facesOnly = false; + } + if (message.personBlurType != null && message.hasOwnProperty("personBlurType")) + object.personBlurType = options.enums === String ? $root.google.cloud.visionai.v1alpha1.PersonBlurConfig.PersonBlurType[message.personBlurType] === undefined ? message.personBlurType : $root.google.cloud.visionai.v1alpha1.PersonBlurConfig.PersonBlurType[message.personBlurType] : message.personBlurType; + if (message.facesOnly != null && message.hasOwnProperty("facesOnly")) + object.facesOnly = message.facesOnly; + return object; + }; + + /** + * Converts this PersonBlurConfig to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.PersonBlurConfig + * @instance + * @returns {Object.} JSON object + */ + PersonBlurConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PersonBlurConfig + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.PersonBlurConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PersonBlurConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.PersonBlurConfig"; + }; + + /** + * PersonBlurType enum. + * @name google.cloud.visionai.v1alpha1.PersonBlurConfig.PersonBlurType + * @enum {number} + * @property {number} PERSON_BLUR_TYPE_UNSPECIFIED=0 PERSON_BLUR_TYPE_UNSPECIFIED value + * @property {number} FULL_OCCULUSION=1 FULL_OCCULUSION value + * @property {number} BLUR_FILTER=2 BLUR_FILTER value + */ + PersonBlurConfig.PersonBlurType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PERSON_BLUR_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "FULL_OCCULUSION"] = 1; + values[valuesById[2] = "BLUR_FILTER"] = 2; + return values; + })(); + + return PersonBlurConfig; + })(); + + v1alpha1.OccupancyCountConfig = (function() { + + /** + * Properties of an OccupancyCountConfig. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IOccupancyCountConfig + * @property {boolean|null} [enablePeopleCounting] OccupancyCountConfig enablePeopleCounting + * @property {boolean|null} [enableVehicleCounting] OccupancyCountConfig enableVehicleCounting + * @property {boolean|null} [enableDwellingTimeTracking] OccupancyCountConfig enableDwellingTimeTracking + */ + + /** + * Constructs a new OccupancyCountConfig. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents an OccupancyCountConfig. + * @implements IOccupancyCountConfig + * @constructor + * @param {google.cloud.visionai.v1alpha1.IOccupancyCountConfig=} [properties] Properties to set + */ + function OccupancyCountConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * OccupancyCountConfig enablePeopleCounting. + * @member {boolean} enablePeopleCounting + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountConfig + * @instance + */ + OccupancyCountConfig.prototype.enablePeopleCounting = false; + + /** + * OccupancyCountConfig enableVehicleCounting. + * @member {boolean} enableVehicleCounting + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountConfig + * @instance + */ + OccupancyCountConfig.prototype.enableVehicleCounting = false; + + /** + * OccupancyCountConfig enableDwellingTimeTracking. + * @member {boolean} enableDwellingTimeTracking + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountConfig + * @instance + */ + OccupancyCountConfig.prototype.enableDwellingTimeTracking = false; + + /** + * Creates a new OccupancyCountConfig instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountConfig + * @static + * @param {google.cloud.visionai.v1alpha1.IOccupancyCountConfig=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.OccupancyCountConfig} OccupancyCountConfig instance + */ + OccupancyCountConfig.create = function create(properties) { + return new OccupancyCountConfig(properties); + }; + + /** + * Encodes the specified OccupancyCountConfig message. Does not implicitly {@link google.cloud.visionai.v1alpha1.OccupancyCountConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountConfig + * @static + * @param {google.cloud.visionai.v1alpha1.IOccupancyCountConfig} message OccupancyCountConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OccupancyCountConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enablePeopleCounting != null && Object.hasOwnProperty.call(message, "enablePeopleCounting")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enablePeopleCounting); + if (message.enableVehicleCounting != null && Object.hasOwnProperty.call(message, "enableVehicleCounting")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enableVehicleCounting); + if (message.enableDwellingTimeTracking != null && Object.hasOwnProperty.call(message, "enableDwellingTimeTracking")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enableDwellingTimeTracking); + return writer; + }; + + /** + * Encodes the specified OccupancyCountConfig message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.OccupancyCountConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountConfig + * @static + * @param {google.cloud.visionai.v1alpha1.IOccupancyCountConfig} message OccupancyCountConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OccupancyCountConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OccupancyCountConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.OccupancyCountConfig} OccupancyCountConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OccupancyCountConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.OccupancyCountConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enablePeopleCounting = reader.bool(); + break; + } + case 2: { + message.enableVehicleCounting = reader.bool(); + break; + } + case 3: { + message.enableDwellingTimeTracking = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an OccupancyCountConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.OccupancyCountConfig} OccupancyCountConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OccupancyCountConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OccupancyCountConfig message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OccupancyCountConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.enablePeopleCounting != null && message.hasOwnProperty("enablePeopleCounting")) + if (typeof message.enablePeopleCounting !== "boolean") + return "enablePeopleCounting: boolean expected"; + if (message.enableVehicleCounting != null && message.hasOwnProperty("enableVehicleCounting")) + if (typeof message.enableVehicleCounting !== "boolean") + return "enableVehicleCounting: boolean expected"; + if (message.enableDwellingTimeTracking != null && message.hasOwnProperty("enableDwellingTimeTracking")) + if (typeof message.enableDwellingTimeTracking !== "boolean") + return "enableDwellingTimeTracking: boolean expected"; + return null; + }; + + /** + * Creates an OccupancyCountConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.OccupancyCountConfig} OccupancyCountConfig + */ + OccupancyCountConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.OccupancyCountConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.OccupancyCountConfig(); + if (object.enablePeopleCounting != null) + message.enablePeopleCounting = Boolean(object.enablePeopleCounting); + if (object.enableVehicleCounting != null) + message.enableVehicleCounting = Boolean(object.enableVehicleCounting); + if (object.enableDwellingTimeTracking != null) + message.enableDwellingTimeTracking = Boolean(object.enableDwellingTimeTracking); + return message; + }; + + /** + * Creates a plain object from an OccupancyCountConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountConfig + * @static + * @param {google.cloud.visionai.v1alpha1.OccupancyCountConfig} message OccupancyCountConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OccupancyCountConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.enablePeopleCounting = false; + object.enableVehicleCounting = false; + object.enableDwellingTimeTracking = false; + } + if (message.enablePeopleCounting != null && message.hasOwnProperty("enablePeopleCounting")) + object.enablePeopleCounting = message.enablePeopleCounting; + if (message.enableVehicleCounting != null && message.hasOwnProperty("enableVehicleCounting")) + object.enableVehicleCounting = message.enableVehicleCounting; + if (message.enableDwellingTimeTracking != null && message.hasOwnProperty("enableDwellingTimeTracking")) + object.enableDwellingTimeTracking = message.enableDwellingTimeTracking; + return object; + }; + + /** + * Converts this OccupancyCountConfig to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountConfig + * @instance + * @returns {Object.} JSON object + */ + OccupancyCountConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OccupancyCountConfig + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.OccupancyCountConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OccupancyCountConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.OccupancyCountConfig"; + }; + + return OccupancyCountConfig; + })(); + + v1alpha1.PersonVehicleDetectionConfig = (function() { + + /** + * Properties of a PersonVehicleDetectionConfig. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IPersonVehicleDetectionConfig + * @property {boolean|null} [enablePeopleCounting] PersonVehicleDetectionConfig enablePeopleCounting + * @property {boolean|null} [enableVehicleCounting] PersonVehicleDetectionConfig enableVehicleCounting + */ + + /** + * Constructs a new PersonVehicleDetectionConfig. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a PersonVehicleDetectionConfig. + * @implements IPersonVehicleDetectionConfig + * @constructor + * @param {google.cloud.visionai.v1alpha1.IPersonVehicleDetectionConfig=} [properties] Properties to set + */ + function PersonVehicleDetectionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PersonVehicleDetectionConfig enablePeopleCounting. + * @member {boolean} enablePeopleCounting + * @memberof google.cloud.visionai.v1alpha1.PersonVehicleDetectionConfig + * @instance + */ + PersonVehicleDetectionConfig.prototype.enablePeopleCounting = false; + + /** + * PersonVehicleDetectionConfig enableVehicleCounting. + * @member {boolean} enableVehicleCounting + * @memberof google.cloud.visionai.v1alpha1.PersonVehicleDetectionConfig + * @instance + */ + PersonVehicleDetectionConfig.prototype.enableVehicleCounting = false; + + /** + * Creates a new PersonVehicleDetectionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.PersonVehicleDetectionConfig + * @static + * @param {google.cloud.visionai.v1alpha1.IPersonVehicleDetectionConfig=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.PersonVehicleDetectionConfig} PersonVehicleDetectionConfig instance + */ + PersonVehicleDetectionConfig.create = function create(properties) { + return new PersonVehicleDetectionConfig(properties); + }; + + /** + * Encodes the specified PersonVehicleDetectionConfig message. Does not implicitly {@link google.cloud.visionai.v1alpha1.PersonVehicleDetectionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.PersonVehicleDetectionConfig + * @static + * @param {google.cloud.visionai.v1alpha1.IPersonVehicleDetectionConfig} message PersonVehicleDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PersonVehicleDetectionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enablePeopleCounting != null && Object.hasOwnProperty.call(message, "enablePeopleCounting")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enablePeopleCounting); + if (message.enableVehicleCounting != null && Object.hasOwnProperty.call(message, "enableVehicleCounting")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enableVehicleCounting); + return writer; + }; + + /** + * Encodes the specified PersonVehicleDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.PersonVehicleDetectionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.PersonVehicleDetectionConfig + * @static + * @param {google.cloud.visionai.v1alpha1.IPersonVehicleDetectionConfig} message PersonVehicleDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PersonVehicleDetectionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PersonVehicleDetectionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.PersonVehicleDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.PersonVehicleDetectionConfig} PersonVehicleDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PersonVehicleDetectionConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.PersonVehicleDetectionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enablePeopleCounting = reader.bool(); + break; + } + case 2: { + message.enableVehicleCounting = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PersonVehicleDetectionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.PersonVehicleDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.PersonVehicleDetectionConfig} PersonVehicleDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PersonVehicleDetectionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PersonVehicleDetectionConfig message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.PersonVehicleDetectionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PersonVehicleDetectionConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.enablePeopleCounting != null && message.hasOwnProperty("enablePeopleCounting")) + if (typeof message.enablePeopleCounting !== "boolean") + return "enablePeopleCounting: boolean expected"; + if (message.enableVehicleCounting != null && message.hasOwnProperty("enableVehicleCounting")) + if (typeof message.enableVehicleCounting !== "boolean") + return "enableVehicleCounting: boolean expected"; + return null; + }; + + /** + * Creates a PersonVehicleDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.PersonVehicleDetectionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.PersonVehicleDetectionConfig} PersonVehicleDetectionConfig + */ + PersonVehicleDetectionConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.PersonVehicleDetectionConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.PersonVehicleDetectionConfig(); + if (object.enablePeopleCounting != null) + message.enablePeopleCounting = Boolean(object.enablePeopleCounting); + if (object.enableVehicleCounting != null) + message.enableVehicleCounting = Boolean(object.enableVehicleCounting); + return message; + }; + + /** + * Creates a plain object from a PersonVehicleDetectionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.PersonVehicleDetectionConfig + * @static + * @param {google.cloud.visionai.v1alpha1.PersonVehicleDetectionConfig} message PersonVehicleDetectionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PersonVehicleDetectionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.enablePeopleCounting = false; + object.enableVehicleCounting = false; + } + if (message.enablePeopleCounting != null && message.hasOwnProperty("enablePeopleCounting")) + object.enablePeopleCounting = message.enablePeopleCounting; + if (message.enableVehicleCounting != null && message.hasOwnProperty("enableVehicleCounting")) + object.enableVehicleCounting = message.enableVehicleCounting; + return object; + }; + + /** + * Converts this PersonVehicleDetectionConfig to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.PersonVehicleDetectionConfig + * @instance + * @returns {Object.} JSON object + */ + PersonVehicleDetectionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PersonVehicleDetectionConfig + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.PersonVehicleDetectionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PersonVehicleDetectionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.PersonVehicleDetectionConfig"; + }; + + return PersonVehicleDetectionConfig; + })(); + + v1alpha1.PersonalProtectiveEquipmentDetectionConfig = (function() { + + /** + * Properties of a PersonalProtectiveEquipmentDetectionConfig. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IPersonalProtectiveEquipmentDetectionConfig + * @property {boolean|null} [enableFaceCoverageDetection] PersonalProtectiveEquipmentDetectionConfig enableFaceCoverageDetection + * @property {boolean|null} [enableHeadCoverageDetection] PersonalProtectiveEquipmentDetectionConfig enableHeadCoverageDetection + * @property {boolean|null} [enableHandsCoverageDetection] PersonalProtectiveEquipmentDetectionConfig enableHandsCoverageDetection + */ + + /** + * Constructs a new PersonalProtectiveEquipmentDetectionConfig. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a PersonalProtectiveEquipmentDetectionConfig. + * @implements IPersonalProtectiveEquipmentDetectionConfig + * @constructor + * @param {google.cloud.visionai.v1alpha1.IPersonalProtectiveEquipmentDetectionConfig=} [properties] Properties to set + */ + function PersonalProtectiveEquipmentDetectionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PersonalProtectiveEquipmentDetectionConfig enableFaceCoverageDetection. + * @member {boolean} enableFaceCoverageDetection + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionConfig + * @instance + */ + PersonalProtectiveEquipmentDetectionConfig.prototype.enableFaceCoverageDetection = false; + + /** + * PersonalProtectiveEquipmentDetectionConfig enableHeadCoverageDetection. + * @member {boolean} enableHeadCoverageDetection + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionConfig + * @instance + */ + PersonalProtectiveEquipmentDetectionConfig.prototype.enableHeadCoverageDetection = false; + + /** + * PersonalProtectiveEquipmentDetectionConfig enableHandsCoverageDetection. + * @member {boolean} enableHandsCoverageDetection + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionConfig + * @instance + */ + PersonalProtectiveEquipmentDetectionConfig.prototype.enableHandsCoverageDetection = false; + + /** + * Creates a new PersonalProtectiveEquipmentDetectionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionConfig + * @static + * @param {google.cloud.visionai.v1alpha1.IPersonalProtectiveEquipmentDetectionConfig=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionConfig} PersonalProtectiveEquipmentDetectionConfig instance + */ + PersonalProtectiveEquipmentDetectionConfig.create = function create(properties) { + return new PersonalProtectiveEquipmentDetectionConfig(properties); + }; + + /** + * Encodes the specified PersonalProtectiveEquipmentDetectionConfig message. Does not implicitly {@link google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionConfig + * @static + * @param {google.cloud.visionai.v1alpha1.IPersonalProtectiveEquipmentDetectionConfig} message PersonalProtectiveEquipmentDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PersonalProtectiveEquipmentDetectionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableFaceCoverageDetection != null && Object.hasOwnProperty.call(message, "enableFaceCoverageDetection")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableFaceCoverageDetection); + if (message.enableHeadCoverageDetection != null && Object.hasOwnProperty.call(message, "enableHeadCoverageDetection")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enableHeadCoverageDetection); + if (message.enableHandsCoverageDetection != null && Object.hasOwnProperty.call(message, "enableHandsCoverageDetection")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enableHandsCoverageDetection); + return writer; + }; + + /** + * Encodes the specified PersonalProtectiveEquipmentDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionConfig + * @static + * @param {google.cloud.visionai.v1alpha1.IPersonalProtectiveEquipmentDetectionConfig} message PersonalProtectiveEquipmentDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PersonalProtectiveEquipmentDetectionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PersonalProtectiveEquipmentDetectionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionConfig} PersonalProtectiveEquipmentDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PersonalProtectiveEquipmentDetectionConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enableFaceCoverageDetection = reader.bool(); + break; + } + case 2: { + message.enableHeadCoverageDetection = reader.bool(); + break; + } + case 3: { + message.enableHandsCoverageDetection = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PersonalProtectiveEquipmentDetectionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionConfig} PersonalProtectiveEquipmentDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PersonalProtectiveEquipmentDetectionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PersonalProtectiveEquipmentDetectionConfig message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PersonalProtectiveEquipmentDetectionConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.enableFaceCoverageDetection != null && message.hasOwnProperty("enableFaceCoverageDetection")) + if (typeof message.enableFaceCoverageDetection !== "boolean") + return "enableFaceCoverageDetection: boolean expected"; + if (message.enableHeadCoverageDetection != null && message.hasOwnProperty("enableHeadCoverageDetection")) + if (typeof message.enableHeadCoverageDetection !== "boolean") + return "enableHeadCoverageDetection: boolean expected"; + if (message.enableHandsCoverageDetection != null && message.hasOwnProperty("enableHandsCoverageDetection")) + if (typeof message.enableHandsCoverageDetection !== "boolean") + return "enableHandsCoverageDetection: boolean expected"; + return null; + }; + + /** + * Creates a PersonalProtectiveEquipmentDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionConfig} PersonalProtectiveEquipmentDetectionConfig + */ + PersonalProtectiveEquipmentDetectionConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionConfig(); + if (object.enableFaceCoverageDetection != null) + message.enableFaceCoverageDetection = Boolean(object.enableFaceCoverageDetection); + if (object.enableHeadCoverageDetection != null) + message.enableHeadCoverageDetection = Boolean(object.enableHeadCoverageDetection); + if (object.enableHandsCoverageDetection != null) + message.enableHandsCoverageDetection = Boolean(object.enableHandsCoverageDetection); + return message; + }; + + /** + * Creates a plain object from a PersonalProtectiveEquipmentDetectionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionConfig + * @static + * @param {google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionConfig} message PersonalProtectiveEquipmentDetectionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PersonalProtectiveEquipmentDetectionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.enableFaceCoverageDetection = false; + object.enableHeadCoverageDetection = false; + object.enableHandsCoverageDetection = false; + } + if (message.enableFaceCoverageDetection != null && message.hasOwnProperty("enableFaceCoverageDetection")) + object.enableFaceCoverageDetection = message.enableFaceCoverageDetection; + if (message.enableHeadCoverageDetection != null && message.hasOwnProperty("enableHeadCoverageDetection")) + object.enableHeadCoverageDetection = message.enableHeadCoverageDetection; + if (message.enableHandsCoverageDetection != null && message.hasOwnProperty("enableHandsCoverageDetection")) + object.enableHandsCoverageDetection = message.enableHandsCoverageDetection; + return object; + }; + + /** + * Converts this PersonalProtectiveEquipmentDetectionConfig to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionConfig + * @instance + * @returns {Object.} JSON object + */ + PersonalProtectiveEquipmentDetectionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PersonalProtectiveEquipmentDetectionConfig + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PersonalProtectiveEquipmentDetectionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.PersonalProtectiveEquipmentDetectionConfig"; + }; + + return PersonalProtectiveEquipmentDetectionConfig; + })(); + + v1alpha1.GeneralObjectDetectionConfig = (function() { + + /** + * Properties of a GeneralObjectDetectionConfig. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IGeneralObjectDetectionConfig + */ + + /** + * Constructs a new GeneralObjectDetectionConfig. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a GeneralObjectDetectionConfig. + * @implements IGeneralObjectDetectionConfig + * @constructor + * @param {google.cloud.visionai.v1alpha1.IGeneralObjectDetectionConfig=} [properties] Properties to set + */ + function GeneralObjectDetectionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new GeneralObjectDetectionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.GeneralObjectDetectionConfig + * @static + * @param {google.cloud.visionai.v1alpha1.IGeneralObjectDetectionConfig=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.GeneralObjectDetectionConfig} GeneralObjectDetectionConfig instance + */ + GeneralObjectDetectionConfig.create = function create(properties) { + return new GeneralObjectDetectionConfig(properties); + }; + + /** + * Encodes the specified GeneralObjectDetectionConfig message. Does not implicitly {@link google.cloud.visionai.v1alpha1.GeneralObjectDetectionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.GeneralObjectDetectionConfig + * @static + * @param {google.cloud.visionai.v1alpha1.IGeneralObjectDetectionConfig} message GeneralObjectDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneralObjectDetectionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified GeneralObjectDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.GeneralObjectDetectionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.GeneralObjectDetectionConfig + * @static + * @param {google.cloud.visionai.v1alpha1.IGeneralObjectDetectionConfig} message GeneralObjectDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneralObjectDetectionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneralObjectDetectionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.GeneralObjectDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.GeneralObjectDetectionConfig} GeneralObjectDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneralObjectDetectionConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.GeneralObjectDetectionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GeneralObjectDetectionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.GeneralObjectDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.GeneralObjectDetectionConfig} GeneralObjectDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneralObjectDetectionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneralObjectDetectionConfig message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.GeneralObjectDetectionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneralObjectDetectionConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates a GeneralObjectDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.GeneralObjectDetectionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.GeneralObjectDetectionConfig} GeneralObjectDetectionConfig + */ + GeneralObjectDetectionConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.GeneralObjectDetectionConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.google.cloud.visionai.v1alpha1.GeneralObjectDetectionConfig(); + }; + + /** + * Creates a plain object from a GeneralObjectDetectionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.GeneralObjectDetectionConfig + * @static + * @param {google.cloud.visionai.v1alpha1.GeneralObjectDetectionConfig} message GeneralObjectDetectionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneralObjectDetectionConfig.toObject = function toObject() { + return {}; + }; + + /** + * Converts this GeneralObjectDetectionConfig to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.GeneralObjectDetectionConfig + * @instance + * @returns {Object.} JSON object + */ + GeneralObjectDetectionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeneralObjectDetectionConfig + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.GeneralObjectDetectionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneralObjectDetectionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.GeneralObjectDetectionConfig"; + }; + + return GeneralObjectDetectionConfig; + })(); + + v1alpha1.BigQueryConfig = (function() { + + /** + * Properties of a BigQueryConfig. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IBigQueryConfig + * @property {string|null} [table] BigQueryConfig table + * @property {Object.|null} [cloudFunctionMapping] BigQueryConfig cloudFunctionMapping + * @property {boolean|null} [createDefaultTableIfNotExists] BigQueryConfig createDefaultTableIfNotExists + */ + + /** + * Constructs a new BigQueryConfig. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a BigQueryConfig. + * @implements IBigQueryConfig + * @constructor + * @param {google.cloud.visionai.v1alpha1.IBigQueryConfig=} [properties] Properties to set + */ + function BigQueryConfig(properties) { + this.cloudFunctionMapping = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * BigQueryConfig table. + * @member {string} table + * @memberof google.cloud.visionai.v1alpha1.BigQueryConfig + * @instance + */ + BigQueryConfig.prototype.table = ""; + + /** + * BigQueryConfig cloudFunctionMapping. + * @member {Object.} cloudFunctionMapping + * @memberof google.cloud.visionai.v1alpha1.BigQueryConfig + * @instance + */ + BigQueryConfig.prototype.cloudFunctionMapping = $util.emptyObject; + + /** + * BigQueryConfig createDefaultTableIfNotExists. + * @member {boolean} createDefaultTableIfNotExists + * @memberof google.cloud.visionai.v1alpha1.BigQueryConfig + * @instance + */ + BigQueryConfig.prototype.createDefaultTableIfNotExists = false; + + /** + * Creates a new BigQueryConfig instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.BigQueryConfig + * @static + * @param {google.cloud.visionai.v1alpha1.IBigQueryConfig=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.BigQueryConfig} BigQueryConfig instance + */ + BigQueryConfig.create = function create(properties) { + return new BigQueryConfig(properties); + }; + + /** + * Encodes the specified BigQueryConfig message. Does not implicitly {@link google.cloud.visionai.v1alpha1.BigQueryConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.BigQueryConfig + * @static + * @param {google.cloud.visionai.v1alpha1.IBigQueryConfig} message BigQueryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.table != null && Object.hasOwnProperty.call(message, "table")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.table); + if (message.cloudFunctionMapping != null && Object.hasOwnProperty.call(message, "cloudFunctionMapping")) + for (var keys = Object.keys(message.cloudFunctionMapping), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.cloudFunctionMapping[keys[i]]).ldelim(); + if (message.createDefaultTableIfNotExists != null && Object.hasOwnProperty.call(message, "createDefaultTableIfNotExists")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.createDefaultTableIfNotExists); + return writer; + }; + + /** + * Encodes the specified BigQueryConfig message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.BigQueryConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.BigQueryConfig + * @static + * @param {google.cloud.visionai.v1alpha1.IBigQueryConfig} message BigQueryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BigQueryConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.BigQueryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.BigQueryConfig} BigQueryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.BigQueryConfig(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.table = reader.string(); + break; + } + case 2: { + if (message.cloudFunctionMapping === $util.emptyObject) + message.cloudFunctionMapping = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.cloudFunctionMapping, key); + message.cloudFunctionMapping[key] = value; + break; + } + case 3: { + message.createDefaultTableIfNotExists = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a BigQueryConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.BigQueryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.BigQueryConfig} BigQueryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BigQueryConfig message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.BigQueryConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BigQueryConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.table != null && message.hasOwnProperty("table")) + if (!$util.isString(message.table)) + return "table: string expected"; + if (message.cloudFunctionMapping != null && message.hasOwnProperty("cloudFunctionMapping")) { + if (!$util.isObject(message.cloudFunctionMapping)) + return "cloudFunctionMapping: object expected"; + var key = Object.keys(message.cloudFunctionMapping); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.cloudFunctionMapping[key[i]])) + return "cloudFunctionMapping: string{k:string} expected"; + } + if (message.createDefaultTableIfNotExists != null && message.hasOwnProperty("createDefaultTableIfNotExists")) + if (typeof message.createDefaultTableIfNotExists !== "boolean") + return "createDefaultTableIfNotExists: boolean expected"; + return null; + }; + + /** + * Creates a BigQueryConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.BigQueryConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.BigQueryConfig} BigQueryConfig + */ + BigQueryConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.BigQueryConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.BigQueryConfig(); + if (object.table != null) + message.table = String(object.table); + if (object.cloudFunctionMapping) { + if (typeof object.cloudFunctionMapping !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.BigQueryConfig.cloudFunctionMapping: object expected"); + message.cloudFunctionMapping = {}; + for (var keys = Object.keys(object.cloudFunctionMapping), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.cloudFunctionMapping, keys[i]); + message.cloudFunctionMapping[keys[i]] = String(object.cloudFunctionMapping[keys[i]]); + } + } + if (object.createDefaultTableIfNotExists != null) + message.createDefaultTableIfNotExists = Boolean(object.createDefaultTableIfNotExists); + return message; + }; + + /** + * Creates a plain object from a BigQueryConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.BigQueryConfig + * @static + * @param {google.cloud.visionai.v1alpha1.BigQueryConfig} message BigQueryConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BigQueryConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.cloudFunctionMapping = {}; + if (options.defaults) { + object.table = ""; + object.createDefaultTableIfNotExists = false; + } + if (message.table != null && message.hasOwnProperty("table")) + object.table = message.table; + var keys2; + if (message.cloudFunctionMapping && (keys2 = Object.keys(message.cloudFunctionMapping)).length) { + object.cloudFunctionMapping = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.cloudFunctionMapping, keys2[j]); + object.cloudFunctionMapping[keys2[j]] = message.cloudFunctionMapping[keys2[j]]; + } + } + if (message.createDefaultTableIfNotExists != null && message.hasOwnProperty("createDefaultTableIfNotExists")) + object.createDefaultTableIfNotExists = message.createDefaultTableIfNotExists; + return object; + }; + + /** + * Converts this BigQueryConfig to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.BigQueryConfig + * @instance + * @returns {Object.} JSON object + */ + BigQueryConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BigQueryConfig + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.BigQueryConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BigQueryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.BigQueryConfig"; + }; + + return BigQueryConfig; + })(); + + v1alpha1.VertexAutoMLVisionConfig = (function() { + + /** + * Properties of a VertexAutoMLVisionConfig. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IVertexAutoMLVisionConfig + * @property {number|null} [confidenceThreshold] VertexAutoMLVisionConfig confidenceThreshold + * @property {number|null} [maxPredictions] VertexAutoMLVisionConfig maxPredictions + */ + + /** + * Constructs a new VertexAutoMLVisionConfig. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a VertexAutoMLVisionConfig. + * @implements IVertexAutoMLVisionConfig + * @constructor + * @param {google.cloud.visionai.v1alpha1.IVertexAutoMLVisionConfig=} [properties] Properties to set + */ + function VertexAutoMLVisionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * VertexAutoMLVisionConfig confidenceThreshold. + * @member {number} confidenceThreshold + * @memberof google.cloud.visionai.v1alpha1.VertexAutoMLVisionConfig + * @instance + */ + VertexAutoMLVisionConfig.prototype.confidenceThreshold = 0; + + /** + * VertexAutoMLVisionConfig maxPredictions. + * @member {number} maxPredictions + * @memberof google.cloud.visionai.v1alpha1.VertexAutoMLVisionConfig + * @instance + */ + VertexAutoMLVisionConfig.prototype.maxPredictions = 0; + + /** + * Creates a new VertexAutoMLVisionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.VertexAutoMLVisionConfig + * @static + * @param {google.cloud.visionai.v1alpha1.IVertexAutoMLVisionConfig=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.VertexAutoMLVisionConfig} VertexAutoMLVisionConfig instance + */ + VertexAutoMLVisionConfig.create = function create(properties) { + return new VertexAutoMLVisionConfig(properties); + }; + + /** + * Encodes the specified VertexAutoMLVisionConfig message. Does not implicitly {@link google.cloud.visionai.v1alpha1.VertexAutoMLVisionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.VertexAutoMLVisionConfig + * @static + * @param {google.cloud.visionai.v1alpha1.IVertexAutoMLVisionConfig} message VertexAutoMLVisionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VertexAutoMLVisionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.confidenceThreshold != null && Object.hasOwnProperty.call(message, "confidenceThreshold")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.confidenceThreshold); + if (message.maxPredictions != null && Object.hasOwnProperty.call(message, "maxPredictions")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxPredictions); + return writer; + }; + + /** + * Encodes the specified VertexAutoMLVisionConfig message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.VertexAutoMLVisionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.VertexAutoMLVisionConfig + * @static + * @param {google.cloud.visionai.v1alpha1.IVertexAutoMLVisionConfig} message VertexAutoMLVisionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VertexAutoMLVisionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VertexAutoMLVisionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.VertexAutoMLVisionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.VertexAutoMLVisionConfig} VertexAutoMLVisionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VertexAutoMLVisionConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.VertexAutoMLVisionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.confidenceThreshold = reader.float(); + break; + } + case 2: { + message.maxPredictions = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a VertexAutoMLVisionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.VertexAutoMLVisionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.VertexAutoMLVisionConfig} VertexAutoMLVisionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VertexAutoMLVisionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VertexAutoMLVisionConfig message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.VertexAutoMLVisionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VertexAutoMLVisionConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.confidenceThreshold != null && message.hasOwnProperty("confidenceThreshold")) + if (typeof message.confidenceThreshold !== "number") + return "confidenceThreshold: number expected"; + if (message.maxPredictions != null && message.hasOwnProperty("maxPredictions")) + if (!$util.isInteger(message.maxPredictions)) + return "maxPredictions: integer expected"; + return null; + }; + + /** + * Creates a VertexAutoMLVisionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.VertexAutoMLVisionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.VertexAutoMLVisionConfig} VertexAutoMLVisionConfig + */ + VertexAutoMLVisionConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.VertexAutoMLVisionConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.VertexAutoMLVisionConfig(); + if (object.confidenceThreshold != null) + message.confidenceThreshold = Number(object.confidenceThreshold); + if (object.maxPredictions != null) + message.maxPredictions = object.maxPredictions | 0; + return message; + }; + + /** + * Creates a plain object from a VertexAutoMLVisionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.VertexAutoMLVisionConfig + * @static + * @param {google.cloud.visionai.v1alpha1.VertexAutoMLVisionConfig} message VertexAutoMLVisionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VertexAutoMLVisionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.confidenceThreshold = 0; + object.maxPredictions = 0; + } + if (message.confidenceThreshold != null && message.hasOwnProperty("confidenceThreshold")) + object.confidenceThreshold = options.json && !isFinite(message.confidenceThreshold) ? String(message.confidenceThreshold) : message.confidenceThreshold; + if (message.maxPredictions != null && message.hasOwnProperty("maxPredictions")) + object.maxPredictions = message.maxPredictions; + return object; + }; + + /** + * Converts this VertexAutoMLVisionConfig to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.VertexAutoMLVisionConfig + * @instance + * @returns {Object.} JSON object + */ + VertexAutoMLVisionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VertexAutoMLVisionConfig + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.VertexAutoMLVisionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VertexAutoMLVisionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.VertexAutoMLVisionConfig"; + }; + + return VertexAutoMLVisionConfig; + })(); + + v1alpha1.VertexAutoMLVideoConfig = (function() { + + /** + * Properties of a VertexAutoMLVideoConfig. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IVertexAutoMLVideoConfig + * @property {number|null} [confidenceThreshold] VertexAutoMLVideoConfig confidenceThreshold + * @property {Array.|null} [blockedLabels] VertexAutoMLVideoConfig blockedLabels + * @property {number|null} [maxPredictions] VertexAutoMLVideoConfig maxPredictions + * @property {number|null} [boundingBoxSizeLimit] VertexAutoMLVideoConfig boundingBoxSizeLimit + */ + + /** + * Constructs a new VertexAutoMLVideoConfig. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a VertexAutoMLVideoConfig. + * @implements IVertexAutoMLVideoConfig + * @constructor + * @param {google.cloud.visionai.v1alpha1.IVertexAutoMLVideoConfig=} [properties] Properties to set + */ + function VertexAutoMLVideoConfig(properties) { + this.blockedLabels = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * VertexAutoMLVideoConfig confidenceThreshold. + * @member {number} confidenceThreshold + * @memberof google.cloud.visionai.v1alpha1.VertexAutoMLVideoConfig + * @instance + */ + VertexAutoMLVideoConfig.prototype.confidenceThreshold = 0; + + /** + * VertexAutoMLVideoConfig blockedLabels. + * @member {Array.} blockedLabels + * @memberof google.cloud.visionai.v1alpha1.VertexAutoMLVideoConfig + * @instance + */ + VertexAutoMLVideoConfig.prototype.blockedLabels = $util.emptyArray; + + /** + * VertexAutoMLVideoConfig maxPredictions. + * @member {number} maxPredictions + * @memberof google.cloud.visionai.v1alpha1.VertexAutoMLVideoConfig + * @instance + */ + VertexAutoMLVideoConfig.prototype.maxPredictions = 0; + + /** + * VertexAutoMLVideoConfig boundingBoxSizeLimit. + * @member {number} boundingBoxSizeLimit + * @memberof google.cloud.visionai.v1alpha1.VertexAutoMLVideoConfig + * @instance + */ + VertexAutoMLVideoConfig.prototype.boundingBoxSizeLimit = 0; + + /** + * Creates a new VertexAutoMLVideoConfig instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.VertexAutoMLVideoConfig + * @static + * @param {google.cloud.visionai.v1alpha1.IVertexAutoMLVideoConfig=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.VertexAutoMLVideoConfig} VertexAutoMLVideoConfig instance + */ + VertexAutoMLVideoConfig.create = function create(properties) { + return new VertexAutoMLVideoConfig(properties); + }; + + /** + * Encodes the specified VertexAutoMLVideoConfig message. Does not implicitly {@link google.cloud.visionai.v1alpha1.VertexAutoMLVideoConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.VertexAutoMLVideoConfig + * @static + * @param {google.cloud.visionai.v1alpha1.IVertexAutoMLVideoConfig} message VertexAutoMLVideoConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VertexAutoMLVideoConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.confidenceThreshold != null && Object.hasOwnProperty.call(message, "confidenceThreshold")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.confidenceThreshold); + if (message.blockedLabels != null && message.blockedLabels.length) + for (var i = 0; i < message.blockedLabels.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.blockedLabels[i]); + if (message.maxPredictions != null && Object.hasOwnProperty.call(message, "maxPredictions")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.maxPredictions); + if (message.boundingBoxSizeLimit != null && Object.hasOwnProperty.call(message, "boundingBoxSizeLimit")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.boundingBoxSizeLimit); + return writer; + }; + + /** + * Encodes the specified VertexAutoMLVideoConfig message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.VertexAutoMLVideoConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.VertexAutoMLVideoConfig + * @static + * @param {google.cloud.visionai.v1alpha1.IVertexAutoMLVideoConfig} message VertexAutoMLVideoConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VertexAutoMLVideoConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VertexAutoMLVideoConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.VertexAutoMLVideoConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.VertexAutoMLVideoConfig} VertexAutoMLVideoConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VertexAutoMLVideoConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.VertexAutoMLVideoConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.confidenceThreshold = reader.float(); + break; + } + case 2: { + if (!(message.blockedLabels && message.blockedLabels.length)) + message.blockedLabels = []; + message.blockedLabels.push(reader.string()); + break; + } + case 3: { + message.maxPredictions = reader.int32(); + break; + } + case 4: { + message.boundingBoxSizeLimit = reader.float(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a VertexAutoMLVideoConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.VertexAutoMLVideoConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.VertexAutoMLVideoConfig} VertexAutoMLVideoConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VertexAutoMLVideoConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VertexAutoMLVideoConfig message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.VertexAutoMLVideoConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VertexAutoMLVideoConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.confidenceThreshold != null && message.hasOwnProperty("confidenceThreshold")) + if (typeof message.confidenceThreshold !== "number") + return "confidenceThreshold: number expected"; + if (message.blockedLabels != null && message.hasOwnProperty("blockedLabels")) { + if (!Array.isArray(message.blockedLabels)) + return "blockedLabels: array expected"; + for (var i = 0; i < message.blockedLabels.length; ++i) + if (!$util.isString(message.blockedLabels[i])) + return "blockedLabels: string[] expected"; + } + if (message.maxPredictions != null && message.hasOwnProperty("maxPredictions")) + if (!$util.isInteger(message.maxPredictions)) + return "maxPredictions: integer expected"; + if (message.boundingBoxSizeLimit != null && message.hasOwnProperty("boundingBoxSizeLimit")) + if (typeof message.boundingBoxSizeLimit !== "number") + return "boundingBoxSizeLimit: number expected"; + return null; + }; + + /** + * Creates a VertexAutoMLVideoConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.VertexAutoMLVideoConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.VertexAutoMLVideoConfig} VertexAutoMLVideoConfig + */ + VertexAutoMLVideoConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.VertexAutoMLVideoConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.VertexAutoMLVideoConfig(); + if (object.confidenceThreshold != null) + message.confidenceThreshold = Number(object.confidenceThreshold); + if (object.blockedLabels) { + if (!Array.isArray(object.blockedLabels)) + throw TypeError(".google.cloud.visionai.v1alpha1.VertexAutoMLVideoConfig.blockedLabels: array expected"); + message.blockedLabels = []; + for (var i = 0; i < object.blockedLabels.length; ++i) + message.blockedLabels[i] = String(object.blockedLabels[i]); + } + if (object.maxPredictions != null) + message.maxPredictions = object.maxPredictions | 0; + if (object.boundingBoxSizeLimit != null) + message.boundingBoxSizeLimit = Number(object.boundingBoxSizeLimit); + return message; + }; + + /** + * Creates a plain object from a VertexAutoMLVideoConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.VertexAutoMLVideoConfig + * @static + * @param {google.cloud.visionai.v1alpha1.VertexAutoMLVideoConfig} message VertexAutoMLVideoConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VertexAutoMLVideoConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.blockedLabels = []; + if (options.defaults) { + object.confidenceThreshold = 0; + object.maxPredictions = 0; + object.boundingBoxSizeLimit = 0; + } + if (message.confidenceThreshold != null && message.hasOwnProperty("confidenceThreshold")) + object.confidenceThreshold = options.json && !isFinite(message.confidenceThreshold) ? String(message.confidenceThreshold) : message.confidenceThreshold; + if (message.blockedLabels && message.blockedLabels.length) { + object.blockedLabels = []; + for (var j = 0; j < message.blockedLabels.length; ++j) + object.blockedLabels[j] = message.blockedLabels[j]; + } + if (message.maxPredictions != null && message.hasOwnProperty("maxPredictions")) + object.maxPredictions = message.maxPredictions; + if (message.boundingBoxSizeLimit != null && message.hasOwnProperty("boundingBoxSizeLimit")) + object.boundingBoxSizeLimit = options.json && !isFinite(message.boundingBoxSizeLimit) ? String(message.boundingBoxSizeLimit) : message.boundingBoxSizeLimit; + return object; + }; + + /** + * Converts this VertexAutoMLVideoConfig to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.VertexAutoMLVideoConfig + * @instance + * @returns {Object.} JSON object + */ + VertexAutoMLVideoConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VertexAutoMLVideoConfig + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.VertexAutoMLVideoConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VertexAutoMLVideoConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.VertexAutoMLVideoConfig"; + }; + + return VertexAutoMLVideoConfig; + })(); + + v1alpha1.VertexCustomConfig = (function() { + + /** + * Properties of a VertexCustomConfig. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IVertexCustomConfig + * @property {number|null} [maxPredictionFps] VertexCustomConfig maxPredictionFps + * @property {google.cloud.visionai.v1alpha1.IDedicatedResources|null} [dedicatedResources] VertexCustomConfig dedicatedResources + * @property {string|null} [postProcessingCloudFunction] VertexCustomConfig postProcessingCloudFunction + * @property {boolean|null} [attachApplicationMetadata] VertexCustomConfig attachApplicationMetadata + */ + + /** + * Constructs a new VertexCustomConfig. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a VertexCustomConfig. + * @implements IVertexCustomConfig + * @constructor + * @param {google.cloud.visionai.v1alpha1.IVertexCustomConfig=} [properties] Properties to set + */ + function VertexCustomConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * VertexCustomConfig maxPredictionFps. + * @member {number} maxPredictionFps + * @memberof google.cloud.visionai.v1alpha1.VertexCustomConfig + * @instance + */ + VertexCustomConfig.prototype.maxPredictionFps = 0; + + /** + * VertexCustomConfig dedicatedResources. + * @member {google.cloud.visionai.v1alpha1.IDedicatedResources|null|undefined} dedicatedResources + * @memberof google.cloud.visionai.v1alpha1.VertexCustomConfig + * @instance + */ + VertexCustomConfig.prototype.dedicatedResources = null; + + /** + * VertexCustomConfig postProcessingCloudFunction. + * @member {string} postProcessingCloudFunction + * @memberof google.cloud.visionai.v1alpha1.VertexCustomConfig + * @instance + */ + VertexCustomConfig.prototype.postProcessingCloudFunction = ""; + + /** + * VertexCustomConfig attachApplicationMetadata. + * @member {boolean} attachApplicationMetadata + * @memberof google.cloud.visionai.v1alpha1.VertexCustomConfig + * @instance + */ + VertexCustomConfig.prototype.attachApplicationMetadata = false; + + /** + * Creates a new VertexCustomConfig instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.VertexCustomConfig + * @static + * @param {google.cloud.visionai.v1alpha1.IVertexCustomConfig=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.VertexCustomConfig} VertexCustomConfig instance + */ + VertexCustomConfig.create = function create(properties) { + return new VertexCustomConfig(properties); + }; + + /** + * Encodes the specified VertexCustomConfig message. Does not implicitly {@link google.cloud.visionai.v1alpha1.VertexCustomConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.VertexCustomConfig + * @static + * @param {google.cloud.visionai.v1alpha1.IVertexCustomConfig} message VertexCustomConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VertexCustomConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.maxPredictionFps != null && Object.hasOwnProperty.call(message, "maxPredictionFps")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.maxPredictionFps); + if (message.dedicatedResources != null && Object.hasOwnProperty.call(message, "dedicatedResources")) + $root.google.cloud.visionai.v1alpha1.DedicatedResources.encode(message.dedicatedResources, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.postProcessingCloudFunction != null && Object.hasOwnProperty.call(message, "postProcessingCloudFunction")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.postProcessingCloudFunction); + if (message.attachApplicationMetadata != null && Object.hasOwnProperty.call(message, "attachApplicationMetadata")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.attachApplicationMetadata); + return writer; + }; + + /** + * Encodes the specified VertexCustomConfig message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.VertexCustomConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.VertexCustomConfig + * @static + * @param {google.cloud.visionai.v1alpha1.IVertexCustomConfig} message VertexCustomConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VertexCustomConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VertexCustomConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.VertexCustomConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.VertexCustomConfig} VertexCustomConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VertexCustomConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.VertexCustomConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.maxPredictionFps = reader.int32(); + break; + } + case 2: { + message.dedicatedResources = $root.google.cloud.visionai.v1alpha1.DedicatedResources.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.postProcessingCloudFunction = reader.string(); + break; + } + case 4: { + message.attachApplicationMetadata = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a VertexCustomConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.VertexCustomConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.VertexCustomConfig} VertexCustomConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VertexCustomConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VertexCustomConfig message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.VertexCustomConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VertexCustomConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.maxPredictionFps != null && message.hasOwnProperty("maxPredictionFps")) + if (!$util.isInteger(message.maxPredictionFps)) + return "maxPredictionFps: integer expected"; + if (message.dedicatedResources != null && message.hasOwnProperty("dedicatedResources")) { + var error = $root.google.cloud.visionai.v1alpha1.DedicatedResources.verify(message.dedicatedResources, long + 1); + if (error) + return "dedicatedResources." + error; + } + if (message.postProcessingCloudFunction != null && message.hasOwnProperty("postProcessingCloudFunction")) + if (!$util.isString(message.postProcessingCloudFunction)) + return "postProcessingCloudFunction: string expected"; + if (message.attachApplicationMetadata != null && message.hasOwnProperty("attachApplicationMetadata")) + if (typeof message.attachApplicationMetadata !== "boolean") + return "attachApplicationMetadata: boolean expected"; + return null; + }; + + /** + * Creates a VertexCustomConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.VertexCustomConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.VertexCustomConfig} VertexCustomConfig + */ + VertexCustomConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.VertexCustomConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.VertexCustomConfig(); + if (object.maxPredictionFps != null) + message.maxPredictionFps = object.maxPredictionFps | 0; + if (object.dedicatedResources != null) { + if (typeof object.dedicatedResources !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.VertexCustomConfig.dedicatedResources: object expected"); + message.dedicatedResources = $root.google.cloud.visionai.v1alpha1.DedicatedResources.fromObject(object.dedicatedResources, long + 1); + } + if (object.postProcessingCloudFunction != null) + message.postProcessingCloudFunction = String(object.postProcessingCloudFunction); + if (object.attachApplicationMetadata != null) + message.attachApplicationMetadata = Boolean(object.attachApplicationMetadata); + return message; + }; + + /** + * Creates a plain object from a VertexCustomConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.VertexCustomConfig + * @static + * @param {google.cloud.visionai.v1alpha1.VertexCustomConfig} message VertexCustomConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VertexCustomConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.maxPredictionFps = 0; + object.dedicatedResources = null; + object.postProcessingCloudFunction = ""; + object.attachApplicationMetadata = false; + } + if (message.maxPredictionFps != null && message.hasOwnProperty("maxPredictionFps")) + object.maxPredictionFps = message.maxPredictionFps; + if (message.dedicatedResources != null && message.hasOwnProperty("dedicatedResources")) + object.dedicatedResources = $root.google.cloud.visionai.v1alpha1.DedicatedResources.toObject(message.dedicatedResources, options); + if (message.postProcessingCloudFunction != null && message.hasOwnProperty("postProcessingCloudFunction")) + object.postProcessingCloudFunction = message.postProcessingCloudFunction; + if (message.attachApplicationMetadata != null && message.hasOwnProperty("attachApplicationMetadata")) + object.attachApplicationMetadata = message.attachApplicationMetadata; + return object; + }; + + /** + * Converts this VertexCustomConfig to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.VertexCustomConfig + * @instance + * @returns {Object.} JSON object + */ + VertexCustomConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VertexCustomConfig + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.VertexCustomConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VertexCustomConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.VertexCustomConfig"; + }; + + return VertexCustomConfig; + })(); + + v1alpha1.MachineSpec = (function() { + + /** + * Properties of a MachineSpec. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IMachineSpec + * @property {string|null} [machineType] MachineSpec machineType + * @property {google.cloud.visionai.v1alpha1.AcceleratorType|null} [acceleratorType] MachineSpec acceleratorType + * @property {number|null} [acceleratorCount] MachineSpec acceleratorCount + */ + + /** + * Constructs a new MachineSpec. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a MachineSpec. + * @implements IMachineSpec + * @constructor + * @param {google.cloud.visionai.v1alpha1.IMachineSpec=} [properties] Properties to set + */ + function MachineSpec(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * MachineSpec machineType. + * @member {string} machineType + * @memberof google.cloud.visionai.v1alpha1.MachineSpec + * @instance + */ + MachineSpec.prototype.machineType = ""; + + /** + * MachineSpec acceleratorType. + * @member {google.cloud.visionai.v1alpha1.AcceleratorType} acceleratorType + * @memberof google.cloud.visionai.v1alpha1.MachineSpec + * @instance + */ + MachineSpec.prototype.acceleratorType = 0; + + /** + * MachineSpec acceleratorCount. + * @member {number} acceleratorCount + * @memberof google.cloud.visionai.v1alpha1.MachineSpec + * @instance + */ + MachineSpec.prototype.acceleratorCount = 0; + + /** + * Creates a new MachineSpec instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.MachineSpec + * @static + * @param {google.cloud.visionai.v1alpha1.IMachineSpec=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.MachineSpec} MachineSpec instance + */ + MachineSpec.create = function create(properties) { + return new MachineSpec(properties); + }; + + /** + * Encodes the specified MachineSpec message. Does not implicitly {@link google.cloud.visionai.v1alpha1.MachineSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.MachineSpec + * @static + * @param {google.cloud.visionai.v1alpha1.IMachineSpec} message MachineSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MachineSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.machineType); + if (message.acceleratorType != null && Object.hasOwnProperty.call(message, "acceleratorType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.acceleratorType); + if (message.acceleratorCount != null && Object.hasOwnProperty.call(message, "acceleratorCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.acceleratorCount); + return writer; + }; + + /** + * Encodes the specified MachineSpec message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.MachineSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.MachineSpec + * @static + * @param {google.cloud.visionai.v1alpha1.IMachineSpec} message MachineSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MachineSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MachineSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.MachineSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.MachineSpec} MachineSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MachineSpec.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.MachineSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.machineType = reader.string(); + break; + } + case 2: { + message.acceleratorType = reader.int32(); + break; + } + case 3: { + message.acceleratorCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a MachineSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.MachineSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.MachineSpec} MachineSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MachineSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MachineSpec message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.MachineSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MachineSpec.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.machineType != null && message.hasOwnProperty("machineType")) + if (!$util.isString(message.machineType)) + return "machineType: string expected"; + if (message.acceleratorType != null && message.hasOwnProperty("acceleratorType")) + switch (message.acceleratorType) { + default: + return "acceleratorType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 8: + case 6: + case 7: + break; + } + if (message.acceleratorCount != null && message.hasOwnProperty("acceleratorCount")) + if (!$util.isInteger(message.acceleratorCount)) + return "acceleratorCount: integer expected"; + return null; + }; + + /** + * Creates a MachineSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.MachineSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.MachineSpec} MachineSpec + */ + MachineSpec.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.MachineSpec) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.MachineSpec(); + if (object.machineType != null) + message.machineType = String(object.machineType); + switch (object.acceleratorType) { + default: + if (typeof object.acceleratorType === "number") { + message.acceleratorType = object.acceleratorType; + break; + } + break; + case "ACCELERATOR_TYPE_UNSPECIFIED": + case 0: + message.acceleratorType = 0; + break; + case "NVIDIA_TESLA_K80": + case 1: + message.acceleratorType = 1; + break; + case "NVIDIA_TESLA_P100": + case 2: + message.acceleratorType = 2; + break; + case "NVIDIA_TESLA_V100": + case 3: + message.acceleratorType = 3; + break; + case "NVIDIA_TESLA_P4": + case 4: + message.acceleratorType = 4; + break; + case "NVIDIA_TESLA_T4": + case 5: + message.acceleratorType = 5; + break; + case "NVIDIA_TESLA_A100": + case 8: + message.acceleratorType = 8; + break; + case "TPU_V2": + case 6: + message.acceleratorType = 6; + break; + case "TPU_V3": + case 7: + message.acceleratorType = 7; + break; + } + if (object.acceleratorCount != null) + message.acceleratorCount = object.acceleratorCount | 0; + return message; + }; + + /** + * Creates a plain object from a MachineSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.MachineSpec + * @static + * @param {google.cloud.visionai.v1alpha1.MachineSpec} message MachineSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MachineSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.machineType = ""; + object.acceleratorType = options.enums === String ? "ACCELERATOR_TYPE_UNSPECIFIED" : 0; + object.acceleratorCount = 0; + } + if (message.machineType != null && message.hasOwnProperty("machineType")) + object.machineType = message.machineType; + if (message.acceleratorType != null && message.hasOwnProperty("acceleratorType")) + object.acceleratorType = options.enums === String ? $root.google.cloud.visionai.v1alpha1.AcceleratorType[message.acceleratorType] === undefined ? message.acceleratorType : $root.google.cloud.visionai.v1alpha1.AcceleratorType[message.acceleratorType] : message.acceleratorType; + if (message.acceleratorCount != null && message.hasOwnProperty("acceleratorCount")) + object.acceleratorCount = message.acceleratorCount; + return object; + }; + + /** + * Converts this MachineSpec to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.MachineSpec + * @instance + * @returns {Object.} JSON object + */ + MachineSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MachineSpec + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.MachineSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MachineSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.MachineSpec"; + }; + + return MachineSpec; + })(); + + v1alpha1.AutoscalingMetricSpec = (function() { + + /** + * Properties of an AutoscalingMetricSpec. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IAutoscalingMetricSpec + * @property {string|null} [metricName] AutoscalingMetricSpec metricName + * @property {number|null} [target] AutoscalingMetricSpec target + */ + + /** + * Constructs a new AutoscalingMetricSpec. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents an AutoscalingMetricSpec. + * @implements IAutoscalingMetricSpec + * @constructor + * @param {google.cloud.visionai.v1alpha1.IAutoscalingMetricSpec=} [properties] Properties to set + */ + function AutoscalingMetricSpec(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutoscalingMetricSpec metricName. + * @member {string} metricName + * @memberof google.cloud.visionai.v1alpha1.AutoscalingMetricSpec + * @instance + */ + AutoscalingMetricSpec.prototype.metricName = ""; + + /** + * AutoscalingMetricSpec target. + * @member {number} target + * @memberof google.cloud.visionai.v1alpha1.AutoscalingMetricSpec + * @instance + */ + AutoscalingMetricSpec.prototype.target = 0; + + /** + * Creates a new AutoscalingMetricSpec instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.AutoscalingMetricSpec + * @static + * @param {google.cloud.visionai.v1alpha1.IAutoscalingMetricSpec=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.AutoscalingMetricSpec} AutoscalingMetricSpec instance + */ + AutoscalingMetricSpec.create = function create(properties) { + return new AutoscalingMetricSpec(properties); + }; + + /** + * Encodes the specified AutoscalingMetricSpec message. Does not implicitly {@link google.cloud.visionai.v1alpha1.AutoscalingMetricSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.AutoscalingMetricSpec + * @static + * @param {google.cloud.visionai.v1alpha1.IAutoscalingMetricSpec} message AutoscalingMetricSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalingMetricSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metricName != null && Object.hasOwnProperty.call(message, "metricName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.metricName); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.target); + return writer; + }; + + /** + * Encodes the specified AutoscalingMetricSpec message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.AutoscalingMetricSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.AutoscalingMetricSpec + * @static + * @param {google.cloud.visionai.v1alpha1.IAutoscalingMetricSpec} message AutoscalingMetricSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalingMetricSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutoscalingMetricSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.AutoscalingMetricSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.AutoscalingMetricSpec} AutoscalingMetricSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalingMetricSpec.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.AutoscalingMetricSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.metricName = reader.string(); + break; + } + case 2: { + message.target = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an AutoscalingMetricSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.AutoscalingMetricSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.AutoscalingMetricSpec} AutoscalingMetricSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalingMetricSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutoscalingMetricSpec message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.AutoscalingMetricSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutoscalingMetricSpec.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.metricName != null && message.hasOwnProperty("metricName")) + if (!$util.isString(message.metricName)) + return "metricName: string expected"; + if (message.target != null && message.hasOwnProperty("target")) + if (!$util.isInteger(message.target)) + return "target: integer expected"; + return null; + }; + + /** + * Creates an AutoscalingMetricSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.AutoscalingMetricSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.AutoscalingMetricSpec} AutoscalingMetricSpec + */ + AutoscalingMetricSpec.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.AutoscalingMetricSpec) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.AutoscalingMetricSpec(); + if (object.metricName != null) + message.metricName = String(object.metricName); + if (object.target != null) + message.target = object.target | 0; + return message; + }; + + /** + * Creates a plain object from an AutoscalingMetricSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.AutoscalingMetricSpec + * @static + * @param {google.cloud.visionai.v1alpha1.AutoscalingMetricSpec} message AutoscalingMetricSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutoscalingMetricSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.metricName = ""; + object.target = 0; + } + if (message.metricName != null && message.hasOwnProperty("metricName")) + object.metricName = message.metricName; + if (message.target != null && message.hasOwnProperty("target")) + object.target = message.target; + return object; + }; + + /** + * Converts this AutoscalingMetricSpec to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.AutoscalingMetricSpec + * @instance + * @returns {Object.} JSON object + */ + AutoscalingMetricSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AutoscalingMetricSpec + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.AutoscalingMetricSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AutoscalingMetricSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.AutoscalingMetricSpec"; + }; + + return AutoscalingMetricSpec; + })(); + + v1alpha1.DedicatedResources = (function() { + + /** + * Properties of a DedicatedResources. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IDedicatedResources + * @property {google.cloud.visionai.v1alpha1.IMachineSpec|null} [machineSpec] DedicatedResources machineSpec + * @property {number|null} [minReplicaCount] DedicatedResources minReplicaCount + * @property {number|null} [maxReplicaCount] DedicatedResources maxReplicaCount + * @property {Array.|null} [autoscalingMetricSpecs] DedicatedResources autoscalingMetricSpecs + */ + + /** + * Constructs a new DedicatedResources. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a DedicatedResources. + * @implements IDedicatedResources + * @constructor + * @param {google.cloud.visionai.v1alpha1.IDedicatedResources=} [properties] Properties to set + */ + function DedicatedResources(properties) { + this.autoscalingMetricSpecs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DedicatedResources machineSpec. + * @member {google.cloud.visionai.v1alpha1.IMachineSpec|null|undefined} machineSpec + * @memberof google.cloud.visionai.v1alpha1.DedicatedResources + * @instance + */ + DedicatedResources.prototype.machineSpec = null; + + /** + * DedicatedResources minReplicaCount. + * @member {number} minReplicaCount + * @memberof google.cloud.visionai.v1alpha1.DedicatedResources + * @instance + */ + DedicatedResources.prototype.minReplicaCount = 0; + + /** + * DedicatedResources maxReplicaCount. + * @member {number} maxReplicaCount + * @memberof google.cloud.visionai.v1alpha1.DedicatedResources + * @instance + */ + DedicatedResources.prototype.maxReplicaCount = 0; + + /** + * DedicatedResources autoscalingMetricSpecs. + * @member {Array.} autoscalingMetricSpecs + * @memberof google.cloud.visionai.v1alpha1.DedicatedResources + * @instance + */ + DedicatedResources.prototype.autoscalingMetricSpecs = $util.emptyArray; + + /** + * Creates a new DedicatedResources instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.DedicatedResources + * @static + * @param {google.cloud.visionai.v1alpha1.IDedicatedResources=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.DedicatedResources} DedicatedResources instance + */ + DedicatedResources.create = function create(properties) { + return new DedicatedResources(properties); + }; + + /** + * Encodes the specified DedicatedResources message. Does not implicitly {@link google.cloud.visionai.v1alpha1.DedicatedResources.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.DedicatedResources + * @static + * @param {google.cloud.visionai.v1alpha1.IDedicatedResources} message DedicatedResources message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DedicatedResources.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.machineSpec != null && Object.hasOwnProperty.call(message, "machineSpec")) + $root.google.cloud.visionai.v1alpha1.MachineSpec.encode(message.machineSpec, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.minReplicaCount != null && Object.hasOwnProperty.call(message, "minReplicaCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.minReplicaCount); + if (message.maxReplicaCount != null && Object.hasOwnProperty.call(message, "maxReplicaCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.maxReplicaCount); + if (message.autoscalingMetricSpecs != null && message.autoscalingMetricSpecs.length) + for (var i = 0; i < message.autoscalingMetricSpecs.length; ++i) + $root.google.cloud.visionai.v1alpha1.AutoscalingMetricSpec.encode(message.autoscalingMetricSpecs[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DedicatedResources message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.DedicatedResources.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.DedicatedResources + * @static + * @param {google.cloud.visionai.v1alpha1.IDedicatedResources} message DedicatedResources message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DedicatedResources.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DedicatedResources message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.DedicatedResources + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.DedicatedResources} DedicatedResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DedicatedResources.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.DedicatedResources(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.machineSpec = $root.google.cloud.visionai.v1alpha1.MachineSpec.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.minReplicaCount = reader.int32(); + break; + } + case 3: { + message.maxReplicaCount = reader.int32(); + break; + } + case 4: { + if (!(message.autoscalingMetricSpecs && message.autoscalingMetricSpecs.length)) + message.autoscalingMetricSpecs = []; + message.autoscalingMetricSpecs.push($root.google.cloud.visionai.v1alpha1.AutoscalingMetricSpec.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DedicatedResources message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.DedicatedResources + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.DedicatedResources} DedicatedResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DedicatedResources.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DedicatedResources message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.DedicatedResources + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DedicatedResources.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.machineSpec != null && message.hasOwnProperty("machineSpec")) { + var error = $root.google.cloud.visionai.v1alpha1.MachineSpec.verify(message.machineSpec, long + 1); + if (error) + return "machineSpec." + error; + } + if (message.minReplicaCount != null && message.hasOwnProperty("minReplicaCount")) + if (!$util.isInteger(message.minReplicaCount)) + return "minReplicaCount: integer expected"; + if (message.maxReplicaCount != null && message.hasOwnProperty("maxReplicaCount")) + if (!$util.isInteger(message.maxReplicaCount)) + return "maxReplicaCount: integer expected"; + if (message.autoscalingMetricSpecs != null && message.hasOwnProperty("autoscalingMetricSpecs")) { + if (!Array.isArray(message.autoscalingMetricSpecs)) + return "autoscalingMetricSpecs: array expected"; + for (var i = 0; i < message.autoscalingMetricSpecs.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.AutoscalingMetricSpec.verify(message.autoscalingMetricSpecs[i], long + 1); + if (error) + return "autoscalingMetricSpecs." + error; + } + } + return null; + }; + + /** + * Creates a DedicatedResources message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.DedicatedResources + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.DedicatedResources} DedicatedResources + */ + DedicatedResources.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.DedicatedResources) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.DedicatedResources(); + if (object.machineSpec != null) { + if (typeof object.machineSpec !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.DedicatedResources.machineSpec: object expected"); + message.machineSpec = $root.google.cloud.visionai.v1alpha1.MachineSpec.fromObject(object.machineSpec, long + 1); + } + if (object.minReplicaCount != null) + message.minReplicaCount = object.minReplicaCount | 0; + if (object.maxReplicaCount != null) + message.maxReplicaCount = object.maxReplicaCount | 0; + if (object.autoscalingMetricSpecs) { + if (!Array.isArray(object.autoscalingMetricSpecs)) + throw TypeError(".google.cloud.visionai.v1alpha1.DedicatedResources.autoscalingMetricSpecs: array expected"); + message.autoscalingMetricSpecs = []; + for (var i = 0; i < object.autoscalingMetricSpecs.length; ++i) { + if (typeof object.autoscalingMetricSpecs[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.DedicatedResources.autoscalingMetricSpecs: object expected"); + message.autoscalingMetricSpecs[i] = $root.google.cloud.visionai.v1alpha1.AutoscalingMetricSpec.fromObject(object.autoscalingMetricSpecs[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a DedicatedResources message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.DedicatedResources + * @static + * @param {google.cloud.visionai.v1alpha1.DedicatedResources} message DedicatedResources + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DedicatedResources.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.autoscalingMetricSpecs = []; + if (options.defaults) { + object.machineSpec = null; + object.minReplicaCount = 0; + object.maxReplicaCount = 0; + } + if (message.machineSpec != null && message.hasOwnProperty("machineSpec")) + object.machineSpec = $root.google.cloud.visionai.v1alpha1.MachineSpec.toObject(message.machineSpec, options); + if (message.minReplicaCount != null && message.hasOwnProperty("minReplicaCount")) + object.minReplicaCount = message.minReplicaCount; + if (message.maxReplicaCount != null && message.hasOwnProperty("maxReplicaCount")) + object.maxReplicaCount = message.maxReplicaCount; + if (message.autoscalingMetricSpecs && message.autoscalingMetricSpecs.length) { + object.autoscalingMetricSpecs = []; + for (var j = 0; j < message.autoscalingMetricSpecs.length; ++j) + object.autoscalingMetricSpecs[j] = $root.google.cloud.visionai.v1alpha1.AutoscalingMetricSpec.toObject(message.autoscalingMetricSpecs[j], options); + } + return object; + }; + + /** + * Converts this DedicatedResources to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.DedicatedResources + * @instance + * @returns {Object.} JSON object + */ + DedicatedResources.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DedicatedResources + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.DedicatedResources + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DedicatedResources.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.DedicatedResources"; + }; + + return DedicatedResources; + })(); + + v1alpha1.GstreamerBufferDescriptor = (function() { + + /** + * Properties of a GstreamerBufferDescriptor. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IGstreamerBufferDescriptor + * @property {string|null} [capsString] GstreamerBufferDescriptor capsString + * @property {boolean|null} [isKeyFrame] GstreamerBufferDescriptor isKeyFrame + * @property {google.protobuf.ITimestamp|null} [ptsTime] GstreamerBufferDescriptor ptsTime + * @property {google.protobuf.ITimestamp|null} [dtsTime] GstreamerBufferDescriptor dtsTime + * @property {google.protobuf.IDuration|null} [duration] GstreamerBufferDescriptor duration + */ + + /** + * Constructs a new GstreamerBufferDescriptor. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a GstreamerBufferDescriptor. + * @implements IGstreamerBufferDescriptor + * @constructor + * @param {google.cloud.visionai.v1alpha1.IGstreamerBufferDescriptor=} [properties] Properties to set + */ + function GstreamerBufferDescriptor(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GstreamerBufferDescriptor capsString. + * @member {string} capsString + * @memberof google.cloud.visionai.v1alpha1.GstreamerBufferDescriptor + * @instance + */ + GstreamerBufferDescriptor.prototype.capsString = ""; + + /** + * GstreamerBufferDescriptor isKeyFrame. + * @member {boolean} isKeyFrame + * @memberof google.cloud.visionai.v1alpha1.GstreamerBufferDescriptor + * @instance + */ + GstreamerBufferDescriptor.prototype.isKeyFrame = false; + + /** + * GstreamerBufferDescriptor ptsTime. + * @member {google.protobuf.ITimestamp|null|undefined} ptsTime + * @memberof google.cloud.visionai.v1alpha1.GstreamerBufferDescriptor + * @instance + */ + GstreamerBufferDescriptor.prototype.ptsTime = null; + + /** + * GstreamerBufferDescriptor dtsTime. + * @member {google.protobuf.ITimestamp|null|undefined} dtsTime + * @memberof google.cloud.visionai.v1alpha1.GstreamerBufferDescriptor + * @instance + */ + GstreamerBufferDescriptor.prototype.dtsTime = null; + + /** + * GstreamerBufferDescriptor duration. + * @member {google.protobuf.IDuration|null|undefined} duration + * @memberof google.cloud.visionai.v1alpha1.GstreamerBufferDescriptor + * @instance + */ + GstreamerBufferDescriptor.prototype.duration = null; + + /** + * Creates a new GstreamerBufferDescriptor instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.GstreamerBufferDescriptor + * @static + * @param {google.cloud.visionai.v1alpha1.IGstreamerBufferDescriptor=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.GstreamerBufferDescriptor} GstreamerBufferDescriptor instance + */ + GstreamerBufferDescriptor.create = function create(properties) { + return new GstreamerBufferDescriptor(properties); + }; + + /** + * Encodes the specified GstreamerBufferDescriptor message. Does not implicitly {@link google.cloud.visionai.v1alpha1.GstreamerBufferDescriptor.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.GstreamerBufferDescriptor + * @static + * @param {google.cloud.visionai.v1alpha1.IGstreamerBufferDescriptor} message GstreamerBufferDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GstreamerBufferDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.capsString != null && Object.hasOwnProperty.call(message, "capsString")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.capsString); + if (message.isKeyFrame != null && Object.hasOwnProperty.call(message, "isKeyFrame")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isKeyFrame); + if (message.ptsTime != null && Object.hasOwnProperty.call(message, "ptsTime")) + $root.google.protobuf.Timestamp.encode(message.ptsTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.dtsTime != null && Object.hasOwnProperty.call(message, "dtsTime")) + $root.google.protobuf.Timestamp.encode(message.dtsTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) + $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GstreamerBufferDescriptor message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.GstreamerBufferDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.GstreamerBufferDescriptor + * @static + * @param {google.cloud.visionai.v1alpha1.IGstreamerBufferDescriptor} message GstreamerBufferDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GstreamerBufferDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GstreamerBufferDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.GstreamerBufferDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.GstreamerBufferDescriptor} GstreamerBufferDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GstreamerBufferDescriptor.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.GstreamerBufferDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.capsString = reader.string(); + break; + } + case 2: { + message.isKeyFrame = reader.bool(); + break; + } + case 3: { + message.ptsTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.dtsTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GstreamerBufferDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.GstreamerBufferDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.GstreamerBufferDescriptor} GstreamerBufferDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GstreamerBufferDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GstreamerBufferDescriptor message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.GstreamerBufferDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GstreamerBufferDescriptor.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.capsString != null && message.hasOwnProperty("capsString")) + if (!$util.isString(message.capsString)) + return "capsString: string expected"; + if (message.isKeyFrame != null && message.hasOwnProperty("isKeyFrame")) + if (typeof message.isKeyFrame !== "boolean") + return "isKeyFrame: boolean expected"; + if (message.ptsTime != null && message.hasOwnProperty("ptsTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.ptsTime, long + 1); + if (error) + return "ptsTime." + error; + } + if (message.dtsTime != null && message.hasOwnProperty("dtsTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.dtsTime, long + 1); + if (error) + return "dtsTime." + error; + } + if (message.duration != null && message.hasOwnProperty("duration")) { + var error = $root.google.protobuf.Duration.verify(message.duration, long + 1); + if (error) + return "duration." + error; + } + return null; + }; + + /** + * Creates a GstreamerBufferDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.GstreamerBufferDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.GstreamerBufferDescriptor} GstreamerBufferDescriptor + */ + GstreamerBufferDescriptor.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.GstreamerBufferDescriptor) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.GstreamerBufferDescriptor(); + if (object.capsString != null) + message.capsString = String(object.capsString); + if (object.isKeyFrame != null) + message.isKeyFrame = Boolean(object.isKeyFrame); + if (object.ptsTime != null) { + if (typeof object.ptsTime !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.GstreamerBufferDescriptor.ptsTime: object expected"); + message.ptsTime = $root.google.protobuf.Timestamp.fromObject(object.ptsTime, long + 1); + } + if (object.dtsTime != null) { + if (typeof object.dtsTime !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.GstreamerBufferDescriptor.dtsTime: object expected"); + message.dtsTime = $root.google.protobuf.Timestamp.fromObject(object.dtsTime, long + 1); + } + if (object.duration != null) { + if (typeof object.duration !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.GstreamerBufferDescriptor.duration: object expected"); + message.duration = $root.google.protobuf.Duration.fromObject(object.duration, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a GstreamerBufferDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.GstreamerBufferDescriptor + * @static + * @param {google.cloud.visionai.v1alpha1.GstreamerBufferDescriptor} message GstreamerBufferDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GstreamerBufferDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.capsString = ""; + object.isKeyFrame = false; + object.ptsTime = null; + object.dtsTime = null; + object.duration = null; + } + if (message.capsString != null && message.hasOwnProperty("capsString")) + object.capsString = message.capsString; + if (message.isKeyFrame != null && message.hasOwnProperty("isKeyFrame")) + object.isKeyFrame = message.isKeyFrame; + if (message.ptsTime != null && message.hasOwnProperty("ptsTime")) + object.ptsTime = $root.google.protobuf.Timestamp.toObject(message.ptsTime, options); + if (message.dtsTime != null && message.hasOwnProperty("dtsTime")) + object.dtsTime = $root.google.protobuf.Timestamp.toObject(message.dtsTime, options); + if (message.duration != null && message.hasOwnProperty("duration")) + object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); + return object; + }; + + /** + * Converts this GstreamerBufferDescriptor to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.GstreamerBufferDescriptor + * @instance + * @returns {Object.} JSON object + */ + GstreamerBufferDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GstreamerBufferDescriptor + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.GstreamerBufferDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GstreamerBufferDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.GstreamerBufferDescriptor"; + }; + + return GstreamerBufferDescriptor; + })(); + + v1alpha1.RawImageDescriptor = (function() { + + /** + * Properties of a RawImageDescriptor. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IRawImageDescriptor + * @property {string|null} [format] RawImageDescriptor format + * @property {number|null} [height] RawImageDescriptor height + * @property {number|null} [width] RawImageDescriptor width + */ + + /** + * Constructs a new RawImageDescriptor. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a RawImageDescriptor. + * @implements IRawImageDescriptor + * @constructor + * @param {google.cloud.visionai.v1alpha1.IRawImageDescriptor=} [properties] Properties to set + */ + function RawImageDescriptor(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * RawImageDescriptor format. + * @member {string} format + * @memberof google.cloud.visionai.v1alpha1.RawImageDescriptor + * @instance + */ + RawImageDescriptor.prototype.format = ""; + + /** + * RawImageDescriptor height. + * @member {number} height + * @memberof google.cloud.visionai.v1alpha1.RawImageDescriptor + * @instance + */ + RawImageDescriptor.prototype.height = 0; + + /** + * RawImageDescriptor width. + * @member {number} width + * @memberof google.cloud.visionai.v1alpha1.RawImageDescriptor + * @instance + */ + RawImageDescriptor.prototype.width = 0; + + /** + * Creates a new RawImageDescriptor instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.RawImageDescriptor + * @static + * @param {google.cloud.visionai.v1alpha1.IRawImageDescriptor=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.RawImageDescriptor} RawImageDescriptor instance + */ + RawImageDescriptor.create = function create(properties) { + return new RawImageDescriptor(properties); + }; + + /** + * Encodes the specified RawImageDescriptor message. Does not implicitly {@link google.cloud.visionai.v1alpha1.RawImageDescriptor.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.RawImageDescriptor + * @static + * @param {google.cloud.visionai.v1alpha1.IRawImageDescriptor} message RawImageDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RawImageDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.format != null && Object.hasOwnProperty.call(message, "format")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.format); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.height); + if (message.width != null && Object.hasOwnProperty.call(message, "width")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.width); + return writer; + }; + + /** + * Encodes the specified RawImageDescriptor message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.RawImageDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.RawImageDescriptor + * @static + * @param {google.cloud.visionai.v1alpha1.IRawImageDescriptor} message RawImageDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RawImageDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RawImageDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.RawImageDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.RawImageDescriptor} RawImageDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RawImageDescriptor.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.RawImageDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.format = reader.string(); + break; + } + case 2: { + message.height = reader.int32(); + break; + } + case 3: { + message.width = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a RawImageDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.RawImageDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.RawImageDescriptor} RawImageDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RawImageDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RawImageDescriptor message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.RawImageDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RawImageDescriptor.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.format != null && message.hasOwnProperty("format")) + if (!$util.isString(message.format)) + return "format: string expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height)) + return "height: integer expected"; + if (message.width != null && message.hasOwnProperty("width")) + if (!$util.isInteger(message.width)) + return "width: integer expected"; + return null; + }; + + /** + * Creates a RawImageDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.RawImageDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.RawImageDescriptor} RawImageDescriptor + */ + RawImageDescriptor.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.RawImageDescriptor) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.RawImageDescriptor(); + if (object.format != null) + message.format = String(object.format); + if (object.height != null) + message.height = object.height | 0; + if (object.width != null) + message.width = object.width | 0; + return message; + }; + + /** + * Creates a plain object from a RawImageDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.RawImageDescriptor + * @static + * @param {google.cloud.visionai.v1alpha1.RawImageDescriptor} message RawImageDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RawImageDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.format = ""; + object.height = 0; + object.width = 0; + } + if (message.format != null && message.hasOwnProperty("format")) + object.format = message.format; + if (message.height != null && message.hasOwnProperty("height")) + object.height = message.height; + if (message.width != null && message.hasOwnProperty("width")) + object.width = message.width; + return object; + }; + + /** + * Converts this RawImageDescriptor to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.RawImageDescriptor + * @instance + * @returns {Object.} JSON object + */ + RawImageDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RawImageDescriptor + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.RawImageDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RawImageDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.RawImageDescriptor"; + }; + + return RawImageDescriptor; + })(); + + v1alpha1.PacketType = (function() { + + /** + * Properties of a PacketType. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IPacketType + * @property {string|null} [typeClass] PacketType typeClass + * @property {google.cloud.visionai.v1alpha1.PacketType.ITypeDescriptor|null} [typeDescriptor] PacketType typeDescriptor + */ + + /** + * Constructs a new PacketType. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a PacketType. + * @implements IPacketType + * @constructor + * @param {google.cloud.visionai.v1alpha1.IPacketType=} [properties] Properties to set + */ + function PacketType(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PacketType typeClass. + * @member {string} typeClass + * @memberof google.cloud.visionai.v1alpha1.PacketType + * @instance + */ + PacketType.prototype.typeClass = ""; + + /** + * PacketType typeDescriptor. + * @member {google.cloud.visionai.v1alpha1.PacketType.ITypeDescriptor|null|undefined} typeDescriptor + * @memberof google.cloud.visionai.v1alpha1.PacketType + * @instance + */ + PacketType.prototype.typeDescriptor = null; + + /** + * Creates a new PacketType instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.PacketType + * @static + * @param {google.cloud.visionai.v1alpha1.IPacketType=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.PacketType} PacketType instance + */ + PacketType.create = function create(properties) { + return new PacketType(properties); + }; + + /** + * Encodes the specified PacketType message. Does not implicitly {@link google.cloud.visionai.v1alpha1.PacketType.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.PacketType + * @static + * @param {google.cloud.visionai.v1alpha1.IPacketType} message PacketType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PacketType.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.typeClass != null && Object.hasOwnProperty.call(message, "typeClass")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.typeClass); + if (message.typeDescriptor != null && Object.hasOwnProperty.call(message, "typeDescriptor")) + $root.google.cloud.visionai.v1alpha1.PacketType.TypeDescriptor.encode(message.typeDescriptor, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PacketType message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.PacketType.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.PacketType + * @static + * @param {google.cloud.visionai.v1alpha1.IPacketType} message PacketType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PacketType.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PacketType message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.PacketType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.PacketType} PacketType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PacketType.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.PacketType(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.typeClass = reader.string(); + break; + } + case 2: { + message.typeDescriptor = $root.google.cloud.visionai.v1alpha1.PacketType.TypeDescriptor.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PacketType message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.PacketType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.PacketType} PacketType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PacketType.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PacketType message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.PacketType + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PacketType.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.typeClass != null && message.hasOwnProperty("typeClass")) + if (!$util.isString(message.typeClass)) + return "typeClass: string expected"; + if (message.typeDescriptor != null && message.hasOwnProperty("typeDescriptor")) { + var error = $root.google.cloud.visionai.v1alpha1.PacketType.TypeDescriptor.verify(message.typeDescriptor, long + 1); + if (error) + return "typeDescriptor." + error; + } + return null; + }; + + /** + * Creates a PacketType message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.PacketType + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.PacketType} PacketType + */ + PacketType.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.PacketType) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.PacketType(); + if (object.typeClass != null) + message.typeClass = String(object.typeClass); + if (object.typeDescriptor != null) { + if (typeof object.typeDescriptor !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.PacketType.typeDescriptor: object expected"); + message.typeDescriptor = $root.google.cloud.visionai.v1alpha1.PacketType.TypeDescriptor.fromObject(object.typeDescriptor, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a PacketType message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.PacketType + * @static + * @param {google.cloud.visionai.v1alpha1.PacketType} message PacketType + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PacketType.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.typeClass = ""; + object.typeDescriptor = null; + } + if (message.typeClass != null && message.hasOwnProperty("typeClass")) + object.typeClass = message.typeClass; + if (message.typeDescriptor != null && message.hasOwnProperty("typeDescriptor")) + object.typeDescriptor = $root.google.cloud.visionai.v1alpha1.PacketType.TypeDescriptor.toObject(message.typeDescriptor, options); + return object; + }; + + /** + * Converts this PacketType to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.PacketType + * @instance + * @returns {Object.} JSON object + */ + PacketType.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PacketType + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.PacketType + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PacketType.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.PacketType"; + }; + + PacketType.TypeDescriptor = (function() { + + /** + * Properties of a TypeDescriptor. + * @memberof google.cloud.visionai.v1alpha1.PacketType + * @interface ITypeDescriptor + * @property {google.cloud.visionai.v1alpha1.IGstreamerBufferDescriptor|null} [gstreamerBufferDescriptor] TypeDescriptor gstreamerBufferDescriptor + * @property {google.cloud.visionai.v1alpha1.IRawImageDescriptor|null} [rawImageDescriptor] TypeDescriptor rawImageDescriptor + * @property {string|null} [type] TypeDescriptor type + */ + + /** + * Constructs a new TypeDescriptor. + * @memberof google.cloud.visionai.v1alpha1.PacketType + * @classdesc Represents a TypeDescriptor. + * @implements ITypeDescriptor + * @constructor + * @param {google.cloud.visionai.v1alpha1.PacketType.ITypeDescriptor=} [properties] Properties to set + */ + function TypeDescriptor(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TypeDescriptor gstreamerBufferDescriptor. + * @member {google.cloud.visionai.v1alpha1.IGstreamerBufferDescriptor|null|undefined} gstreamerBufferDescriptor + * @memberof google.cloud.visionai.v1alpha1.PacketType.TypeDescriptor + * @instance + */ + TypeDescriptor.prototype.gstreamerBufferDescriptor = null; + + /** + * TypeDescriptor rawImageDescriptor. + * @member {google.cloud.visionai.v1alpha1.IRawImageDescriptor|null|undefined} rawImageDescriptor + * @memberof google.cloud.visionai.v1alpha1.PacketType.TypeDescriptor + * @instance + */ + TypeDescriptor.prototype.rawImageDescriptor = null; + + /** + * TypeDescriptor type. + * @member {string} type + * @memberof google.cloud.visionai.v1alpha1.PacketType.TypeDescriptor + * @instance + */ + TypeDescriptor.prototype.type = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TypeDescriptor typeDetails. + * @member {"gstreamerBufferDescriptor"|"rawImageDescriptor"|undefined} typeDetails + * @memberof google.cloud.visionai.v1alpha1.PacketType.TypeDescriptor + * @instance + */ + Object.defineProperty(TypeDescriptor.prototype, "typeDetails", { + get: $util.oneOfGetter($oneOfFields = ["gstreamerBufferDescriptor", "rawImageDescriptor"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TypeDescriptor instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.PacketType.TypeDescriptor + * @static + * @param {google.cloud.visionai.v1alpha1.PacketType.ITypeDescriptor=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.PacketType.TypeDescriptor} TypeDescriptor instance + */ + TypeDescriptor.create = function create(properties) { + return new TypeDescriptor(properties); + }; + + /** + * Encodes the specified TypeDescriptor message. Does not implicitly {@link google.cloud.visionai.v1alpha1.PacketType.TypeDescriptor.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.PacketType.TypeDescriptor + * @static + * @param {google.cloud.visionai.v1alpha1.PacketType.ITypeDescriptor} message TypeDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TypeDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.gstreamerBufferDescriptor != null && Object.hasOwnProperty.call(message, "gstreamerBufferDescriptor")) + $root.google.cloud.visionai.v1alpha1.GstreamerBufferDescriptor.encode(message.gstreamerBufferDescriptor, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.rawImageDescriptor != null && Object.hasOwnProperty.call(message, "rawImageDescriptor")) + $root.google.cloud.visionai.v1alpha1.RawImageDescriptor.encode(message.rawImageDescriptor, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TypeDescriptor message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.PacketType.TypeDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.PacketType.TypeDescriptor + * @static + * @param {google.cloud.visionai.v1alpha1.PacketType.ITypeDescriptor} message TypeDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TypeDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TypeDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.PacketType.TypeDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.PacketType.TypeDescriptor} TypeDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TypeDescriptor.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.PacketType.TypeDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.gstreamerBufferDescriptor = $root.google.cloud.visionai.v1alpha1.GstreamerBufferDescriptor.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.rawImageDescriptor = $root.google.cloud.visionai.v1alpha1.RawImageDescriptor.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 1: { + message.type = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TypeDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.PacketType.TypeDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.PacketType.TypeDescriptor} TypeDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TypeDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TypeDescriptor message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.PacketType.TypeDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TypeDescriptor.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.gstreamerBufferDescriptor != null && message.hasOwnProperty("gstreamerBufferDescriptor")) { + properties.typeDetails = 1; + { + var error = $root.google.cloud.visionai.v1alpha1.GstreamerBufferDescriptor.verify(message.gstreamerBufferDescriptor, long + 1); + if (error) + return "gstreamerBufferDescriptor." + error; + } + } + if (message.rawImageDescriptor != null && message.hasOwnProperty("rawImageDescriptor")) { + if (properties.typeDetails === 1) + return "typeDetails: multiple values"; + properties.typeDetails = 1; + { + var error = $root.google.cloud.visionai.v1alpha1.RawImageDescriptor.verify(message.rawImageDescriptor, long + 1); + if (error) + return "rawImageDescriptor." + error; + } + } + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + return null; + }; + + /** + * Creates a TypeDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.PacketType.TypeDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.PacketType.TypeDescriptor} TypeDescriptor + */ + TypeDescriptor.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.PacketType.TypeDescriptor) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.PacketType.TypeDescriptor(); + if (object.gstreamerBufferDescriptor != null) { + if (typeof object.gstreamerBufferDescriptor !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.PacketType.TypeDescriptor.gstreamerBufferDescriptor: object expected"); + message.gstreamerBufferDescriptor = $root.google.cloud.visionai.v1alpha1.GstreamerBufferDescriptor.fromObject(object.gstreamerBufferDescriptor, long + 1); + } + if (object.rawImageDescriptor != null) { + if (typeof object.rawImageDescriptor !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.PacketType.TypeDescriptor.rawImageDescriptor: object expected"); + message.rawImageDescriptor = $root.google.cloud.visionai.v1alpha1.RawImageDescriptor.fromObject(object.rawImageDescriptor, long + 1); + } + if (object.type != null) + message.type = String(object.type); + return message; + }; + + /** + * Creates a plain object from a TypeDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.PacketType.TypeDescriptor + * @static + * @param {google.cloud.visionai.v1alpha1.PacketType.TypeDescriptor} message TypeDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TypeDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.type = ""; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.gstreamerBufferDescriptor != null && message.hasOwnProperty("gstreamerBufferDescriptor")) { + object.gstreamerBufferDescriptor = $root.google.cloud.visionai.v1alpha1.GstreamerBufferDescriptor.toObject(message.gstreamerBufferDescriptor, options); + if (options.oneofs) + object.typeDetails = "gstreamerBufferDescriptor"; + } + if (message.rawImageDescriptor != null && message.hasOwnProperty("rawImageDescriptor")) { + object.rawImageDescriptor = $root.google.cloud.visionai.v1alpha1.RawImageDescriptor.toObject(message.rawImageDescriptor, options); + if (options.oneofs) + object.typeDetails = "rawImageDescriptor"; + } + return object; + }; + + /** + * Converts this TypeDescriptor to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.PacketType.TypeDescriptor + * @instance + * @returns {Object.} JSON object + */ + TypeDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TypeDescriptor + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.PacketType.TypeDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TypeDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.PacketType.TypeDescriptor"; + }; + + return TypeDescriptor; + })(); + + return PacketType; + })(); + + v1alpha1.ServerMetadata = (function() { + + /** + * Properties of a ServerMetadata. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IServerMetadata + * @property {number|Long|null} [offset] ServerMetadata offset + * @property {google.protobuf.ITimestamp|null} [ingestTime] ServerMetadata ingestTime + */ + + /** + * Constructs a new ServerMetadata. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a ServerMetadata. + * @implements IServerMetadata + * @constructor + * @param {google.cloud.visionai.v1alpha1.IServerMetadata=} [properties] Properties to set + */ + function ServerMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServerMetadata offset. + * @member {number|Long} offset + * @memberof google.cloud.visionai.v1alpha1.ServerMetadata + * @instance + */ + ServerMetadata.prototype.offset = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ServerMetadata ingestTime. + * @member {google.protobuf.ITimestamp|null|undefined} ingestTime + * @memberof google.cloud.visionai.v1alpha1.ServerMetadata + * @instance + */ + ServerMetadata.prototype.ingestTime = null; + + /** + * Creates a new ServerMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ServerMetadata + * @static + * @param {google.cloud.visionai.v1alpha1.IServerMetadata=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ServerMetadata} ServerMetadata instance + */ + ServerMetadata.create = function create(properties) { + return new ServerMetadata(properties); + }; + + /** + * Encodes the specified ServerMetadata message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ServerMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ServerMetadata + * @static + * @param {google.cloud.visionai.v1alpha1.IServerMetadata} message ServerMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServerMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.offset); + if (message.ingestTime != null && Object.hasOwnProperty.call(message, "ingestTime")) + $root.google.protobuf.Timestamp.encode(message.ingestTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServerMetadata message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ServerMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ServerMetadata + * @static + * @param {google.cloud.visionai.v1alpha1.IServerMetadata} message ServerMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServerMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServerMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ServerMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ServerMetadata} ServerMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServerMetadata.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ServerMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.offset = reader.int64(); + break; + } + case 2: { + message.ingestTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ServerMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ServerMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ServerMetadata} ServerMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServerMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServerMetadata message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ServerMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServerMetadata.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.offset != null && message.hasOwnProperty("offset")) + if (!$util.isInteger(message.offset) && !(message.offset && $util.isInteger(message.offset.low) && $util.isInteger(message.offset.high))) + return "offset: integer|Long expected"; + if (message.ingestTime != null && message.hasOwnProperty("ingestTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.ingestTime, long + 1); + if (error) + return "ingestTime." + error; + } + return null; + }; + + /** + * Creates a ServerMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ServerMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ServerMetadata} ServerMetadata + */ + ServerMetadata.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ServerMetadata) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ServerMetadata(); + if (object.offset != null) + if ($util.Long) + (message.offset = $util.Long.fromValue(object.offset)).unsigned = false; + else if (typeof object.offset === "string") + message.offset = parseInt(object.offset, 10); + else if (typeof object.offset === "number") + message.offset = object.offset; + else if (typeof object.offset === "object") + message.offset = new $util.LongBits(object.offset.low >>> 0, object.offset.high >>> 0).toNumber(); + if (object.ingestTime != null) { + if (typeof object.ingestTime !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ServerMetadata.ingestTime: object expected"); + message.ingestTime = $root.google.protobuf.Timestamp.fromObject(object.ingestTime, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a ServerMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ServerMetadata + * @static + * @param {google.cloud.visionai.v1alpha1.ServerMetadata} message ServerMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServerMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.offset = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.offset = options.longs === String ? "0" : 0; + object.ingestTime = null; + } + if (message.offset != null && message.hasOwnProperty("offset")) + if (typeof message.offset === "number") + object.offset = options.longs === String ? String(message.offset) : message.offset; + else + object.offset = options.longs === String ? $util.Long.prototype.toString.call(message.offset) : options.longs === Number ? new $util.LongBits(message.offset.low >>> 0, message.offset.high >>> 0).toNumber() : message.offset; + if (message.ingestTime != null && message.hasOwnProperty("ingestTime")) + object.ingestTime = $root.google.protobuf.Timestamp.toObject(message.ingestTime, options); + return object; + }; + + /** + * Converts this ServerMetadata to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ServerMetadata + * @instance + * @returns {Object.} JSON object + */ + ServerMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServerMetadata + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ServerMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServerMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ServerMetadata"; + }; + + return ServerMetadata; + })(); + + v1alpha1.SeriesMetadata = (function() { + + /** + * Properties of a SeriesMetadata. + * @memberof google.cloud.visionai.v1alpha1 + * @interface ISeriesMetadata + * @property {string|null} [series] SeriesMetadata series + */ + + /** + * Constructs a new SeriesMetadata. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a SeriesMetadata. + * @implements ISeriesMetadata + * @constructor + * @param {google.cloud.visionai.v1alpha1.ISeriesMetadata=} [properties] Properties to set + */ + function SeriesMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SeriesMetadata series. + * @member {string} series + * @memberof google.cloud.visionai.v1alpha1.SeriesMetadata + * @instance + */ + SeriesMetadata.prototype.series = ""; + + /** + * Creates a new SeriesMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.SeriesMetadata + * @static + * @param {google.cloud.visionai.v1alpha1.ISeriesMetadata=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.SeriesMetadata} SeriesMetadata instance + */ + SeriesMetadata.create = function create(properties) { + return new SeriesMetadata(properties); + }; + + /** + * Encodes the specified SeriesMetadata message. Does not implicitly {@link google.cloud.visionai.v1alpha1.SeriesMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.SeriesMetadata + * @static + * @param {google.cloud.visionai.v1alpha1.ISeriesMetadata} message SeriesMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SeriesMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.series != null && Object.hasOwnProperty.call(message, "series")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.series); + return writer; + }; + + /** + * Encodes the specified SeriesMetadata message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.SeriesMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.SeriesMetadata + * @static + * @param {google.cloud.visionai.v1alpha1.ISeriesMetadata} message SeriesMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SeriesMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SeriesMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.SeriesMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.SeriesMetadata} SeriesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SeriesMetadata.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.SeriesMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.series = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SeriesMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.SeriesMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.SeriesMetadata} SeriesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SeriesMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SeriesMetadata message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.SeriesMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SeriesMetadata.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.series != null && message.hasOwnProperty("series")) + if (!$util.isString(message.series)) + return "series: string expected"; + return null; + }; + + /** + * Creates a SeriesMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.SeriesMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.SeriesMetadata} SeriesMetadata + */ + SeriesMetadata.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.SeriesMetadata) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.SeriesMetadata(); + if (object.series != null) + message.series = String(object.series); + return message; + }; + + /** + * Creates a plain object from a SeriesMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.SeriesMetadata + * @static + * @param {google.cloud.visionai.v1alpha1.SeriesMetadata} message SeriesMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SeriesMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.series = ""; + if (message.series != null && message.hasOwnProperty("series")) + object.series = message.series; + return object; + }; + + /** + * Converts this SeriesMetadata to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.SeriesMetadata + * @instance + * @returns {Object.} JSON object + */ + SeriesMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SeriesMetadata + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.SeriesMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SeriesMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.SeriesMetadata"; + }; + + return SeriesMetadata; + })(); + + v1alpha1.PacketHeader = (function() { + + /** + * Properties of a PacketHeader. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IPacketHeader + * @property {google.protobuf.ITimestamp|null} [captureTime] PacketHeader captureTime + * @property {google.cloud.visionai.v1alpha1.IPacketType|null} [type] PacketHeader type + * @property {google.protobuf.IStruct|null} [metadata] PacketHeader metadata + * @property {google.cloud.visionai.v1alpha1.IServerMetadata|null} [serverMetadata] PacketHeader serverMetadata + * @property {google.cloud.visionai.v1alpha1.ISeriesMetadata|null} [seriesMetadata] PacketHeader seriesMetadata + * @property {number|null} [flags] PacketHeader flags + * @property {string|null} [traceContext] PacketHeader traceContext + */ + + /** + * Constructs a new PacketHeader. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a PacketHeader. + * @implements IPacketHeader + * @constructor + * @param {google.cloud.visionai.v1alpha1.IPacketHeader=} [properties] Properties to set + */ + function PacketHeader(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PacketHeader captureTime. + * @member {google.protobuf.ITimestamp|null|undefined} captureTime + * @memberof google.cloud.visionai.v1alpha1.PacketHeader + * @instance + */ + PacketHeader.prototype.captureTime = null; + + /** + * PacketHeader type. + * @member {google.cloud.visionai.v1alpha1.IPacketType|null|undefined} type + * @memberof google.cloud.visionai.v1alpha1.PacketHeader + * @instance + */ + PacketHeader.prototype.type = null; + + /** + * PacketHeader metadata. + * @member {google.protobuf.IStruct|null|undefined} metadata + * @memberof google.cloud.visionai.v1alpha1.PacketHeader + * @instance + */ + PacketHeader.prototype.metadata = null; + + /** + * PacketHeader serverMetadata. + * @member {google.cloud.visionai.v1alpha1.IServerMetadata|null|undefined} serverMetadata + * @memberof google.cloud.visionai.v1alpha1.PacketHeader + * @instance + */ + PacketHeader.prototype.serverMetadata = null; + + /** + * PacketHeader seriesMetadata. + * @member {google.cloud.visionai.v1alpha1.ISeriesMetadata|null|undefined} seriesMetadata + * @memberof google.cloud.visionai.v1alpha1.PacketHeader + * @instance + */ + PacketHeader.prototype.seriesMetadata = null; + + /** + * PacketHeader flags. + * @member {number} flags + * @memberof google.cloud.visionai.v1alpha1.PacketHeader + * @instance + */ + PacketHeader.prototype.flags = 0; + + /** + * PacketHeader traceContext. + * @member {string} traceContext + * @memberof google.cloud.visionai.v1alpha1.PacketHeader + * @instance + */ + PacketHeader.prototype.traceContext = ""; + + /** + * Creates a new PacketHeader instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.PacketHeader + * @static + * @param {google.cloud.visionai.v1alpha1.IPacketHeader=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.PacketHeader} PacketHeader instance + */ + PacketHeader.create = function create(properties) { + return new PacketHeader(properties); + }; + + /** + * Encodes the specified PacketHeader message. Does not implicitly {@link google.cloud.visionai.v1alpha1.PacketHeader.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.PacketHeader + * @static + * @param {google.cloud.visionai.v1alpha1.IPacketHeader} message PacketHeader message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PacketHeader.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.captureTime != null && Object.hasOwnProperty.call(message, "captureTime")) + $root.google.protobuf.Timestamp.encode(message.captureTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + $root.google.cloud.visionai.v1alpha1.PacketType.encode(message.type, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Struct.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.serverMetadata != null && Object.hasOwnProperty.call(message, "serverMetadata")) + $root.google.cloud.visionai.v1alpha1.ServerMetadata.encode(message.serverMetadata, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.seriesMetadata != null && Object.hasOwnProperty.call(message, "seriesMetadata")) + $root.google.cloud.visionai.v1alpha1.SeriesMetadata.encode(message.seriesMetadata, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.flags != null && Object.hasOwnProperty.call(message, "flags")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.flags); + if (message.traceContext != null && Object.hasOwnProperty.call(message, "traceContext")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.traceContext); + return writer; + }; + + /** + * Encodes the specified PacketHeader message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.PacketHeader.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.PacketHeader + * @static + * @param {google.cloud.visionai.v1alpha1.IPacketHeader} message PacketHeader message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PacketHeader.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PacketHeader message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.PacketHeader + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.PacketHeader} PacketHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PacketHeader.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.PacketHeader(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.captureTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.type = $root.google.cloud.visionai.v1alpha1.PacketType.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.metadata = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.serverMetadata = $root.google.cloud.visionai.v1alpha1.ServerMetadata.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.seriesMetadata = $root.google.cloud.visionai.v1alpha1.SeriesMetadata.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.flags = reader.int32(); + break; + } + case 7: { + message.traceContext = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PacketHeader message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.PacketHeader + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.PacketHeader} PacketHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PacketHeader.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PacketHeader message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.PacketHeader + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PacketHeader.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.captureTime != null && message.hasOwnProperty("captureTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.captureTime, long + 1); + if (error) + return "captureTime." + error; + } + if (message.type != null && message.hasOwnProperty("type")) { + var error = $root.google.cloud.visionai.v1alpha1.PacketType.verify(message.type, long + 1); + if (error) + return "type." + error; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Struct.verify(message.metadata, long + 1); + if (error) + return "metadata." + error; + } + if (message.serverMetadata != null && message.hasOwnProperty("serverMetadata")) { + var error = $root.google.cloud.visionai.v1alpha1.ServerMetadata.verify(message.serverMetadata, long + 1); + if (error) + return "serverMetadata." + error; + } + if (message.seriesMetadata != null && message.hasOwnProperty("seriesMetadata")) { + var error = $root.google.cloud.visionai.v1alpha1.SeriesMetadata.verify(message.seriesMetadata, long + 1); + if (error) + return "seriesMetadata." + error; + } + if (message.flags != null && message.hasOwnProperty("flags")) + if (!$util.isInteger(message.flags)) + return "flags: integer expected"; + if (message.traceContext != null && message.hasOwnProperty("traceContext")) + if (!$util.isString(message.traceContext)) + return "traceContext: string expected"; + return null; + }; + + /** + * Creates a PacketHeader message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.PacketHeader + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.PacketHeader} PacketHeader + */ + PacketHeader.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.PacketHeader) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.PacketHeader(); + if (object.captureTime != null) { + if (typeof object.captureTime !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.PacketHeader.captureTime: object expected"); + message.captureTime = $root.google.protobuf.Timestamp.fromObject(object.captureTime, long + 1); + } + if (object.type != null) { + if (typeof object.type !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.PacketHeader.type: object expected"); + message.type = $root.google.cloud.visionai.v1alpha1.PacketType.fromObject(object.type, long + 1); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.PacketHeader.metadata: object expected"); + message.metadata = $root.google.protobuf.Struct.fromObject(object.metadata, long + 1); + } + if (object.serverMetadata != null) { + if (typeof object.serverMetadata !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.PacketHeader.serverMetadata: object expected"); + message.serverMetadata = $root.google.cloud.visionai.v1alpha1.ServerMetadata.fromObject(object.serverMetadata, long + 1); + } + if (object.seriesMetadata != null) { + if (typeof object.seriesMetadata !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.PacketHeader.seriesMetadata: object expected"); + message.seriesMetadata = $root.google.cloud.visionai.v1alpha1.SeriesMetadata.fromObject(object.seriesMetadata, long + 1); + } + if (object.flags != null) + message.flags = object.flags | 0; + if (object.traceContext != null) + message.traceContext = String(object.traceContext); + return message; + }; + + /** + * Creates a plain object from a PacketHeader message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.PacketHeader + * @static + * @param {google.cloud.visionai.v1alpha1.PacketHeader} message PacketHeader + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PacketHeader.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.captureTime = null; + object.type = null; + object.metadata = null; + object.serverMetadata = null; + object.seriesMetadata = null; + object.flags = 0; + object.traceContext = ""; + } + if (message.captureTime != null && message.hasOwnProperty("captureTime")) + object.captureTime = $root.google.protobuf.Timestamp.toObject(message.captureTime, options); + if (message.type != null && message.hasOwnProperty("type")) + object.type = $root.google.cloud.visionai.v1alpha1.PacketType.toObject(message.type, options); + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Struct.toObject(message.metadata, options); + if (message.serverMetadata != null && message.hasOwnProperty("serverMetadata")) + object.serverMetadata = $root.google.cloud.visionai.v1alpha1.ServerMetadata.toObject(message.serverMetadata, options); + if (message.seriesMetadata != null && message.hasOwnProperty("seriesMetadata")) + object.seriesMetadata = $root.google.cloud.visionai.v1alpha1.SeriesMetadata.toObject(message.seriesMetadata, options); + if (message.flags != null && message.hasOwnProperty("flags")) + object.flags = message.flags; + if (message.traceContext != null && message.hasOwnProperty("traceContext")) + object.traceContext = message.traceContext; + return object; + }; + + /** + * Converts this PacketHeader to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.PacketHeader + * @instance + * @returns {Object.} JSON object + */ + PacketHeader.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PacketHeader + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.PacketHeader + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PacketHeader.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.PacketHeader"; + }; + + return PacketHeader; + })(); + + v1alpha1.Packet = (function() { + + /** + * Properties of a Packet. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IPacket + * @property {google.cloud.visionai.v1alpha1.IPacketHeader|null} [header] Packet header + * @property {Uint8Array|null} [payload] Packet payload + */ + + /** + * Constructs a new Packet. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a Packet. + * @implements IPacket + * @constructor + * @param {google.cloud.visionai.v1alpha1.IPacket=} [properties] Properties to set + */ + function Packet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Packet header. + * @member {google.cloud.visionai.v1alpha1.IPacketHeader|null|undefined} header + * @memberof google.cloud.visionai.v1alpha1.Packet + * @instance + */ + Packet.prototype.header = null; + + /** + * Packet payload. + * @member {Uint8Array} payload + * @memberof google.cloud.visionai.v1alpha1.Packet + * @instance + */ + Packet.prototype.payload = $util.newBuffer([]); + + /** + * Creates a new Packet instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.Packet + * @static + * @param {google.cloud.visionai.v1alpha1.IPacket=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.Packet} Packet instance + */ + Packet.create = function create(properties) { + return new Packet(properties); + }; + + /** + * Encodes the specified Packet message. Does not implicitly {@link google.cloud.visionai.v1alpha1.Packet.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.Packet + * @static + * @param {google.cloud.visionai.v1alpha1.IPacket} message Packet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Packet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.header != null && Object.hasOwnProperty.call(message, "header")) + $root.google.cloud.visionai.v1alpha1.PacketHeader.encode(message.header, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.payload); + return writer; + }; + + /** + * Encodes the specified Packet message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.Packet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.Packet + * @static + * @param {google.cloud.visionai.v1alpha1.IPacket} message Packet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Packet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Packet message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.Packet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.Packet} Packet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Packet.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.Packet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.header = $root.google.cloud.visionai.v1alpha1.PacketHeader.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.payload = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Packet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.Packet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.Packet} Packet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Packet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Packet message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.Packet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Packet.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.header != null && message.hasOwnProperty("header")) { + var error = $root.google.cloud.visionai.v1alpha1.PacketHeader.verify(message.header, long + 1); + if (error) + return "header." + error; + } + if (message.payload != null && message.hasOwnProperty("payload")) + if (!(message.payload && typeof message.payload.length === "number" || $util.isString(message.payload))) + return "payload: buffer expected"; + return null; + }; + + /** + * Creates a Packet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.Packet + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.Packet} Packet + */ + Packet.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.Packet) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.Packet(); + if (object.header != null) { + if (typeof object.header !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Packet.header: object expected"); + message.header = $root.google.cloud.visionai.v1alpha1.PacketHeader.fromObject(object.header, long + 1); + } + if (object.payload != null) + if (typeof object.payload === "string") + $util.base64.decode(object.payload, message.payload = $util.newBuffer($util.base64.length(object.payload)), 0); + else if (object.payload.length >= 0) + message.payload = object.payload; + return message; + }; + + /** + * Creates a plain object from a Packet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.Packet + * @static + * @param {google.cloud.visionai.v1alpha1.Packet} message Packet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Packet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.header = null; + if (options.bytes === String) + object.payload = ""; + else { + object.payload = []; + if (options.bytes !== Array) + object.payload = $util.newBuffer(object.payload); + } + } + if (message.header != null && message.hasOwnProperty("header")) + object.header = $root.google.cloud.visionai.v1alpha1.PacketHeader.toObject(message.header, options); + if (message.payload != null && message.hasOwnProperty("payload")) + object.payload = options.bytes === String ? $util.base64.encode(message.payload, 0, message.payload.length) : options.bytes === Array ? Array.prototype.slice.call(message.payload) : message.payload; + return object; + }; + + /** + * Converts this Packet to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.Packet + * @instance + * @returns {Object.} JSON object + */ + Packet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Packet + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.Packet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Packet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.Packet"; + }; + + return Packet; + })(); + + v1alpha1.StreamingService = (function() { + + /** + * Constructs a new StreamingService service. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a StreamingService + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function StreamingService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (StreamingService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = StreamingService; + + /** + * Creates new StreamingService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.visionai.v1alpha1.StreamingService + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {StreamingService} RPC service. Useful where requests and/or responses are streamed. + */ + StreamingService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.StreamingService|sendPackets}. + * @memberof google.cloud.visionai.v1alpha1.StreamingService + * @typedef SendPacketsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.visionai.v1alpha1.SendPacketsResponse} [response] SendPacketsResponse + */ + + /** + * Calls SendPackets. + * @function sendPackets + * @memberof google.cloud.visionai.v1alpha1.StreamingService + * @instance + * @param {google.cloud.visionai.v1alpha1.ISendPacketsRequest} request SendPacketsRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.StreamingService.SendPacketsCallback} callback Node-style callback called with the error, if any, and SendPacketsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StreamingService.prototype.sendPackets = function sendPackets(request, callback) { + return this.rpcCall(sendPackets, $root.google.cloud.visionai.v1alpha1.SendPacketsRequest, $root.google.cloud.visionai.v1alpha1.SendPacketsResponse, request, callback); + }, "name", { value: "SendPackets" }); + + /** + * Calls SendPackets. + * @function sendPackets + * @memberof google.cloud.visionai.v1alpha1.StreamingService + * @instance + * @param {google.cloud.visionai.v1alpha1.ISendPacketsRequest} request SendPacketsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.StreamingService|receivePackets}. + * @memberof google.cloud.visionai.v1alpha1.StreamingService + * @typedef ReceivePacketsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.visionai.v1alpha1.ReceivePacketsResponse} [response] ReceivePacketsResponse + */ + + /** + * Calls ReceivePackets. + * @function receivePackets + * @memberof google.cloud.visionai.v1alpha1.StreamingService + * @instance + * @param {google.cloud.visionai.v1alpha1.IReceivePacketsRequest} request ReceivePacketsRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.StreamingService.ReceivePacketsCallback} callback Node-style callback called with the error, if any, and ReceivePacketsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StreamingService.prototype.receivePackets = function receivePackets(request, callback) { + return this.rpcCall(receivePackets, $root.google.cloud.visionai.v1alpha1.ReceivePacketsRequest, $root.google.cloud.visionai.v1alpha1.ReceivePacketsResponse, request, callback); + }, "name", { value: "ReceivePackets" }); + + /** + * Calls ReceivePackets. + * @function receivePackets + * @memberof google.cloud.visionai.v1alpha1.StreamingService + * @instance + * @param {google.cloud.visionai.v1alpha1.IReceivePacketsRequest} request ReceivePacketsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.StreamingService|receiveEvents}. + * @memberof google.cloud.visionai.v1alpha1.StreamingService + * @typedef ReceiveEventsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.visionai.v1alpha1.ReceiveEventsResponse} [response] ReceiveEventsResponse + */ + + /** + * Calls ReceiveEvents. + * @function receiveEvents + * @memberof google.cloud.visionai.v1alpha1.StreamingService + * @instance + * @param {google.cloud.visionai.v1alpha1.IReceiveEventsRequest} request ReceiveEventsRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.StreamingService.ReceiveEventsCallback} callback Node-style callback called with the error, if any, and ReceiveEventsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StreamingService.prototype.receiveEvents = function receiveEvents(request, callback) { + return this.rpcCall(receiveEvents, $root.google.cloud.visionai.v1alpha1.ReceiveEventsRequest, $root.google.cloud.visionai.v1alpha1.ReceiveEventsResponse, request, callback); + }, "name", { value: "ReceiveEvents" }); + + /** + * Calls ReceiveEvents. + * @function receiveEvents + * @memberof google.cloud.visionai.v1alpha1.StreamingService + * @instance + * @param {google.cloud.visionai.v1alpha1.IReceiveEventsRequest} request ReceiveEventsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.StreamingService|acquireLease}. + * @memberof google.cloud.visionai.v1alpha1.StreamingService + * @typedef AcquireLeaseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.visionai.v1alpha1.Lease} [response] Lease + */ + + /** + * Calls AcquireLease. + * @function acquireLease + * @memberof google.cloud.visionai.v1alpha1.StreamingService + * @instance + * @param {google.cloud.visionai.v1alpha1.IAcquireLeaseRequest} request AcquireLeaseRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.StreamingService.AcquireLeaseCallback} callback Node-style callback called with the error, if any, and Lease + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StreamingService.prototype.acquireLease = function acquireLease(request, callback) { + return this.rpcCall(acquireLease, $root.google.cloud.visionai.v1alpha1.AcquireLeaseRequest, $root.google.cloud.visionai.v1alpha1.Lease, request, callback); + }, "name", { value: "AcquireLease" }); + + /** + * Calls AcquireLease. + * @function acquireLease + * @memberof google.cloud.visionai.v1alpha1.StreamingService + * @instance + * @param {google.cloud.visionai.v1alpha1.IAcquireLeaseRequest} request AcquireLeaseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.StreamingService|renewLease}. + * @memberof google.cloud.visionai.v1alpha1.StreamingService + * @typedef RenewLeaseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.visionai.v1alpha1.Lease} [response] Lease + */ + + /** + * Calls RenewLease. + * @function renewLease + * @memberof google.cloud.visionai.v1alpha1.StreamingService + * @instance + * @param {google.cloud.visionai.v1alpha1.IRenewLeaseRequest} request RenewLeaseRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.StreamingService.RenewLeaseCallback} callback Node-style callback called with the error, if any, and Lease + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StreamingService.prototype.renewLease = function renewLease(request, callback) { + return this.rpcCall(renewLease, $root.google.cloud.visionai.v1alpha1.RenewLeaseRequest, $root.google.cloud.visionai.v1alpha1.Lease, request, callback); + }, "name", { value: "RenewLease" }); + + /** + * Calls RenewLease. + * @function renewLease + * @memberof google.cloud.visionai.v1alpha1.StreamingService + * @instance + * @param {google.cloud.visionai.v1alpha1.IRenewLeaseRequest} request RenewLeaseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.StreamingService|releaseLease}. + * @memberof google.cloud.visionai.v1alpha1.StreamingService + * @typedef ReleaseLeaseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.visionai.v1alpha1.ReleaseLeaseResponse} [response] ReleaseLeaseResponse + */ + + /** + * Calls ReleaseLease. + * @function releaseLease + * @memberof google.cloud.visionai.v1alpha1.StreamingService + * @instance + * @param {google.cloud.visionai.v1alpha1.IReleaseLeaseRequest} request ReleaseLeaseRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.StreamingService.ReleaseLeaseCallback} callback Node-style callback called with the error, if any, and ReleaseLeaseResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StreamingService.prototype.releaseLease = function releaseLease(request, callback) { + return this.rpcCall(releaseLease, $root.google.cloud.visionai.v1alpha1.ReleaseLeaseRequest, $root.google.cloud.visionai.v1alpha1.ReleaseLeaseResponse, request, callback); + }, "name", { value: "ReleaseLease" }); + + /** + * Calls ReleaseLease. + * @function releaseLease + * @memberof google.cloud.visionai.v1alpha1.StreamingService + * @instance + * @param {google.cloud.visionai.v1alpha1.IReleaseLeaseRequest} request ReleaseLeaseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return StreamingService; + })(); + + /** + * LeaseType enum. + * @name google.cloud.visionai.v1alpha1.LeaseType + * @enum {number} + * @property {number} LEASE_TYPE_UNSPECIFIED=0 LEASE_TYPE_UNSPECIFIED value + * @property {number} LEASE_TYPE_READER=1 LEASE_TYPE_READER value + * @property {number} LEASE_TYPE_WRITER=2 LEASE_TYPE_WRITER value + */ + v1alpha1.LeaseType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LEASE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "LEASE_TYPE_READER"] = 1; + values[valuesById[2] = "LEASE_TYPE_WRITER"] = 2; + return values; + })(); + + v1alpha1.ReceiveEventsRequest = (function() { + + /** + * Properties of a ReceiveEventsRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IReceiveEventsRequest + * @property {google.cloud.visionai.v1alpha1.ReceiveEventsRequest.ISetupRequest|null} [setupRequest] ReceiveEventsRequest setupRequest + * @property {google.cloud.visionai.v1alpha1.ICommitRequest|null} [commitRequest] ReceiveEventsRequest commitRequest + */ + + /** + * Constructs a new ReceiveEventsRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a ReceiveEventsRequest. + * @implements IReceiveEventsRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IReceiveEventsRequest=} [properties] Properties to set + */ + function ReceiveEventsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReceiveEventsRequest setupRequest. + * @member {google.cloud.visionai.v1alpha1.ReceiveEventsRequest.ISetupRequest|null|undefined} setupRequest + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsRequest + * @instance + */ + ReceiveEventsRequest.prototype.setupRequest = null; + + /** + * ReceiveEventsRequest commitRequest. + * @member {google.cloud.visionai.v1alpha1.ICommitRequest|null|undefined} commitRequest + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsRequest + * @instance + */ + ReceiveEventsRequest.prototype.commitRequest = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ReceiveEventsRequest request. + * @member {"setupRequest"|"commitRequest"|undefined} request + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsRequest + * @instance + */ + Object.defineProperty(ReceiveEventsRequest.prototype, "request", { + get: $util.oneOfGetter($oneOfFields = ["setupRequest", "commitRequest"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ReceiveEventsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IReceiveEventsRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ReceiveEventsRequest} ReceiveEventsRequest instance + */ + ReceiveEventsRequest.create = function create(properties) { + return new ReceiveEventsRequest(properties); + }; + + /** + * Encodes the specified ReceiveEventsRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ReceiveEventsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IReceiveEventsRequest} message ReceiveEventsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReceiveEventsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.setupRequest != null && Object.hasOwnProperty.call(message, "setupRequest")) + $root.google.cloud.visionai.v1alpha1.ReceiveEventsRequest.SetupRequest.encode(message.setupRequest, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.commitRequest != null && Object.hasOwnProperty.call(message, "commitRequest")) + $root.google.cloud.visionai.v1alpha1.CommitRequest.encode(message.commitRequest, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReceiveEventsRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ReceiveEventsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IReceiveEventsRequest} message ReceiveEventsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReceiveEventsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReceiveEventsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ReceiveEventsRequest} ReceiveEventsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReceiveEventsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ReceiveEventsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.setupRequest = $root.google.cloud.visionai.v1alpha1.ReceiveEventsRequest.SetupRequest.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.commitRequest = $root.google.cloud.visionai.v1alpha1.CommitRequest.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ReceiveEventsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ReceiveEventsRequest} ReceiveEventsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReceiveEventsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReceiveEventsRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReceiveEventsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.setupRequest != null && message.hasOwnProperty("setupRequest")) { + properties.request = 1; + { + var error = $root.google.cloud.visionai.v1alpha1.ReceiveEventsRequest.SetupRequest.verify(message.setupRequest, long + 1); + if (error) + return "setupRequest." + error; + } + } + if (message.commitRequest != null && message.hasOwnProperty("commitRequest")) { + if (properties.request === 1) + return "request: multiple values"; + properties.request = 1; + { + var error = $root.google.cloud.visionai.v1alpha1.CommitRequest.verify(message.commitRequest, long + 1); + if (error) + return "commitRequest." + error; + } + } + return null; + }; + + /** + * Creates a ReceiveEventsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ReceiveEventsRequest} ReceiveEventsRequest + */ + ReceiveEventsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ReceiveEventsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ReceiveEventsRequest(); + if (object.setupRequest != null) { + if (typeof object.setupRequest !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ReceiveEventsRequest.setupRequest: object expected"); + message.setupRequest = $root.google.cloud.visionai.v1alpha1.ReceiveEventsRequest.SetupRequest.fromObject(object.setupRequest, long + 1); + } + if (object.commitRequest != null) { + if (typeof object.commitRequest !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ReceiveEventsRequest.commitRequest: object expected"); + message.commitRequest = $root.google.cloud.visionai.v1alpha1.CommitRequest.fromObject(object.commitRequest, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a ReceiveEventsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ReceiveEventsRequest} message ReceiveEventsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReceiveEventsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.setupRequest != null && message.hasOwnProperty("setupRequest")) { + object.setupRequest = $root.google.cloud.visionai.v1alpha1.ReceiveEventsRequest.SetupRequest.toObject(message.setupRequest, options); + if (options.oneofs) + object.request = "setupRequest"; + } + if (message.commitRequest != null && message.hasOwnProperty("commitRequest")) { + object.commitRequest = $root.google.cloud.visionai.v1alpha1.CommitRequest.toObject(message.commitRequest, options); + if (options.oneofs) + object.request = "commitRequest"; + } + return object; + }; + + /** + * Converts this ReceiveEventsRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsRequest + * @instance + * @returns {Object.} JSON object + */ + ReceiveEventsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReceiveEventsRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReceiveEventsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ReceiveEventsRequest"; + }; + + ReceiveEventsRequest.SetupRequest = (function() { + + /** + * Properties of a SetupRequest. + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsRequest + * @interface ISetupRequest + * @property {string|null} [cluster] SetupRequest cluster + * @property {string|null} [stream] SetupRequest stream + * @property {string|null} [receiver] SetupRequest receiver + * @property {google.cloud.visionai.v1alpha1.IControlledMode|null} [controlledMode] SetupRequest controlledMode + * @property {google.protobuf.IDuration|null} [heartbeatInterval] SetupRequest heartbeatInterval + * @property {google.protobuf.IDuration|null} [writesDoneGracePeriod] SetupRequest writesDoneGracePeriod + */ + + /** + * Constructs a new SetupRequest. + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsRequest + * @classdesc Represents a SetupRequest. + * @implements ISetupRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.ReceiveEventsRequest.ISetupRequest=} [properties] Properties to set + */ + function SetupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetupRequest cluster. + * @member {string} cluster + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsRequest.SetupRequest + * @instance + */ + SetupRequest.prototype.cluster = ""; + + /** + * SetupRequest stream. + * @member {string} stream + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsRequest.SetupRequest + * @instance + */ + SetupRequest.prototype.stream = ""; + + /** + * SetupRequest receiver. + * @member {string} receiver + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsRequest.SetupRequest + * @instance + */ + SetupRequest.prototype.receiver = ""; + + /** + * SetupRequest controlledMode. + * @member {google.cloud.visionai.v1alpha1.IControlledMode|null|undefined} controlledMode + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsRequest.SetupRequest + * @instance + */ + SetupRequest.prototype.controlledMode = null; + + /** + * SetupRequest heartbeatInterval. + * @member {google.protobuf.IDuration|null|undefined} heartbeatInterval + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsRequest.SetupRequest + * @instance + */ + SetupRequest.prototype.heartbeatInterval = null; + + /** + * SetupRequest writesDoneGracePeriod. + * @member {google.protobuf.IDuration|null|undefined} writesDoneGracePeriod + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsRequest.SetupRequest + * @instance + */ + SetupRequest.prototype.writesDoneGracePeriod = null; + + /** + * Creates a new SetupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsRequest.SetupRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ReceiveEventsRequest.ISetupRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ReceiveEventsRequest.SetupRequest} SetupRequest instance + */ + SetupRequest.create = function create(properties) { + return new SetupRequest(properties); + }; + + /** + * Encodes the specified SetupRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ReceiveEventsRequest.SetupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsRequest.SetupRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ReceiveEventsRequest.ISetupRequest} message SetupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.cluster); + if (message.stream != null && Object.hasOwnProperty.call(message, "stream")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.stream); + if (message.receiver != null && Object.hasOwnProperty.call(message, "receiver")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.receiver); + if (message.controlledMode != null && Object.hasOwnProperty.call(message, "controlledMode")) + $root.google.cloud.visionai.v1alpha1.ControlledMode.encode(message.controlledMode, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.heartbeatInterval != null && Object.hasOwnProperty.call(message, "heartbeatInterval")) + $root.google.protobuf.Duration.encode(message.heartbeatInterval, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.writesDoneGracePeriod != null && Object.hasOwnProperty.call(message, "writesDoneGracePeriod")) + $root.google.protobuf.Duration.encode(message.writesDoneGracePeriod, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetupRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ReceiveEventsRequest.SetupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsRequest.SetupRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ReceiveEventsRequest.ISetupRequest} message SetupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsRequest.SetupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ReceiveEventsRequest.SetupRequest} SetupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetupRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ReceiveEventsRequest.SetupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.cluster = reader.string(); + break; + } + case 2: { + message.stream = reader.string(); + break; + } + case 3: { + message.receiver = reader.string(); + break; + } + case 4: { + message.controlledMode = $root.google.cloud.visionai.v1alpha1.ControlledMode.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.heartbeatInterval = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.writesDoneGracePeriod = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SetupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsRequest.SetupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ReceiveEventsRequest.SetupRequest} SetupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetupRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsRequest.SetupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetupRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.cluster != null && message.hasOwnProperty("cluster")) + if (!$util.isString(message.cluster)) + return "cluster: string expected"; + if (message.stream != null && message.hasOwnProperty("stream")) + if (!$util.isString(message.stream)) + return "stream: string expected"; + if (message.receiver != null && message.hasOwnProperty("receiver")) + if (!$util.isString(message.receiver)) + return "receiver: string expected"; + if (message.controlledMode != null && message.hasOwnProperty("controlledMode")) { + var error = $root.google.cloud.visionai.v1alpha1.ControlledMode.verify(message.controlledMode, long + 1); + if (error) + return "controlledMode." + error; + } + if (message.heartbeatInterval != null && message.hasOwnProperty("heartbeatInterval")) { + var error = $root.google.protobuf.Duration.verify(message.heartbeatInterval, long + 1); + if (error) + return "heartbeatInterval." + error; + } + if (message.writesDoneGracePeriod != null && message.hasOwnProperty("writesDoneGracePeriod")) { + var error = $root.google.protobuf.Duration.verify(message.writesDoneGracePeriod, long + 1); + if (error) + return "writesDoneGracePeriod." + error; + } + return null; + }; + + /** + * Creates a SetupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsRequest.SetupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ReceiveEventsRequest.SetupRequest} SetupRequest + */ + SetupRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ReceiveEventsRequest.SetupRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ReceiveEventsRequest.SetupRequest(); + if (object.cluster != null) + message.cluster = String(object.cluster); + if (object.stream != null) + message.stream = String(object.stream); + if (object.receiver != null) + message.receiver = String(object.receiver); + if (object.controlledMode != null) { + if (typeof object.controlledMode !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ReceiveEventsRequest.SetupRequest.controlledMode: object expected"); + message.controlledMode = $root.google.cloud.visionai.v1alpha1.ControlledMode.fromObject(object.controlledMode, long + 1); + } + if (object.heartbeatInterval != null) { + if (typeof object.heartbeatInterval !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ReceiveEventsRequest.SetupRequest.heartbeatInterval: object expected"); + message.heartbeatInterval = $root.google.protobuf.Duration.fromObject(object.heartbeatInterval, long + 1); + } + if (object.writesDoneGracePeriod != null) { + if (typeof object.writesDoneGracePeriod !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ReceiveEventsRequest.SetupRequest.writesDoneGracePeriod: object expected"); + message.writesDoneGracePeriod = $root.google.protobuf.Duration.fromObject(object.writesDoneGracePeriod, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a SetupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsRequest.SetupRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ReceiveEventsRequest.SetupRequest} message SetupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.cluster = ""; + object.stream = ""; + object.receiver = ""; + object.controlledMode = null; + object.heartbeatInterval = null; + object.writesDoneGracePeriod = null; + } + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = message.cluster; + if (message.stream != null && message.hasOwnProperty("stream")) + object.stream = message.stream; + if (message.receiver != null && message.hasOwnProperty("receiver")) + object.receiver = message.receiver; + if (message.controlledMode != null && message.hasOwnProperty("controlledMode")) + object.controlledMode = $root.google.cloud.visionai.v1alpha1.ControlledMode.toObject(message.controlledMode, options); + if (message.heartbeatInterval != null && message.hasOwnProperty("heartbeatInterval")) + object.heartbeatInterval = $root.google.protobuf.Duration.toObject(message.heartbeatInterval, options); + if (message.writesDoneGracePeriod != null && message.hasOwnProperty("writesDoneGracePeriod")) + object.writesDoneGracePeriod = $root.google.protobuf.Duration.toObject(message.writesDoneGracePeriod, options); + return object; + }; + + /** + * Converts this SetupRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsRequest.SetupRequest + * @instance + * @returns {Object.} JSON object + */ + SetupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SetupRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsRequest.SetupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SetupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ReceiveEventsRequest.SetupRequest"; + }; + + return SetupRequest; + })(); + + return ReceiveEventsRequest; + })(); + + v1alpha1.EventUpdate = (function() { + + /** + * Properties of an EventUpdate. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IEventUpdate + * @property {string|null} [stream] EventUpdate stream + * @property {string|null} [event] EventUpdate event + * @property {string|null} [series] EventUpdate series + * @property {google.protobuf.ITimestamp|null} [updateTime] EventUpdate updateTime + * @property {number|Long|null} [offset] EventUpdate offset + */ + + /** + * Constructs a new EventUpdate. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents an EventUpdate. + * @implements IEventUpdate + * @constructor + * @param {google.cloud.visionai.v1alpha1.IEventUpdate=} [properties] Properties to set + */ + function EventUpdate(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * EventUpdate stream. + * @member {string} stream + * @memberof google.cloud.visionai.v1alpha1.EventUpdate + * @instance + */ + EventUpdate.prototype.stream = ""; + + /** + * EventUpdate event. + * @member {string} event + * @memberof google.cloud.visionai.v1alpha1.EventUpdate + * @instance + */ + EventUpdate.prototype.event = ""; + + /** + * EventUpdate series. + * @member {string} series + * @memberof google.cloud.visionai.v1alpha1.EventUpdate + * @instance + */ + EventUpdate.prototype.series = ""; + + /** + * EventUpdate updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.visionai.v1alpha1.EventUpdate + * @instance + */ + EventUpdate.prototype.updateTime = null; + + /** + * EventUpdate offset. + * @member {number|Long} offset + * @memberof google.cloud.visionai.v1alpha1.EventUpdate + * @instance + */ + EventUpdate.prototype.offset = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new EventUpdate instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.EventUpdate + * @static + * @param {google.cloud.visionai.v1alpha1.IEventUpdate=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.EventUpdate} EventUpdate instance + */ + EventUpdate.create = function create(properties) { + return new EventUpdate(properties); + }; + + /** + * Encodes the specified EventUpdate message. Does not implicitly {@link google.cloud.visionai.v1alpha1.EventUpdate.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.EventUpdate + * @static + * @param {google.cloud.visionai.v1alpha1.IEventUpdate} message EventUpdate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EventUpdate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stream != null && Object.hasOwnProperty.call(message, "stream")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.stream); + if (message.event != null && Object.hasOwnProperty.call(message, "event")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.event); + if (message.series != null && Object.hasOwnProperty.call(message, "series")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.series); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.offset); + return writer; + }; + + /** + * Encodes the specified EventUpdate message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.EventUpdate.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.EventUpdate + * @static + * @param {google.cloud.visionai.v1alpha1.IEventUpdate} message EventUpdate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EventUpdate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EventUpdate message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.EventUpdate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.EventUpdate} EventUpdate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EventUpdate.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.EventUpdate(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.stream = reader.string(); + break; + } + case 2: { + message.event = reader.string(); + break; + } + case 3: { + message.series = reader.string(); + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.offset = reader.int64(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an EventUpdate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.EventUpdate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.EventUpdate} EventUpdate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EventUpdate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EventUpdate message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.EventUpdate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EventUpdate.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.stream != null && message.hasOwnProperty("stream")) + if (!$util.isString(message.stream)) + return "stream: string expected"; + if (message.event != null && message.hasOwnProperty("event")) + if (!$util.isString(message.event)) + return "event: string expected"; + if (message.series != null && message.hasOwnProperty("series")) + if (!$util.isString(message.series)) + return "series: string expected"; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime, long + 1); + if (error) + return "updateTime." + error; + } + if (message.offset != null && message.hasOwnProperty("offset")) + if (!$util.isInteger(message.offset) && !(message.offset && $util.isInteger(message.offset.low) && $util.isInteger(message.offset.high))) + return "offset: integer|Long expected"; + return null; + }; + + /** + * Creates an EventUpdate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.EventUpdate + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.EventUpdate} EventUpdate + */ + EventUpdate.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.EventUpdate) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.EventUpdate(); + if (object.stream != null) + message.stream = String(object.stream); + if (object.event != null) + message.event = String(object.event); + if (object.series != null) + message.series = String(object.series); + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.EventUpdate.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime, long + 1); + } + if (object.offset != null) + if ($util.Long) + (message.offset = $util.Long.fromValue(object.offset)).unsigned = false; + else if (typeof object.offset === "string") + message.offset = parseInt(object.offset, 10); + else if (typeof object.offset === "number") + message.offset = object.offset; + else if (typeof object.offset === "object") + message.offset = new $util.LongBits(object.offset.low >>> 0, object.offset.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an EventUpdate message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.EventUpdate + * @static + * @param {google.cloud.visionai.v1alpha1.EventUpdate} message EventUpdate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EventUpdate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.stream = ""; + object.event = ""; + object.series = ""; + object.updateTime = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.offset = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.offset = options.longs === String ? "0" : 0; + } + if (message.stream != null && message.hasOwnProperty("stream")) + object.stream = message.stream; + if (message.event != null && message.hasOwnProperty("event")) + object.event = message.event; + if (message.series != null && message.hasOwnProperty("series")) + object.series = message.series; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.offset != null && message.hasOwnProperty("offset")) + if (typeof message.offset === "number") + object.offset = options.longs === String ? String(message.offset) : message.offset; + else + object.offset = options.longs === String ? $util.Long.prototype.toString.call(message.offset) : options.longs === Number ? new $util.LongBits(message.offset.low >>> 0, message.offset.high >>> 0).toNumber() : message.offset; + return object; + }; + + /** + * Converts this EventUpdate to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.EventUpdate + * @instance + * @returns {Object.} JSON object + */ + EventUpdate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EventUpdate + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.EventUpdate + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EventUpdate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.EventUpdate"; + }; + + return EventUpdate; + })(); + + v1alpha1.ReceiveEventsControlResponse = (function() { + + /** + * Properties of a ReceiveEventsControlResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IReceiveEventsControlResponse + * @property {boolean|null} [heartbeat] ReceiveEventsControlResponse heartbeat + * @property {boolean|null} [writesDoneRequest] ReceiveEventsControlResponse writesDoneRequest + */ + + /** + * Constructs a new ReceiveEventsControlResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a ReceiveEventsControlResponse. + * @implements IReceiveEventsControlResponse + * @constructor + * @param {google.cloud.visionai.v1alpha1.IReceiveEventsControlResponse=} [properties] Properties to set + */ + function ReceiveEventsControlResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReceiveEventsControlResponse heartbeat. + * @member {boolean|null|undefined} heartbeat + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsControlResponse + * @instance + */ + ReceiveEventsControlResponse.prototype.heartbeat = null; + + /** + * ReceiveEventsControlResponse writesDoneRequest. + * @member {boolean|null|undefined} writesDoneRequest + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsControlResponse + * @instance + */ + ReceiveEventsControlResponse.prototype.writesDoneRequest = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ReceiveEventsControlResponse control. + * @member {"heartbeat"|"writesDoneRequest"|undefined} control + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsControlResponse + * @instance + */ + Object.defineProperty(ReceiveEventsControlResponse.prototype, "control", { + get: $util.oneOfGetter($oneOfFields = ["heartbeat", "writesDoneRequest"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ReceiveEventsControlResponse instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsControlResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IReceiveEventsControlResponse=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ReceiveEventsControlResponse} ReceiveEventsControlResponse instance + */ + ReceiveEventsControlResponse.create = function create(properties) { + return new ReceiveEventsControlResponse(properties); + }; + + /** + * Encodes the specified ReceiveEventsControlResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ReceiveEventsControlResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsControlResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IReceiveEventsControlResponse} message ReceiveEventsControlResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReceiveEventsControlResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.heartbeat != null && Object.hasOwnProperty.call(message, "heartbeat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.heartbeat); + if (message.writesDoneRequest != null && Object.hasOwnProperty.call(message, "writesDoneRequest")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.writesDoneRequest); + return writer; + }; + + /** + * Encodes the specified ReceiveEventsControlResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ReceiveEventsControlResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsControlResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IReceiveEventsControlResponse} message ReceiveEventsControlResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReceiveEventsControlResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReceiveEventsControlResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsControlResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ReceiveEventsControlResponse} ReceiveEventsControlResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReceiveEventsControlResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ReceiveEventsControlResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.heartbeat = reader.bool(); + break; + } + case 2: { + message.writesDoneRequest = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ReceiveEventsControlResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsControlResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ReceiveEventsControlResponse} ReceiveEventsControlResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReceiveEventsControlResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReceiveEventsControlResponse message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsControlResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReceiveEventsControlResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.heartbeat != null && message.hasOwnProperty("heartbeat")) { + properties.control = 1; + if (typeof message.heartbeat !== "boolean") + return "heartbeat: boolean expected"; + } + if (message.writesDoneRequest != null && message.hasOwnProperty("writesDoneRequest")) { + if (properties.control === 1) + return "control: multiple values"; + properties.control = 1; + if (typeof message.writesDoneRequest !== "boolean") + return "writesDoneRequest: boolean expected"; + } + return null; + }; + + /** + * Creates a ReceiveEventsControlResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsControlResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ReceiveEventsControlResponse} ReceiveEventsControlResponse + */ + ReceiveEventsControlResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ReceiveEventsControlResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ReceiveEventsControlResponse(); + if (object.heartbeat != null) + message.heartbeat = Boolean(object.heartbeat); + if (object.writesDoneRequest != null) + message.writesDoneRequest = Boolean(object.writesDoneRequest); + return message; + }; + + /** + * Creates a plain object from a ReceiveEventsControlResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsControlResponse + * @static + * @param {google.cloud.visionai.v1alpha1.ReceiveEventsControlResponse} message ReceiveEventsControlResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReceiveEventsControlResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.heartbeat != null && message.hasOwnProperty("heartbeat")) { + object.heartbeat = message.heartbeat; + if (options.oneofs) + object.control = "heartbeat"; + } + if (message.writesDoneRequest != null && message.hasOwnProperty("writesDoneRequest")) { + object.writesDoneRequest = message.writesDoneRequest; + if (options.oneofs) + object.control = "writesDoneRequest"; + } + return object; + }; + + /** + * Converts this ReceiveEventsControlResponse to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsControlResponse + * @instance + * @returns {Object.} JSON object + */ + ReceiveEventsControlResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReceiveEventsControlResponse + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsControlResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReceiveEventsControlResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ReceiveEventsControlResponse"; + }; + + return ReceiveEventsControlResponse; + })(); + + v1alpha1.ReceiveEventsResponse = (function() { + + /** + * Properties of a ReceiveEventsResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IReceiveEventsResponse + * @property {google.cloud.visionai.v1alpha1.IEventUpdate|null} [eventUpdate] ReceiveEventsResponse eventUpdate + * @property {google.cloud.visionai.v1alpha1.IReceiveEventsControlResponse|null} [control] ReceiveEventsResponse control + */ + + /** + * Constructs a new ReceiveEventsResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a ReceiveEventsResponse. + * @implements IReceiveEventsResponse + * @constructor + * @param {google.cloud.visionai.v1alpha1.IReceiveEventsResponse=} [properties] Properties to set + */ + function ReceiveEventsResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReceiveEventsResponse eventUpdate. + * @member {google.cloud.visionai.v1alpha1.IEventUpdate|null|undefined} eventUpdate + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsResponse + * @instance + */ + ReceiveEventsResponse.prototype.eventUpdate = null; + + /** + * ReceiveEventsResponse control. + * @member {google.cloud.visionai.v1alpha1.IReceiveEventsControlResponse|null|undefined} control + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsResponse + * @instance + */ + ReceiveEventsResponse.prototype.control = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ReceiveEventsResponse response. + * @member {"eventUpdate"|"control"|undefined} response + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsResponse + * @instance + */ + Object.defineProperty(ReceiveEventsResponse.prototype, "response", { + get: $util.oneOfGetter($oneOfFields = ["eventUpdate", "control"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ReceiveEventsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IReceiveEventsResponse=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ReceiveEventsResponse} ReceiveEventsResponse instance + */ + ReceiveEventsResponse.create = function create(properties) { + return new ReceiveEventsResponse(properties); + }; + + /** + * Encodes the specified ReceiveEventsResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ReceiveEventsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IReceiveEventsResponse} message ReceiveEventsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReceiveEventsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.eventUpdate != null && Object.hasOwnProperty.call(message, "eventUpdate")) + $root.google.cloud.visionai.v1alpha1.EventUpdate.encode(message.eventUpdate, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.control != null && Object.hasOwnProperty.call(message, "control")) + $root.google.cloud.visionai.v1alpha1.ReceiveEventsControlResponse.encode(message.control, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReceiveEventsResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ReceiveEventsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IReceiveEventsResponse} message ReceiveEventsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReceiveEventsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReceiveEventsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ReceiveEventsResponse} ReceiveEventsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReceiveEventsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ReceiveEventsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.eventUpdate = $root.google.cloud.visionai.v1alpha1.EventUpdate.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.control = $root.google.cloud.visionai.v1alpha1.ReceiveEventsControlResponse.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ReceiveEventsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ReceiveEventsResponse} ReceiveEventsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReceiveEventsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReceiveEventsResponse message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReceiveEventsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.eventUpdate != null && message.hasOwnProperty("eventUpdate")) { + properties.response = 1; + { + var error = $root.google.cloud.visionai.v1alpha1.EventUpdate.verify(message.eventUpdate, long + 1); + if (error) + return "eventUpdate." + error; + } + } + if (message.control != null && message.hasOwnProperty("control")) { + if (properties.response === 1) + return "response: multiple values"; + properties.response = 1; + { + var error = $root.google.cloud.visionai.v1alpha1.ReceiveEventsControlResponse.verify(message.control, long + 1); + if (error) + return "control." + error; + } + } + return null; + }; + + /** + * Creates a ReceiveEventsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ReceiveEventsResponse} ReceiveEventsResponse + */ + ReceiveEventsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ReceiveEventsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ReceiveEventsResponse(); + if (object.eventUpdate != null) { + if (typeof object.eventUpdate !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ReceiveEventsResponse.eventUpdate: object expected"); + message.eventUpdate = $root.google.cloud.visionai.v1alpha1.EventUpdate.fromObject(object.eventUpdate, long + 1); + } + if (object.control != null) { + if (typeof object.control !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ReceiveEventsResponse.control: object expected"); + message.control = $root.google.cloud.visionai.v1alpha1.ReceiveEventsControlResponse.fromObject(object.control, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a ReceiveEventsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsResponse + * @static + * @param {google.cloud.visionai.v1alpha1.ReceiveEventsResponse} message ReceiveEventsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReceiveEventsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.eventUpdate != null && message.hasOwnProperty("eventUpdate")) { + object.eventUpdate = $root.google.cloud.visionai.v1alpha1.EventUpdate.toObject(message.eventUpdate, options); + if (options.oneofs) + object.response = "eventUpdate"; + } + if (message.control != null && message.hasOwnProperty("control")) { + object.control = $root.google.cloud.visionai.v1alpha1.ReceiveEventsControlResponse.toObject(message.control, options); + if (options.oneofs) + object.response = "control"; + } + return object; + }; + + /** + * Converts this ReceiveEventsResponse to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsResponse + * @instance + * @returns {Object.} JSON object + */ + ReceiveEventsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReceiveEventsResponse + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ReceiveEventsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReceiveEventsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ReceiveEventsResponse"; + }; + + return ReceiveEventsResponse; + })(); + + v1alpha1.Lease = (function() { + + /** + * Properties of a Lease. + * @memberof google.cloud.visionai.v1alpha1 + * @interface ILease + * @property {string|null} [id] Lease id + * @property {string|null} [series] Lease series + * @property {string|null} [owner] Lease owner + * @property {google.protobuf.ITimestamp|null} [expireTime] Lease expireTime + * @property {google.cloud.visionai.v1alpha1.LeaseType|null} [leaseType] Lease leaseType + */ + + /** + * Constructs a new Lease. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a Lease. + * @implements ILease + * @constructor + * @param {google.cloud.visionai.v1alpha1.ILease=} [properties] Properties to set + */ + function Lease(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Lease id. + * @member {string} id + * @memberof google.cloud.visionai.v1alpha1.Lease + * @instance + */ + Lease.prototype.id = ""; + + /** + * Lease series. + * @member {string} series + * @memberof google.cloud.visionai.v1alpha1.Lease + * @instance + */ + Lease.prototype.series = ""; + + /** + * Lease owner. + * @member {string} owner + * @memberof google.cloud.visionai.v1alpha1.Lease + * @instance + */ + Lease.prototype.owner = ""; + + /** + * Lease expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.cloud.visionai.v1alpha1.Lease + * @instance + */ + Lease.prototype.expireTime = null; + + /** + * Lease leaseType. + * @member {google.cloud.visionai.v1alpha1.LeaseType} leaseType + * @memberof google.cloud.visionai.v1alpha1.Lease + * @instance + */ + Lease.prototype.leaseType = 0; + + /** + * Creates a new Lease instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.Lease + * @static + * @param {google.cloud.visionai.v1alpha1.ILease=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.Lease} Lease instance + */ + Lease.create = function create(properties) { + return new Lease(properties); + }; + + /** + * Encodes the specified Lease message. Does not implicitly {@link google.cloud.visionai.v1alpha1.Lease.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.Lease + * @static + * @param {google.cloud.visionai.v1alpha1.ILease} message Lease message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Lease.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.series != null && Object.hasOwnProperty.call(message, "series")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.series); + if (message.owner != null && Object.hasOwnProperty.call(message, "owner")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.owner); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.leaseType != null && Object.hasOwnProperty.call(message, "leaseType")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.leaseType); + return writer; + }; + + /** + * Encodes the specified Lease message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.Lease.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.Lease + * @static + * @param {google.cloud.visionai.v1alpha1.ILease} message Lease message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Lease.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Lease message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.Lease + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.Lease} Lease + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Lease.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.Lease(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.series = reader.string(); + break; + } + case 3: { + message.owner = reader.string(); + break; + } + case 4: { + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.leaseType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Lease message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.Lease + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.Lease} Lease + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Lease.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Lease message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.Lease + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Lease.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.series != null && message.hasOwnProperty("series")) + if (!$util.isString(message.series)) + return "series: string expected"; + if (message.owner != null && message.hasOwnProperty("owner")) + if (!$util.isString(message.owner)) + return "owner: string expected"; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime, long + 1); + if (error) + return "expireTime." + error; + } + if (message.leaseType != null && message.hasOwnProperty("leaseType")) + switch (message.leaseType) { + default: + return "leaseType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a Lease message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.Lease + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.Lease} Lease + */ + Lease.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.Lease) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.Lease(); + if (object.id != null) + message.id = String(object.id); + if (object.series != null) + message.series = String(object.series); + if (object.owner != null) + message.owner = String(object.owner); + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Lease.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime, long + 1); + } + switch (object.leaseType) { + default: + if (typeof object.leaseType === "number") { + message.leaseType = object.leaseType; + break; + } + break; + case "LEASE_TYPE_UNSPECIFIED": + case 0: + message.leaseType = 0; + break; + case "LEASE_TYPE_READER": + case 1: + message.leaseType = 1; + break; + case "LEASE_TYPE_WRITER": + case 2: + message.leaseType = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a Lease message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.Lease + * @static + * @param {google.cloud.visionai.v1alpha1.Lease} message Lease + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Lease.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.series = ""; + object.owner = ""; + object.expireTime = null; + object.leaseType = options.enums === String ? "LEASE_TYPE_UNSPECIFIED" : 0; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.series != null && message.hasOwnProperty("series")) + object.series = message.series; + if (message.owner != null && message.hasOwnProperty("owner")) + object.owner = message.owner; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + if (message.leaseType != null && message.hasOwnProperty("leaseType")) + object.leaseType = options.enums === String ? $root.google.cloud.visionai.v1alpha1.LeaseType[message.leaseType] === undefined ? message.leaseType : $root.google.cloud.visionai.v1alpha1.LeaseType[message.leaseType] : message.leaseType; + return object; + }; + + /** + * Converts this Lease to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.Lease + * @instance + * @returns {Object.} JSON object + */ + Lease.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Lease + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.Lease + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Lease.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.Lease"; + }; + + return Lease; + })(); + + v1alpha1.AcquireLeaseRequest = (function() { + + /** + * Properties of an AcquireLeaseRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IAcquireLeaseRequest + * @property {string|null} [series] AcquireLeaseRequest series + * @property {string|null} [owner] AcquireLeaseRequest owner + * @property {google.protobuf.IDuration|null} [term] AcquireLeaseRequest term + * @property {google.cloud.visionai.v1alpha1.LeaseType|null} [leaseType] AcquireLeaseRequest leaseType + */ + + /** + * Constructs a new AcquireLeaseRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents an AcquireLeaseRequest. + * @implements IAcquireLeaseRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IAcquireLeaseRequest=} [properties] Properties to set + */ + function AcquireLeaseRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * AcquireLeaseRequest series. + * @member {string} series + * @memberof google.cloud.visionai.v1alpha1.AcquireLeaseRequest + * @instance + */ + AcquireLeaseRequest.prototype.series = ""; + + /** + * AcquireLeaseRequest owner. + * @member {string} owner + * @memberof google.cloud.visionai.v1alpha1.AcquireLeaseRequest + * @instance + */ + AcquireLeaseRequest.prototype.owner = ""; + + /** + * AcquireLeaseRequest term. + * @member {google.protobuf.IDuration|null|undefined} term + * @memberof google.cloud.visionai.v1alpha1.AcquireLeaseRequest + * @instance + */ + AcquireLeaseRequest.prototype.term = null; + + /** + * AcquireLeaseRequest leaseType. + * @member {google.cloud.visionai.v1alpha1.LeaseType} leaseType + * @memberof google.cloud.visionai.v1alpha1.AcquireLeaseRequest + * @instance + */ + AcquireLeaseRequest.prototype.leaseType = 0; + + /** + * Creates a new AcquireLeaseRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.AcquireLeaseRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IAcquireLeaseRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.AcquireLeaseRequest} AcquireLeaseRequest instance + */ + AcquireLeaseRequest.create = function create(properties) { + return new AcquireLeaseRequest(properties); + }; + + /** + * Encodes the specified AcquireLeaseRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.AcquireLeaseRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.AcquireLeaseRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IAcquireLeaseRequest} message AcquireLeaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AcquireLeaseRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.series != null && Object.hasOwnProperty.call(message, "series")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.series); + if (message.owner != null && Object.hasOwnProperty.call(message, "owner")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.owner); + if (message.term != null && Object.hasOwnProperty.call(message, "term")) + $root.google.protobuf.Duration.encode(message.term, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.leaseType != null && Object.hasOwnProperty.call(message, "leaseType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.leaseType); + return writer; + }; + + /** + * Encodes the specified AcquireLeaseRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.AcquireLeaseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.AcquireLeaseRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IAcquireLeaseRequest} message AcquireLeaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AcquireLeaseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AcquireLeaseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.AcquireLeaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.AcquireLeaseRequest} AcquireLeaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AcquireLeaseRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.AcquireLeaseRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.series = reader.string(); + break; + } + case 2: { + message.owner = reader.string(); + break; + } + case 3: { + message.term = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.leaseType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an AcquireLeaseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.AcquireLeaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.AcquireLeaseRequest} AcquireLeaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AcquireLeaseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AcquireLeaseRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.AcquireLeaseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AcquireLeaseRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.series != null && message.hasOwnProperty("series")) + if (!$util.isString(message.series)) + return "series: string expected"; + if (message.owner != null && message.hasOwnProperty("owner")) + if (!$util.isString(message.owner)) + return "owner: string expected"; + if (message.term != null && message.hasOwnProperty("term")) { + var error = $root.google.protobuf.Duration.verify(message.term, long + 1); + if (error) + return "term." + error; + } + if (message.leaseType != null && message.hasOwnProperty("leaseType")) + switch (message.leaseType) { + default: + return "leaseType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an AcquireLeaseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.AcquireLeaseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.AcquireLeaseRequest} AcquireLeaseRequest + */ + AcquireLeaseRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.AcquireLeaseRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.AcquireLeaseRequest(); + if (object.series != null) + message.series = String(object.series); + if (object.owner != null) + message.owner = String(object.owner); + if (object.term != null) { + if (typeof object.term !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.AcquireLeaseRequest.term: object expected"); + message.term = $root.google.protobuf.Duration.fromObject(object.term, long + 1); + } + switch (object.leaseType) { + default: + if (typeof object.leaseType === "number") { + message.leaseType = object.leaseType; + break; + } + break; + case "LEASE_TYPE_UNSPECIFIED": + case 0: + message.leaseType = 0; + break; + case "LEASE_TYPE_READER": + case 1: + message.leaseType = 1; + break; + case "LEASE_TYPE_WRITER": + case 2: + message.leaseType = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an AcquireLeaseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.AcquireLeaseRequest + * @static + * @param {google.cloud.visionai.v1alpha1.AcquireLeaseRequest} message AcquireLeaseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AcquireLeaseRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.series = ""; + object.owner = ""; + object.term = null; + object.leaseType = options.enums === String ? "LEASE_TYPE_UNSPECIFIED" : 0; + } + if (message.series != null && message.hasOwnProperty("series")) + object.series = message.series; + if (message.owner != null && message.hasOwnProperty("owner")) + object.owner = message.owner; + if (message.term != null && message.hasOwnProperty("term")) + object.term = $root.google.protobuf.Duration.toObject(message.term, options); + if (message.leaseType != null && message.hasOwnProperty("leaseType")) + object.leaseType = options.enums === String ? $root.google.cloud.visionai.v1alpha1.LeaseType[message.leaseType] === undefined ? message.leaseType : $root.google.cloud.visionai.v1alpha1.LeaseType[message.leaseType] : message.leaseType; + return object; + }; + + /** + * Converts this AcquireLeaseRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.AcquireLeaseRequest + * @instance + * @returns {Object.} JSON object + */ + AcquireLeaseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AcquireLeaseRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.AcquireLeaseRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AcquireLeaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.AcquireLeaseRequest"; + }; + + return AcquireLeaseRequest; + })(); + + v1alpha1.RenewLeaseRequest = (function() { + + /** + * Properties of a RenewLeaseRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IRenewLeaseRequest + * @property {string|null} [id] RenewLeaseRequest id + * @property {string|null} [series] RenewLeaseRequest series + * @property {string|null} [owner] RenewLeaseRequest owner + * @property {google.protobuf.IDuration|null} [term] RenewLeaseRequest term + */ + + /** + * Constructs a new RenewLeaseRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a RenewLeaseRequest. + * @implements IRenewLeaseRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IRenewLeaseRequest=} [properties] Properties to set + */ + function RenewLeaseRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * RenewLeaseRequest id. + * @member {string} id + * @memberof google.cloud.visionai.v1alpha1.RenewLeaseRequest + * @instance + */ + RenewLeaseRequest.prototype.id = ""; + + /** + * RenewLeaseRequest series. + * @member {string} series + * @memberof google.cloud.visionai.v1alpha1.RenewLeaseRequest + * @instance + */ + RenewLeaseRequest.prototype.series = ""; + + /** + * RenewLeaseRequest owner. + * @member {string} owner + * @memberof google.cloud.visionai.v1alpha1.RenewLeaseRequest + * @instance + */ + RenewLeaseRequest.prototype.owner = ""; + + /** + * RenewLeaseRequest term. + * @member {google.protobuf.IDuration|null|undefined} term + * @memberof google.cloud.visionai.v1alpha1.RenewLeaseRequest + * @instance + */ + RenewLeaseRequest.prototype.term = null; + + /** + * Creates a new RenewLeaseRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.RenewLeaseRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IRenewLeaseRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.RenewLeaseRequest} RenewLeaseRequest instance + */ + RenewLeaseRequest.create = function create(properties) { + return new RenewLeaseRequest(properties); + }; + + /** + * Encodes the specified RenewLeaseRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.RenewLeaseRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.RenewLeaseRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IRenewLeaseRequest} message RenewLeaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RenewLeaseRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.series != null && Object.hasOwnProperty.call(message, "series")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.series); + if (message.owner != null && Object.hasOwnProperty.call(message, "owner")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.owner); + if (message.term != null && Object.hasOwnProperty.call(message, "term")) + $root.google.protobuf.Duration.encode(message.term, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RenewLeaseRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.RenewLeaseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.RenewLeaseRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IRenewLeaseRequest} message RenewLeaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RenewLeaseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RenewLeaseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.RenewLeaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.RenewLeaseRequest} RenewLeaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RenewLeaseRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.RenewLeaseRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.series = reader.string(); + break; + } + case 3: { + message.owner = reader.string(); + break; + } + case 4: { + message.term = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a RenewLeaseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.RenewLeaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.RenewLeaseRequest} RenewLeaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RenewLeaseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RenewLeaseRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.RenewLeaseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RenewLeaseRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.series != null && message.hasOwnProperty("series")) + if (!$util.isString(message.series)) + return "series: string expected"; + if (message.owner != null && message.hasOwnProperty("owner")) + if (!$util.isString(message.owner)) + return "owner: string expected"; + if (message.term != null && message.hasOwnProperty("term")) { + var error = $root.google.protobuf.Duration.verify(message.term, long + 1); + if (error) + return "term." + error; + } + return null; + }; + + /** + * Creates a RenewLeaseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.RenewLeaseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.RenewLeaseRequest} RenewLeaseRequest + */ + RenewLeaseRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.RenewLeaseRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.RenewLeaseRequest(); + if (object.id != null) + message.id = String(object.id); + if (object.series != null) + message.series = String(object.series); + if (object.owner != null) + message.owner = String(object.owner); + if (object.term != null) { + if (typeof object.term !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.RenewLeaseRequest.term: object expected"); + message.term = $root.google.protobuf.Duration.fromObject(object.term, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a RenewLeaseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.RenewLeaseRequest + * @static + * @param {google.cloud.visionai.v1alpha1.RenewLeaseRequest} message RenewLeaseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RenewLeaseRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.series = ""; + object.owner = ""; + object.term = null; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.series != null && message.hasOwnProperty("series")) + object.series = message.series; + if (message.owner != null && message.hasOwnProperty("owner")) + object.owner = message.owner; + if (message.term != null && message.hasOwnProperty("term")) + object.term = $root.google.protobuf.Duration.toObject(message.term, options); + return object; + }; + + /** + * Converts this RenewLeaseRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.RenewLeaseRequest + * @instance + * @returns {Object.} JSON object + */ + RenewLeaseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RenewLeaseRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.RenewLeaseRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RenewLeaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.RenewLeaseRequest"; + }; + + return RenewLeaseRequest; + })(); + + v1alpha1.ReleaseLeaseRequest = (function() { + + /** + * Properties of a ReleaseLeaseRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IReleaseLeaseRequest + * @property {string|null} [id] ReleaseLeaseRequest id + * @property {string|null} [series] ReleaseLeaseRequest series + * @property {string|null} [owner] ReleaseLeaseRequest owner + */ + + /** + * Constructs a new ReleaseLeaseRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a ReleaseLeaseRequest. + * @implements IReleaseLeaseRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IReleaseLeaseRequest=} [properties] Properties to set + */ + function ReleaseLeaseRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReleaseLeaseRequest id. + * @member {string} id + * @memberof google.cloud.visionai.v1alpha1.ReleaseLeaseRequest + * @instance + */ + ReleaseLeaseRequest.prototype.id = ""; + + /** + * ReleaseLeaseRequest series. + * @member {string} series + * @memberof google.cloud.visionai.v1alpha1.ReleaseLeaseRequest + * @instance + */ + ReleaseLeaseRequest.prototype.series = ""; + + /** + * ReleaseLeaseRequest owner. + * @member {string} owner + * @memberof google.cloud.visionai.v1alpha1.ReleaseLeaseRequest + * @instance + */ + ReleaseLeaseRequest.prototype.owner = ""; + + /** + * Creates a new ReleaseLeaseRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ReleaseLeaseRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IReleaseLeaseRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ReleaseLeaseRequest} ReleaseLeaseRequest instance + */ + ReleaseLeaseRequest.create = function create(properties) { + return new ReleaseLeaseRequest(properties); + }; + + /** + * Encodes the specified ReleaseLeaseRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ReleaseLeaseRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ReleaseLeaseRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IReleaseLeaseRequest} message ReleaseLeaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReleaseLeaseRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.series != null && Object.hasOwnProperty.call(message, "series")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.series); + if (message.owner != null && Object.hasOwnProperty.call(message, "owner")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.owner); + return writer; + }; + + /** + * Encodes the specified ReleaseLeaseRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ReleaseLeaseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ReleaseLeaseRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IReleaseLeaseRequest} message ReleaseLeaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReleaseLeaseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReleaseLeaseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ReleaseLeaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ReleaseLeaseRequest} ReleaseLeaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReleaseLeaseRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ReleaseLeaseRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.series = reader.string(); + break; + } + case 3: { + message.owner = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ReleaseLeaseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ReleaseLeaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ReleaseLeaseRequest} ReleaseLeaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReleaseLeaseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReleaseLeaseRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ReleaseLeaseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReleaseLeaseRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.series != null && message.hasOwnProperty("series")) + if (!$util.isString(message.series)) + return "series: string expected"; + if (message.owner != null && message.hasOwnProperty("owner")) + if (!$util.isString(message.owner)) + return "owner: string expected"; + return null; + }; + + /** + * Creates a ReleaseLeaseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ReleaseLeaseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ReleaseLeaseRequest} ReleaseLeaseRequest + */ + ReleaseLeaseRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ReleaseLeaseRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ReleaseLeaseRequest(); + if (object.id != null) + message.id = String(object.id); + if (object.series != null) + message.series = String(object.series); + if (object.owner != null) + message.owner = String(object.owner); + return message; + }; + + /** + * Creates a plain object from a ReleaseLeaseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ReleaseLeaseRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ReleaseLeaseRequest} message ReleaseLeaseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReleaseLeaseRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.series = ""; + object.owner = ""; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.series != null && message.hasOwnProperty("series")) + object.series = message.series; + if (message.owner != null && message.hasOwnProperty("owner")) + object.owner = message.owner; + return object; + }; + + /** + * Converts this ReleaseLeaseRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ReleaseLeaseRequest + * @instance + * @returns {Object.} JSON object + */ + ReleaseLeaseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReleaseLeaseRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ReleaseLeaseRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReleaseLeaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ReleaseLeaseRequest"; + }; + + return ReleaseLeaseRequest; + })(); + + v1alpha1.ReleaseLeaseResponse = (function() { + + /** + * Properties of a ReleaseLeaseResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IReleaseLeaseResponse + */ + + /** + * Constructs a new ReleaseLeaseResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a ReleaseLeaseResponse. + * @implements IReleaseLeaseResponse + * @constructor + * @param {google.cloud.visionai.v1alpha1.IReleaseLeaseResponse=} [properties] Properties to set + */ + function ReleaseLeaseResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new ReleaseLeaseResponse instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ReleaseLeaseResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IReleaseLeaseResponse=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ReleaseLeaseResponse} ReleaseLeaseResponse instance + */ + ReleaseLeaseResponse.create = function create(properties) { + return new ReleaseLeaseResponse(properties); + }; + + /** + * Encodes the specified ReleaseLeaseResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ReleaseLeaseResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ReleaseLeaseResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IReleaseLeaseResponse} message ReleaseLeaseResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReleaseLeaseResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ReleaseLeaseResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ReleaseLeaseResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ReleaseLeaseResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IReleaseLeaseResponse} message ReleaseLeaseResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReleaseLeaseResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReleaseLeaseResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ReleaseLeaseResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ReleaseLeaseResponse} ReleaseLeaseResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReleaseLeaseResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ReleaseLeaseResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ReleaseLeaseResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ReleaseLeaseResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ReleaseLeaseResponse} ReleaseLeaseResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReleaseLeaseResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReleaseLeaseResponse message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ReleaseLeaseResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReleaseLeaseResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates a ReleaseLeaseResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ReleaseLeaseResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ReleaseLeaseResponse} ReleaseLeaseResponse + */ + ReleaseLeaseResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ReleaseLeaseResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.google.cloud.visionai.v1alpha1.ReleaseLeaseResponse(); + }; + + /** + * Creates a plain object from a ReleaseLeaseResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ReleaseLeaseResponse + * @static + * @param {google.cloud.visionai.v1alpha1.ReleaseLeaseResponse} message ReleaseLeaseResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReleaseLeaseResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ReleaseLeaseResponse to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ReleaseLeaseResponse + * @instance + * @returns {Object.} JSON object + */ + ReleaseLeaseResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReleaseLeaseResponse + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ReleaseLeaseResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReleaseLeaseResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ReleaseLeaseResponse"; + }; + + return ReleaseLeaseResponse; + })(); + + v1alpha1.RequestMetadata = (function() { + + /** + * Properties of a RequestMetadata. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IRequestMetadata + * @property {string|null} [stream] RequestMetadata stream + * @property {string|null} [event] RequestMetadata event + * @property {string|null} [series] RequestMetadata series + * @property {string|null} [leaseId] RequestMetadata leaseId + * @property {string|null} [owner] RequestMetadata owner + * @property {google.protobuf.IDuration|null} [leaseTerm] RequestMetadata leaseTerm + */ + + /** + * Constructs a new RequestMetadata. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a RequestMetadata. + * @implements IRequestMetadata + * @constructor + * @param {google.cloud.visionai.v1alpha1.IRequestMetadata=} [properties] Properties to set + */ + function RequestMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestMetadata stream. + * @member {string} stream + * @memberof google.cloud.visionai.v1alpha1.RequestMetadata + * @instance + */ + RequestMetadata.prototype.stream = ""; + + /** + * RequestMetadata event. + * @member {string} event + * @memberof google.cloud.visionai.v1alpha1.RequestMetadata + * @instance + */ + RequestMetadata.prototype.event = ""; + + /** + * RequestMetadata series. + * @member {string} series + * @memberof google.cloud.visionai.v1alpha1.RequestMetadata + * @instance + */ + RequestMetadata.prototype.series = ""; + + /** + * RequestMetadata leaseId. + * @member {string} leaseId + * @memberof google.cloud.visionai.v1alpha1.RequestMetadata + * @instance + */ + RequestMetadata.prototype.leaseId = ""; + + /** + * RequestMetadata owner. + * @member {string} owner + * @memberof google.cloud.visionai.v1alpha1.RequestMetadata + * @instance + */ + RequestMetadata.prototype.owner = ""; + + /** + * RequestMetadata leaseTerm. + * @member {google.protobuf.IDuration|null|undefined} leaseTerm + * @memberof google.cloud.visionai.v1alpha1.RequestMetadata + * @instance + */ + RequestMetadata.prototype.leaseTerm = null; + + /** + * Creates a new RequestMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.RequestMetadata + * @static + * @param {google.cloud.visionai.v1alpha1.IRequestMetadata=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.RequestMetadata} RequestMetadata instance + */ + RequestMetadata.create = function create(properties) { + return new RequestMetadata(properties); + }; + + /** + * Encodes the specified RequestMetadata message. Does not implicitly {@link google.cloud.visionai.v1alpha1.RequestMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.RequestMetadata + * @static + * @param {google.cloud.visionai.v1alpha1.IRequestMetadata} message RequestMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stream != null && Object.hasOwnProperty.call(message, "stream")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.stream); + if (message.event != null && Object.hasOwnProperty.call(message, "event")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.event); + if (message.series != null && Object.hasOwnProperty.call(message, "series")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.series); + if (message.leaseId != null && Object.hasOwnProperty.call(message, "leaseId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.leaseId); + if (message.owner != null && Object.hasOwnProperty.call(message, "owner")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.owner); + if (message.leaseTerm != null && Object.hasOwnProperty.call(message, "leaseTerm")) + $root.google.protobuf.Duration.encode(message.leaseTerm, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RequestMetadata message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.RequestMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.RequestMetadata + * @static + * @param {google.cloud.visionai.v1alpha1.IRequestMetadata} message RequestMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.RequestMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.RequestMetadata} RequestMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestMetadata.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.RequestMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.stream = reader.string(); + break; + } + case 2: { + message.event = reader.string(); + break; + } + case 3: { + message.series = reader.string(); + break; + } + case 4: { + message.leaseId = reader.string(); + break; + } + case 5: { + message.owner = reader.string(); + break; + } + case 6: { + message.leaseTerm = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a RequestMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.RequestMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.RequestMetadata} RequestMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestMetadata message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.RequestMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestMetadata.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.stream != null && message.hasOwnProperty("stream")) + if (!$util.isString(message.stream)) + return "stream: string expected"; + if (message.event != null && message.hasOwnProperty("event")) + if (!$util.isString(message.event)) + return "event: string expected"; + if (message.series != null && message.hasOwnProperty("series")) + if (!$util.isString(message.series)) + return "series: string expected"; + if (message.leaseId != null && message.hasOwnProperty("leaseId")) + if (!$util.isString(message.leaseId)) + return "leaseId: string expected"; + if (message.owner != null && message.hasOwnProperty("owner")) + if (!$util.isString(message.owner)) + return "owner: string expected"; + if (message.leaseTerm != null && message.hasOwnProperty("leaseTerm")) { + var error = $root.google.protobuf.Duration.verify(message.leaseTerm, long + 1); + if (error) + return "leaseTerm." + error; + } + return null; + }; + + /** + * Creates a RequestMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.RequestMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.RequestMetadata} RequestMetadata + */ + RequestMetadata.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.RequestMetadata) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.RequestMetadata(); + if (object.stream != null) + message.stream = String(object.stream); + if (object.event != null) + message.event = String(object.event); + if (object.series != null) + message.series = String(object.series); + if (object.leaseId != null) + message.leaseId = String(object.leaseId); + if (object.owner != null) + message.owner = String(object.owner); + if (object.leaseTerm != null) { + if (typeof object.leaseTerm !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.RequestMetadata.leaseTerm: object expected"); + message.leaseTerm = $root.google.protobuf.Duration.fromObject(object.leaseTerm, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a RequestMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.RequestMetadata + * @static + * @param {google.cloud.visionai.v1alpha1.RequestMetadata} message RequestMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.stream = ""; + object.event = ""; + object.series = ""; + object.leaseId = ""; + object.owner = ""; + object.leaseTerm = null; + } + if (message.stream != null && message.hasOwnProperty("stream")) + object.stream = message.stream; + if (message.event != null && message.hasOwnProperty("event")) + object.event = message.event; + if (message.series != null && message.hasOwnProperty("series")) + object.series = message.series; + if (message.leaseId != null && message.hasOwnProperty("leaseId")) + object.leaseId = message.leaseId; + if (message.owner != null && message.hasOwnProperty("owner")) + object.owner = message.owner; + if (message.leaseTerm != null && message.hasOwnProperty("leaseTerm")) + object.leaseTerm = $root.google.protobuf.Duration.toObject(message.leaseTerm, options); + return object; + }; + + /** + * Converts this RequestMetadata to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.RequestMetadata + * @instance + * @returns {Object.} JSON object + */ + RequestMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RequestMetadata + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.RequestMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RequestMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.RequestMetadata"; + }; + + return RequestMetadata; + })(); + + v1alpha1.SendPacketsRequest = (function() { + + /** + * Properties of a SendPacketsRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface ISendPacketsRequest + * @property {google.cloud.visionai.v1alpha1.IPacket|null} [packet] SendPacketsRequest packet + * @property {google.cloud.visionai.v1alpha1.IRequestMetadata|null} [metadata] SendPacketsRequest metadata + */ + + /** + * Constructs a new SendPacketsRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a SendPacketsRequest. + * @implements ISendPacketsRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.ISendPacketsRequest=} [properties] Properties to set + */ + function SendPacketsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SendPacketsRequest packet. + * @member {google.cloud.visionai.v1alpha1.IPacket|null|undefined} packet + * @memberof google.cloud.visionai.v1alpha1.SendPacketsRequest + * @instance + */ + SendPacketsRequest.prototype.packet = null; + + /** + * SendPacketsRequest metadata. + * @member {google.cloud.visionai.v1alpha1.IRequestMetadata|null|undefined} metadata + * @memberof google.cloud.visionai.v1alpha1.SendPacketsRequest + * @instance + */ + SendPacketsRequest.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SendPacketsRequest request. + * @member {"packet"|"metadata"|undefined} request + * @memberof google.cloud.visionai.v1alpha1.SendPacketsRequest + * @instance + */ + Object.defineProperty(SendPacketsRequest.prototype, "request", { + get: $util.oneOfGetter($oneOfFields = ["packet", "metadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SendPacketsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.SendPacketsRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ISendPacketsRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.SendPacketsRequest} SendPacketsRequest instance + */ + SendPacketsRequest.create = function create(properties) { + return new SendPacketsRequest(properties); + }; + + /** + * Encodes the specified SendPacketsRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.SendPacketsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.SendPacketsRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ISendPacketsRequest} message SendPacketsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SendPacketsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.packet != null && Object.hasOwnProperty.call(message, "packet")) + $root.google.cloud.visionai.v1alpha1.Packet.encode(message.packet, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.cloud.visionai.v1alpha1.RequestMetadata.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SendPacketsRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.SendPacketsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.SendPacketsRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ISendPacketsRequest} message SendPacketsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SendPacketsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SendPacketsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.SendPacketsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.SendPacketsRequest} SendPacketsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SendPacketsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.SendPacketsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.packet = $root.google.cloud.visionai.v1alpha1.Packet.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.metadata = $root.google.cloud.visionai.v1alpha1.RequestMetadata.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SendPacketsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.SendPacketsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.SendPacketsRequest} SendPacketsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SendPacketsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SendPacketsRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.SendPacketsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SendPacketsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.packet != null && message.hasOwnProperty("packet")) { + properties.request = 1; + { + var error = $root.google.cloud.visionai.v1alpha1.Packet.verify(message.packet, long + 1); + if (error) + return "packet." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + if (properties.request === 1) + return "request: multiple values"; + properties.request = 1; + { + var error = $root.google.cloud.visionai.v1alpha1.RequestMetadata.verify(message.metadata, long + 1); + if (error) + return "metadata." + error; + } + } + return null; + }; + + /** + * Creates a SendPacketsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.SendPacketsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.SendPacketsRequest} SendPacketsRequest + */ + SendPacketsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.SendPacketsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.SendPacketsRequest(); + if (object.packet != null) { + if (typeof object.packet !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.SendPacketsRequest.packet: object expected"); + message.packet = $root.google.cloud.visionai.v1alpha1.Packet.fromObject(object.packet, long + 1); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.SendPacketsRequest.metadata: object expected"); + message.metadata = $root.google.cloud.visionai.v1alpha1.RequestMetadata.fromObject(object.metadata, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a SendPacketsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.SendPacketsRequest + * @static + * @param {google.cloud.visionai.v1alpha1.SendPacketsRequest} message SendPacketsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SendPacketsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.packet != null && message.hasOwnProperty("packet")) { + object.packet = $root.google.cloud.visionai.v1alpha1.Packet.toObject(message.packet, options); + if (options.oneofs) + object.request = "packet"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + object.metadata = $root.google.cloud.visionai.v1alpha1.RequestMetadata.toObject(message.metadata, options); + if (options.oneofs) + object.request = "metadata"; + } + return object; + }; + + /** + * Converts this SendPacketsRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.SendPacketsRequest + * @instance + * @returns {Object.} JSON object + */ + SendPacketsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SendPacketsRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.SendPacketsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SendPacketsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.SendPacketsRequest"; + }; + + return SendPacketsRequest; + })(); + + v1alpha1.SendPacketsResponse = (function() { + + /** + * Properties of a SendPacketsResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @interface ISendPacketsResponse + */ + + /** + * Constructs a new SendPacketsResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a SendPacketsResponse. + * @implements ISendPacketsResponse + * @constructor + * @param {google.cloud.visionai.v1alpha1.ISendPacketsResponse=} [properties] Properties to set + */ + function SendPacketsResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new SendPacketsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.SendPacketsResponse + * @static + * @param {google.cloud.visionai.v1alpha1.ISendPacketsResponse=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.SendPacketsResponse} SendPacketsResponse instance + */ + SendPacketsResponse.create = function create(properties) { + return new SendPacketsResponse(properties); + }; + + /** + * Encodes the specified SendPacketsResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.SendPacketsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.SendPacketsResponse + * @static + * @param {google.cloud.visionai.v1alpha1.ISendPacketsResponse} message SendPacketsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SendPacketsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified SendPacketsResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.SendPacketsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.SendPacketsResponse + * @static + * @param {google.cloud.visionai.v1alpha1.ISendPacketsResponse} message SendPacketsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SendPacketsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SendPacketsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.SendPacketsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.SendPacketsResponse} SendPacketsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SendPacketsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.SendPacketsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SendPacketsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.SendPacketsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.SendPacketsResponse} SendPacketsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SendPacketsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SendPacketsResponse message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.SendPacketsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SendPacketsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates a SendPacketsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.SendPacketsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.SendPacketsResponse} SendPacketsResponse + */ + SendPacketsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.SendPacketsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.google.cloud.visionai.v1alpha1.SendPacketsResponse(); + }; + + /** + * Creates a plain object from a SendPacketsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.SendPacketsResponse + * @static + * @param {google.cloud.visionai.v1alpha1.SendPacketsResponse} message SendPacketsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SendPacketsResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this SendPacketsResponse to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.SendPacketsResponse + * @instance + * @returns {Object.} JSON object + */ + SendPacketsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SendPacketsResponse + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.SendPacketsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SendPacketsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.SendPacketsResponse"; + }; + + return SendPacketsResponse; + })(); + + v1alpha1.ReceivePacketsRequest = (function() { + + /** + * Properties of a ReceivePacketsRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IReceivePacketsRequest + * @property {google.cloud.visionai.v1alpha1.ReceivePacketsRequest.ISetupRequest|null} [setupRequest] ReceivePacketsRequest setupRequest + * @property {google.cloud.visionai.v1alpha1.ICommitRequest|null} [commitRequest] ReceivePacketsRequest commitRequest + */ + + /** + * Constructs a new ReceivePacketsRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a ReceivePacketsRequest. + * @implements IReceivePacketsRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IReceivePacketsRequest=} [properties] Properties to set + */ + function ReceivePacketsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReceivePacketsRequest setupRequest. + * @member {google.cloud.visionai.v1alpha1.ReceivePacketsRequest.ISetupRequest|null|undefined} setupRequest + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsRequest + * @instance + */ + ReceivePacketsRequest.prototype.setupRequest = null; + + /** + * ReceivePacketsRequest commitRequest. + * @member {google.cloud.visionai.v1alpha1.ICommitRequest|null|undefined} commitRequest + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsRequest + * @instance + */ + ReceivePacketsRequest.prototype.commitRequest = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ReceivePacketsRequest request. + * @member {"setupRequest"|"commitRequest"|undefined} request + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsRequest + * @instance + */ + Object.defineProperty(ReceivePacketsRequest.prototype, "request", { + get: $util.oneOfGetter($oneOfFields = ["setupRequest", "commitRequest"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ReceivePacketsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IReceivePacketsRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ReceivePacketsRequest} ReceivePacketsRequest instance + */ + ReceivePacketsRequest.create = function create(properties) { + return new ReceivePacketsRequest(properties); + }; + + /** + * Encodes the specified ReceivePacketsRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ReceivePacketsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IReceivePacketsRequest} message ReceivePacketsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReceivePacketsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.setupRequest != null && Object.hasOwnProperty.call(message, "setupRequest")) + $root.google.cloud.visionai.v1alpha1.ReceivePacketsRequest.SetupRequest.encode(message.setupRequest, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.commitRequest != null && Object.hasOwnProperty.call(message, "commitRequest")) + $root.google.cloud.visionai.v1alpha1.CommitRequest.encode(message.commitRequest, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReceivePacketsRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ReceivePacketsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IReceivePacketsRequest} message ReceivePacketsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReceivePacketsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReceivePacketsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ReceivePacketsRequest} ReceivePacketsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReceivePacketsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ReceivePacketsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 6: { + message.setupRequest = $root.google.cloud.visionai.v1alpha1.ReceivePacketsRequest.SetupRequest.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + message.commitRequest = $root.google.cloud.visionai.v1alpha1.CommitRequest.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ReceivePacketsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ReceivePacketsRequest} ReceivePacketsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReceivePacketsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReceivePacketsRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReceivePacketsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.setupRequest != null && message.hasOwnProperty("setupRequest")) { + properties.request = 1; + { + var error = $root.google.cloud.visionai.v1alpha1.ReceivePacketsRequest.SetupRequest.verify(message.setupRequest, long + 1); + if (error) + return "setupRequest." + error; + } + } + if (message.commitRequest != null && message.hasOwnProperty("commitRequest")) { + if (properties.request === 1) + return "request: multiple values"; + properties.request = 1; + { + var error = $root.google.cloud.visionai.v1alpha1.CommitRequest.verify(message.commitRequest, long + 1); + if (error) + return "commitRequest." + error; + } + } + return null; + }; + + /** + * Creates a ReceivePacketsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ReceivePacketsRequest} ReceivePacketsRequest + */ + ReceivePacketsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ReceivePacketsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ReceivePacketsRequest(); + if (object.setupRequest != null) { + if (typeof object.setupRequest !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ReceivePacketsRequest.setupRequest: object expected"); + message.setupRequest = $root.google.cloud.visionai.v1alpha1.ReceivePacketsRequest.SetupRequest.fromObject(object.setupRequest, long + 1); + } + if (object.commitRequest != null) { + if (typeof object.commitRequest !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ReceivePacketsRequest.commitRequest: object expected"); + message.commitRequest = $root.google.cloud.visionai.v1alpha1.CommitRequest.fromObject(object.commitRequest, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a ReceivePacketsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ReceivePacketsRequest} message ReceivePacketsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReceivePacketsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.setupRequest != null && message.hasOwnProperty("setupRequest")) { + object.setupRequest = $root.google.cloud.visionai.v1alpha1.ReceivePacketsRequest.SetupRequest.toObject(message.setupRequest, options); + if (options.oneofs) + object.request = "setupRequest"; + } + if (message.commitRequest != null && message.hasOwnProperty("commitRequest")) { + object.commitRequest = $root.google.cloud.visionai.v1alpha1.CommitRequest.toObject(message.commitRequest, options); + if (options.oneofs) + object.request = "commitRequest"; + } + return object; + }; + + /** + * Converts this ReceivePacketsRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsRequest + * @instance + * @returns {Object.} JSON object + */ + ReceivePacketsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReceivePacketsRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReceivePacketsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ReceivePacketsRequest"; + }; + + ReceivePacketsRequest.SetupRequest = (function() { + + /** + * Properties of a SetupRequest. + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsRequest + * @interface ISetupRequest + * @property {google.cloud.visionai.v1alpha1.IEagerMode|null} [eagerReceiveMode] SetupRequest eagerReceiveMode + * @property {google.cloud.visionai.v1alpha1.IControlledMode|null} [controlledReceiveMode] SetupRequest controlledReceiveMode + * @property {google.cloud.visionai.v1alpha1.IRequestMetadata|null} [metadata] SetupRequest metadata + * @property {string|null} [receiver] SetupRequest receiver + * @property {google.protobuf.IDuration|null} [heartbeatInterval] SetupRequest heartbeatInterval + * @property {google.protobuf.IDuration|null} [writesDoneGracePeriod] SetupRequest writesDoneGracePeriod + */ + + /** + * Constructs a new SetupRequest. + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsRequest + * @classdesc Represents a SetupRequest. + * @implements ISetupRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.ReceivePacketsRequest.ISetupRequest=} [properties] Properties to set + */ + function SetupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetupRequest eagerReceiveMode. + * @member {google.cloud.visionai.v1alpha1.IEagerMode|null|undefined} eagerReceiveMode + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsRequest.SetupRequest + * @instance + */ + SetupRequest.prototype.eagerReceiveMode = null; + + /** + * SetupRequest controlledReceiveMode. + * @member {google.cloud.visionai.v1alpha1.IControlledMode|null|undefined} controlledReceiveMode + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsRequest.SetupRequest + * @instance + */ + SetupRequest.prototype.controlledReceiveMode = null; + + /** + * SetupRequest metadata. + * @member {google.cloud.visionai.v1alpha1.IRequestMetadata|null|undefined} metadata + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsRequest.SetupRequest + * @instance + */ + SetupRequest.prototype.metadata = null; + + /** + * SetupRequest receiver. + * @member {string} receiver + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsRequest.SetupRequest + * @instance + */ + SetupRequest.prototype.receiver = ""; + + /** + * SetupRequest heartbeatInterval. + * @member {google.protobuf.IDuration|null|undefined} heartbeatInterval + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsRequest.SetupRequest + * @instance + */ + SetupRequest.prototype.heartbeatInterval = null; + + /** + * SetupRequest writesDoneGracePeriod. + * @member {google.protobuf.IDuration|null|undefined} writesDoneGracePeriod + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsRequest.SetupRequest + * @instance + */ + SetupRequest.prototype.writesDoneGracePeriod = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SetupRequest consumerMode. + * @member {"eagerReceiveMode"|"controlledReceiveMode"|undefined} consumerMode + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsRequest.SetupRequest + * @instance + */ + Object.defineProperty(SetupRequest.prototype, "consumerMode", { + get: $util.oneOfGetter($oneOfFields = ["eagerReceiveMode", "controlledReceiveMode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SetupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsRequest.SetupRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ReceivePacketsRequest.ISetupRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ReceivePacketsRequest.SetupRequest} SetupRequest instance + */ + SetupRequest.create = function create(properties) { + return new SetupRequest(properties); + }; + + /** + * Encodes the specified SetupRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ReceivePacketsRequest.SetupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsRequest.SetupRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ReceivePacketsRequest.ISetupRequest} message SetupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.cloud.visionai.v1alpha1.RequestMetadata.encode(message.metadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.receiver != null && Object.hasOwnProperty.call(message, "receiver")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.receiver); + if (message.eagerReceiveMode != null && Object.hasOwnProperty.call(message, "eagerReceiveMode")) + $root.google.cloud.visionai.v1alpha1.EagerMode.encode(message.eagerReceiveMode, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.controlledReceiveMode != null && Object.hasOwnProperty.call(message, "controlledReceiveMode")) + $root.google.cloud.visionai.v1alpha1.ControlledMode.encode(message.controlledReceiveMode, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.heartbeatInterval != null && Object.hasOwnProperty.call(message, "heartbeatInterval")) + $root.google.protobuf.Duration.encode(message.heartbeatInterval, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.writesDoneGracePeriod != null && Object.hasOwnProperty.call(message, "writesDoneGracePeriod")) + $root.google.protobuf.Duration.encode(message.writesDoneGracePeriod, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetupRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ReceivePacketsRequest.SetupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsRequest.SetupRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ReceivePacketsRequest.ISetupRequest} message SetupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsRequest.SetupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ReceivePacketsRequest.SetupRequest} SetupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetupRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ReceivePacketsRequest.SetupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.eagerReceiveMode = $root.google.cloud.visionai.v1alpha1.EagerMode.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.controlledReceiveMode = $root.google.cloud.visionai.v1alpha1.ControlledMode.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 1: { + message.metadata = $root.google.cloud.visionai.v1alpha1.RequestMetadata.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.receiver = reader.string(); + break; + } + case 5: { + message.heartbeatInterval = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.writesDoneGracePeriod = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SetupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsRequest.SetupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ReceivePacketsRequest.SetupRequest} SetupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetupRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsRequest.SetupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetupRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.eagerReceiveMode != null && message.hasOwnProperty("eagerReceiveMode")) { + properties.consumerMode = 1; + { + var error = $root.google.cloud.visionai.v1alpha1.EagerMode.verify(message.eagerReceiveMode, long + 1); + if (error) + return "eagerReceiveMode." + error; + } + } + if (message.controlledReceiveMode != null && message.hasOwnProperty("controlledReceiveMode")) { + if (properties.consumerMode === 1) + return "consumerMode: multiple values"; + properties.consumerMode = 1; + { + var error = $root.google.cloud.visionai.v1alpha1.ControlledMode.verify(message.controlledReceiveMode, long + 1); + if (error) + return "controlledReceiveMode." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.cloud.visionai.v1alpha1.RequestMetadata.verify(message.metadata, long + 1); + if (error) + return "metadata." + error; + } + if (message.receiver != null && message.hasOwnProperty("receiver")) + if (!$util.isString(message.receiver)) + return "receiver: string expected"; + if (message.heartbeatInterval != null && message.hasOwnProperty("heartbeatInterval")) { + var error = $root.google.protobuf.Duration.verify(message.heartbeatInterval, long + 1); + if (error) + return "heartbeatInterval." + error; + } + if (message.writesDoneGracePeriod != null && message.hasOwnProperty("writesDoneGracePeriod")) { + var error = $root.google.protobuf.Duration.verify(message.writesDoneGracePeriod, long + 1); + if (error) + return "writesDoneGracePeriod." + error; + } + return null; + }; + + /** + * Creates a SetupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsRequest.SetupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ReceivePacketsRequest.SetupRequest} SetupRequest + */ + SetupRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ReceivePacketsRequest.SetupRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ReceivePacketsRequest.SetupRequest(); + if (object.eagerReceiveMode != null) { + if (typeof object.eagerReceiveMode !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ReceivePacketsRequest.SetupRequest.eagerReceiveMode: object expected"); + message.eagerReceiveMode = $root.google.cloud.visionai.v1alpha1.EagerMode.fromObject(object.eagerReceiveMode, long + 1); + } + if (object.controlledReceiveMode != null) { + if (typeof object.controlledReceiveMode !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ReceivePacketsRequest.SetupRequest.controlledReceiveMode: object expected"); + message.controlledReceiveMode = $root.google.cloud.visionai.v1alpha1.ControlledMode.fromObject(object.controlledReceiveMode, long + 1); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ReceivePacketsRequest.SetupRequest.metadata: object expected"); + message.metadata = $root.google.cloud.visionai.v1alpha1.RequestMetadata.fromObject(object.metadata, long + 1); + } + if (object.receiver != null) + message.receiver = String(object.receiver); + if (object.heartbeatInterval != null) { + if (typeof object.heartbeatInterval !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ReceivePacketsRequest.SetupRequest.heartbeatInterval: object expected"); + message.heartbeatInterval = $root.google.protobuf.Duration.fromObject(object.heartbeatInterval, long + 1); + } + if (object.writesDoneGracePeriod != null) { + if (typeof object.writesDoneGracePeriod !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ReceivePacketsRequest.SetupRequest.writesDoneGracePeriod: object expected"); + message.writesDoneGracePeriod = $root.google.protobuf.Duration.fromObject(object.writesDoneGracePeriod, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a SetupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsRequest.SetupRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ReceivePacketsRequest.SetupRequest} message SetupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.metadata = null; + object.receiver = ""; + object.heartbeatInterval = null; + object.writesDoneGracePeriod = null; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.cloud.visionai.v1alpha1.RequestMetadata.toObject(message.metadata, options); + if (message.receiver != null && message.hasOwnProperty("receiver")) + object.receiver = message.receiver; + if (message.eagerReceiveMode != null && message.hasOwnProperty("eagerReceiveMode")) { + object.eagerReceiveMode = $root.google.cloud.visionai.v1alpha1.EagerMode.toObject(message.eagerReceiveMode, options); + if (options.oneofs) + object.consumerMode = "eagerReceiveMode"; + } + if (message.controlledReceiveMode != null && message.hasOwnProperty("controlledReceiveMode")) { + object.controlledReceiveMode = $root.google.cloud.visionai.v1alpha1.ControlledMode.toObject(message.controlledReceiveMode, options); + if (options.oneofs) + object.consumerMode = "controlledReceiveMode"; + } + if (message.heartbeatInterval != null && message.hasOwnProperty("heartbeatInterval")) + object.heartbeatInterval = $root.google.protobuf.Duration.toObject(message.heartbeatInterval, options); + if (message.writesDoneGracePeriod != null && message.hasOwnProperty("writesDoneGracePeriod")) + object.writesDoneGracePeriod = $root.google.protobuf.Duration.toObject(message.writesDoneGracePeriod, options); + return object; + }; + + /** + * Converts this SetupRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsRequest.SetupRequest + * @instance + * @returns {Object.} JSON object + */ + SetupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SetupRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsRequest.SetupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SetupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ReceivePacketsRequest.SetupRequest"; + }; + + return SetupRequest; + })(); + + return ReceivePacketsRequest; + })(); + + v1alpha1.ReceivePacketsControlResponse = (function() { + + /** + * Properties of a ReceivePacketsControlResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IReceivePacketsControlResponse + * @property {boolean|null} [heartbeat] ReceivePacketsControlResponse heartbeat + * @property {boolean|null} [writesDoneRequest] ReceivePacketsControlResponse writesDoneRequest + */ + + /** + * Constructs a new ReceivePacketsControlResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a ReceivePacketsControlResponse. + * @implements IReceivePacketsControlResponse + * @constructor + * @param {google.cloud.visionai.v1alpha1.IReceivePacketsControlResponse=} [properties] Properties to set + */ + function ReceivePacketsControlResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReceivePacketsControlResponse heartbeat. + * @member {boolean|null|undefined} heartbeat + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsControlResponse + * @instance + */ + ReceivePacketsControlResponse.prototype.heartbeat = null; + + /** + * ReceivePacketsControlResponse writesDoneRequest. + * @member {boolean|null|undefined} writesDoneRequest + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsControlResponse + * @instance + */ + ReceivePacketsControlResponse.prototype.writesDoneRequest = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ReceivePacketsControlResponse control. + * @member {"heartbeat"|"writesDoneRequest"|undefined} control + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsControlResponse + * @instance + */ + Object.defineProperty(ReceivePacketsControlResponse.prototype, "control", { + get: $util.oneOfGetter($oneOfFields = ["heartbeat", "writesDoneRequest"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ReceivePacketsControlResponse instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsControlResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IReceivePacketsControlResponse=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ReceivePacketsControlResponse} ReceivePacketsControlResponse instance + */ + ReceivePacketsControlResponse.create = function create(properties) { + return new ReceivePacketsControlResponse(properties); + }; + + /** + * Encodes the specified ReceivePacketsControlResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ReceivePacketsControlResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsControlResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IReceivePacketsControlResponse} message ReceivePacketsControlResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReceivePacketsControlResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.heartbeat != null && Object.hasOwnProperty.call(message, "heartbeat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.heartbeat); + if (message.writesDoneRequest != null && Object.hasOwnProperty.call(message, "writesDoneRequest")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.writesDoneRequest); + return writer; + }; + + /** + * Encodes the specified ReceivePacketsControlResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ReceivePacketsControlResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsControlResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IReceivePacketsControlResponse} message ReceivePacketsControlResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReceivePacketsControlResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReceivePacketsControlResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsControlResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ReceivePacketsControlResponse} ReceivePacketsControlResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReceivePacketsControlResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ReceivePacketsControlResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.heartbeat = reader.bool(); + break; + } + case 2: { + message.writesDoneRequest = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ReceivePacketsControlResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsControlResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ReceivePacketsControlResponse} ReceivePacketsControlResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReceivePacketsControlResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReceivePacketsControlResponse message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsControlResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReceivePacketsControlResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.heartbeat != null && message.hasOwnProperty("heartbeat")) { + properties.control = 1; + if (typeof message.heartbeat !== "boolean") + return "heartbeat: boolean expected"; + } + if (message.writesDoneRequest != null && message.hasOwnProperty("writesDoneRequest")) { + if (properties.control === 1) + return "control: multiple values"; + properties.control = 1; + if (typeof message.writesDoneRequest !== "boolean") + return "writesDoneRequest: boolean expected"; + } + return null; + }; + + /** + * Creates a ReceivePacketsControlResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsControlResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ReceivePacketsControlResponse} ReceivePacketsControlResponse + */ + ReceivePacketsControlResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ReceivePacketsControlResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ReceivePacketsControlResponse(); + if (object.heartbeat != null) + message.heartbeat = Boolean(object.heartbeat); + if (object.writesDoneRequest != null) + message.writesDoneRequest = Boolean(object.writesDoneRequest); + return message; + }; + + /** + * Creates a plain object from a ReceivePacketsControlResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsControlResponse + * @static + * @param {google.cloud.visionai.v1alpha1.ReceivePacketsControlResponse} message ReceivePacketsControlResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReceivePacketsControlResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.heartbeat != null && message.hasOwnProperty("heartbeat")) { + object.heartbeat = message.heartbeat; + if (options.oneofs) + object.control = "heartbeat"; + } + if (message.writesDoneRequest != null && message.hasOwnProperty("writesDoneRequest")) { + object.writesDoneRequest = message.writesDoneRequest; + if (options.oneofs) + object.control = "writesDoneRequest"; + } + return object; + }; + + /** + * Converts this ReceivePacketsControlResponse to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsControlResponse + * @instance + * @returns {Object.} JSON object + */ + ReceivePacketsControlResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReceivePacketsControlResponse + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsControlResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReceivePacketsControlResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ReceivePacketsControlResponse"; + }; + + return ReceivePacketsControlResponse; + })(); + + v1alpha1.ReceivePacketsResponse = (function() { + + /** + * Properties of a ReceivePacketsResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IReceivePacketsResponse + * @property {google.cloud.visionai.v1alpha1.IPacket|null} [packet] ReceivePacketsResponse packet + * @property {google.cloud.visionai.v1alpha1.IReceivePacketsControlResponse|null} [control] ReceivePacketsResponse control + */ + + /** + * Constructs a new ReceivePacketsResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a ReceivePacketsResponse. + * @implements IReceivePacketsResponse + * @constructor + * @param {google.cloud.visionai.v1alpha1.IReceivePacketsResponse=} [properties] Properties to set + */ + function ReceivePacketsResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReceivePacketsResponse packet. + * @member {google.cloud.visionai.v1alpha1.IPacket|null|undefined} packet + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsResponse + * @instance + */ + ReceivePacketsResponse.prototype.packet = null; + + /** + * ReceivePacketsResponse control. + * @member {google.cloud.visionai.v1alpha1.IReceivePacketsControlResponse|null|undefined} control + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsResponse + * @instance + */ + ReceivePacketsResponse.prototype.control = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ReceivePacketsResponse response. + * @member {"packet"|"control"|undefined} response + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsResponse + * @instance + */ + Object.defineProperty(ReceivePacketsResponse.prototype, "response", { + get: $util.oneOfGetter($oneOfFields = ["packet", "control"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ReceivePacketsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IReceivePacketsResponse=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ReceivePacketsResponse} ReceivePacketsResponse instance + */ + ReceivePacketsResponse.create = function create(properties) { + return new ReceivePacketsResponse(properties); + }; + + /** + * Encodes the specified ReceivePacketsResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ReceivePacketsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IReceivePacketsResponse} message ReceivePacketsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReceivePacketsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.packet != null && Object.hasOwnProperty.call(message, "packet")) + $root.google.cloud.visionai.v1alpha1.Packet.encode(message.packet, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.control != null && Object.hasOwnProperty.call(message, "control")) + $root.google.cloud.visionai.v1alpha1.ReceivePacketsControlResponse.encode(message.control, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReceivePacketsResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ReceivePacketsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IReceivePacketsResponse} message ReceivePacketsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReceivePacketsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReceivePacketsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ReceivePacketsResponse} ReceivePacketsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReceivePacketsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ReceivePacketsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.packet = $root.google.cloud.visionai.v1alpha1.Packet.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.control = $root.google.cloud.visionai.v1alpha1.ReceivePacketsControlResponse.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ReceivePacketsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ReceivePacketsResponse} ReceivePacketsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReceivePacketsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReceivePacketsResponse message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReceivePacketsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.packet != null && message.hasOwnProperty("packet")) { + properties.response = 1; + { + var error = $root.google.cloud.visionai.v1alpha1.Packet.verify(message.packet, long + 1); + if (error) + return "packet." + error; + } + } + if (message.control != null && message.hasOwnProperty("control")) { + if (properties.response === 1) + return "response: multiple values"; + properties.response = 1; + { + var error = $root.google.cloud.visionai.v1alpha1.ReceivePacketsControlResponse.verify(message.control, long + 1); + if (error) + return "control." + error; + } + } + return null; + }; + + /** + * Creates a ReceivePacketsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ReceivePacketsResponse} ReceivePacketsResponse + */ + ReceivePacketsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ReceivePacketsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ReceivePacketsResponse(); + if (object.packet != null) { + if (typeof object.packet !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ReceivePacketsResponse.packet: object expected"); + message.packet = $root.google.cloud.visionai.v1alpha1.Packet.fromObject(object.packet, long + 1); + } + if (object.control != null) { + if (typeof object.control !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ReceivePacketsResponse.control: object expected"); + message.control = $root.google.cloud.visionai.v1alpha1.ReceivePacketsControlResponse.fromObject(object.control, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a ReceivePacketsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsResponse + * @static + * @param {google.cloud.visionai.v1alpha1.ReceivePacketsResponse} message ReceivePacketsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReceivePacketsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.packet != null && message.hasOwnProperty("packet")) { + object.packet = $root.google.cloud.visionai.v1alpha1.Packet.toObject(message.packet, options); + if (options.oneofs) + object.response = "packet"; + } + if (message.control != null && message.hasOwnProperty("control")) { + object.control = $root.google.cloud.visionai.v1alpha1.ReceivePacketsControlResponse.toObject(message.control, options); + if (options.oneofs) + object.response = "control"; + } + return object; + }; + + /** + * Converts this ReceivePacketsResponse to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsResponse + * @instance + * @returns {Object.} JSON object + */ + ReceivePacketsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReceivePacketsResponse + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ReceivePacketsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReceivePacketsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ReceivePacketsResponse"; + }; + + return ReceivePacketsResponse; + })(); + + v1alpha1.EagerMode = (function() { + + /** + * Properties of an EagerMode. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IEagerMode + */ + + /** + * Constructs a new EagerMode. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents an EagerMode. + * @implements IEagerMode + * @constructor + * @param {google.cloud.visionai.v1alpha1.IEagerMode=} [properties] Properties to set + */ + function EagerMode(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new EagerMode instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.EagerMode + * @static + * @param {google.cloud.visionai.v1alpha1.IEagerMode=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.EagerMode} EagerMode instance + */ + EagerMode.create = function create(properties) { + return new EagerMode(properties); + }; + + /** + * Encodes the specified EagerMode message. Does not implicitly {@link google.cloud.visionai.v1alpha1.EagerMode.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.EagerMode + * @static + * @param {google.cloud.visionai.v1alpha1.IEagerMode} message EagerMode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EagerMode.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified EagerMode message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.EagerMode.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.EagerMode + * @static + * @param {google.cloud.visionai.v1alpha1.IEagerMode} message EagerMode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EagerMode.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EagerMode message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.EagerMode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.EagerMode} EagerMode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EagerMode.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.EagerMode(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an EagerMode message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.EagerMode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.EagerMode} EagerMode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EagerMode.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EagerMode message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.EagerMode + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EagerMode.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates an EagerMode message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.EagerMode + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.EagerMode} EagerMode + */ + EagerMode.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.EagerMode) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.google.cloud.visionai.v1alpha1.EagerMode(); + }; + + /** + * Creates a plain object from an EagerMode message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.EagerMode + * @static + * @param {google.cloud.visionai.v1alpha1.EagerMode} message EagerMode + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EagerMode.toObject = function toObject() { + return {}; + }; + + /** + * Converts this EagerMode to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.EagerMode + * @instance + * @returns {Object.} JSON object + */ + EagerMode.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EagerMode + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.EagerMode + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EagerMode.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.EagerMode"; + }; + + return EagerMode; + })(); + + v1alpha1.ControlledMode = (function() { + + /** + * Properties of a ControlledMode. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IControlledMode + * @property {string|null} [startingLogicalOffset] ControlledMode startingLogicalOffset + * @property {string|null} [fallbackStartingOffset] ControlledMode fallbackStartingOffset + */ + + /** + * Constructs a new ControlledMode. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a ControlledMode. + * @implements IControlledMode + * @constructor + * @param {google.cloud.visionai.v1alpha1.IControlledMode=} [properties] Properties to set + */ + function ControlledMode(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ControlledMode startingLogicalOffset. + * @member {string|null|undefined} startingLogicalOffset + * @memberof google.cloud.visionai.v1alpha1.ControlledMode + * @instance + */ + ControlledMode.prototype.startingLogicalOffset = null; + + /** + * ControlledMode fallbackStartingOffset. + * @member {string} fallbackStartingOffset + * @memberof google.cloud.visionai.v1alpha1.ControlledMode + * @instance + */ + ControlledMode.prototype.fallbackStartingOffset = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ControlledMode startingOffset. + * @member {"startingLogicalOffset"|undefined} startingOffset + * @memberof google.cloud.visionai.v1alpha1.ControlledMode + * @instance + */ + Object.defineProperty(ControlledMode.prototype, "startingOffset", { + get: $util.oneOfGetter($oneOfFields = ["startingLogicalOffset"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ControlledMode instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ControlledMode + * @static + * @param {google.cloud.visionai.v1alpha1.IControlledMode=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ControlledMode} ControlledMode instance + */ + ControlledMode.create = function create(properties) { + return new ControlledMode(properties); + }; + + /** + * Encodes the specified ControlledMode message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ControlledMode.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ControlledMode + * @static + * @param {google.cloud.visionai.v1alpha1.IControlledMode} message ControlledMode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ControlledMode.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startingLogicalOffset != null && Object.hasOwnProperty.call(message, "startingLogicalOffset")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.startingLogicalOffset); + if (message.fallbackStartingOffset != null && Object.hasOwnProperty.call(message, "fallbackStartingOffset")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fallbackStartingOffset); + return writer; + }; + + /** + * Encodes the specified ControlledMode message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ControlledMode.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ControlledMode + * @static + * @param {google.cloud.visionai.v1alpha1.IControlledMode} message ControlledMode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ControlledMode.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ControlledMode message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ControlledMode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ControlledMode} ControlledMode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ControlledMode.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ControlledMode(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.startingLogicalOffset = reader.string(); + break; + } + case 2: { + message.fallbackStartingOffset = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ControlledMode message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ControlledMode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ControlledMode} ControlledMode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ControlledMode.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ControlledMode message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ControlledMode + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ControlledMode.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.startingLogicalOffset != null && message.hasOwnProperty("startingLogicalOffset")) { + properties.startingOffset = 1; + if (!$util.isString(message.startingLogicalOffset)) + return "startingLogicalOffset: string expected"; + } + if (message.fallbackStartingOffset != null && message.hasOwnProperty("fallbackStartingOffset")) + if (!$util.isString(message.fallbackStartingOffset)) + return "fallbackStartingOffset: string expected"; + return null; + }; + + /** + * Creates a ControlledMode message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ControlledMode + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ControlledMode} ControlledMode + */ + ControlledMode.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ControlledMode) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ControlledMode(); + if (object.startingLogicalOffset != null) + message.startingLogicalOffset = String(object.startingLogicalOffset); + if (object.fallbackStartingOffset != null) + message.fallbackStartingOffset = String(object.fallbackStartingOffset); + return message; + }; + + /** + * Creates a plain object from a ControlledMode message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ControlledMode + * @static + * @param {google.cloud.visionai.v1alpha1.ControlledMode} message ControlledMode + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ControlledMode.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.fallbackStartingOffset = ""; + if (message.startingLogicalOffset != null && message.hasOwnProperty("startingLogicalOffset")) { + object.startingLogicalOffset = message.startingLogicalOffset; + if (options.oneofs) + object.startingOffset = "startingLogicalOffset"; + } + if (message.fallbackStartingOffset != null && message.hasOwnProperty("fallbackStartingOffset")) + object.fallbackStartingOffset = message.fallbackStartingOffset; + return object; + }; + + /** + * Converts this ControlledMode to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ControlledMode + * @instance + * @returns {Object.} JSON object + */ + ControlledMode.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ControlledMode + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ControlledMode + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ControlledMode.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ControlledMode"; + }; + + return ControlledMode; + })(); + + v1alpha1.CommitRequest = (function() { + + /** + * Properties of a CommitRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface ICommitRequest + * @property {number|Long|null} [offset] CommitRequest offset + */ + + /** + * Constructs a new CommitRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a CommitRequest. + * @implements ICommitRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.ICommitRequest=} [properties] Properties to set + */ + function CommitRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommitRequest offset. + * @member {number|Long} offset + * @memberof google.cloud.visionai.v1alpha1.CommitRequest + * @instance + */ + CommitRequest.prototype.offset = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new CommitRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.CommitRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ICommitRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.CommitRequest} CommitRequest instance + */ + CommitRequest.create = function create(properties) { + return new CommitRequest(properties); + }; + + /** + * Encodes the specified CommitRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.CommitRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.CommitRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ICommitRequest} message CommitRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommitRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.offset); + return writer; + }; + + /** + * Encodes the specified CommitRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.CommitRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.CommitRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ICommitRequest} message CommitRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommitRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommitRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.CommitRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.CommitRequest} CommitRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommitRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.CommitRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.offset = reader.int64(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CommitRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.CommitRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.CommitRequest} CommitRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommitRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommitRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.CommitRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommitRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.offset != null && message.hasOwnProperty("offset")) + if (!$util.isInteger(message.offset) && !(message.offset && $util.isInteger(message.offset.low) && $util.isInteger(message.offset.high))) + return "offset: integer|Long expected"; + return null; + }; + + /** + * Creates a CommitRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.CommitRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.CommitRequest} CommitRequest + */ + CommitRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.CommitRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.CommitRequest(); + if (object.offset != null) + if ($util.Long) + (message.offset = $util.Long.fromValue(object.offset)).unsigned = false; + else if (typeof object.offset === "string") + message.offset = parseInt(object.offset, 10); + else if (typeof object.offset === "number") + message.offset = object.offset; + else if (typeof object.offset === "object") + message.offset = new $util.LongBits(object.offset.low >>> 0, object.offset.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a CommitRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.CommitRequest + * @static + * @param {google.cloud.visionai.v1alpha1.CommitRequest} message CommitRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommitRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.offset = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.offset = options.longs === String ? "0" : 0; + if (message.offset != null && message.hasOwnProperty("offset")) + if (typeof message.offset === "number") + object.offset = options.longs === String ? String(message.offset) : message.offset; + else + object.offset = options.longs === String ? $util.Long.prototype.toString.call(message.offset) : options.longs === Number ? new $util.LongBits(message.offset.low >>> 0, message.offset.high >>> 0).toNumber() : message.offset; + return object; + }; + + /** + * Converts this CommitRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.CommitRequest + * @instance + * @returns {Object.} JSON object + */ + CommitRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommitRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.CommitRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommitRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.CommitRequest"; + }; + + return CommitRequest; + })(); + + v1alpha1.Stream = (function() { + + /** + * Properties of a Stream. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IStream + * @property {string|null} [name] Stream name + * @property {google.protobuf.ITimestamp|null} [createTime] Stream createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Stream updateTime + * @property {Object.|null} [labels] Stream labels + * @property {Object.|null} [annotations] Stream annotations + * @property {string|null} [displayName] Stream displayName + * @property {boolean|null} [enableHlsPlayback] Stream enableHlsPlayback + * @property {string|null} [mediaWarehouseAsset] Stream mediaWarehouseAsset + */ + + /** + * Constructs a new Stream. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a Stream. + * @implements IStream + * @constructor + * @param {google.cloud.visionai.v1alpha1.IStream=} [properties] Properties to set + */ + function Stream(properties) { + this.labels = {}; + this.annotations = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Stream name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.Stream + * @instance + */ + Stream.prototype.name = ""; + + /** + * Stream createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.visionai.v1alpha1.Stream + * @instance + */ + Stream.prototype.createTime = null; + + /** + * Stream updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.visionai.v1alpha1.Stream + * @instance + */ + Stream.prototype.updateTime = null; + + /** + * Stream labels. + * @member {Object.} labels + * @memberof google.cloud.visionai.v1alpha1.Stream + * @instance + */ + Stream.prototype.labels = $util.emptyObject; + + /** + * Stream annotations. + * @member {Object.} annotations + * @memberof google.cloud.visionai.v1alpha1.Stream + * @instance + */ + Stream.prototype.annotations = $util.emptyObject; + + /** + * Stream displayName. + * @member {string} displayName + * @memberof google.cloud.visionai.v1alpha1.Stream + * @instance + */ + Stream.prototype.displayName = ""; + + /** + * Stream enableHlsPlayback. + * @member {boolean} enableHlsPlayback + * @memberof google.cloud.visionai.v1alpha1.Stream + * @instance + */ + Stream.prototype.enableHlsPlayback = false; + + /** + * Stream mediaWarehouseAsset. + * @member {string} mediaWarehouseAsset + * @memberof google.cloud.visionai.v1alpha1.Stream + * @instance + */ + Stream.prototype.mediaWarehouseAsset = ""; + + /** + * Creates a new Stream instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.Stream + * @static + * @param {google.cloud.visionai.v1alpha1.IStream=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.Stream} Stream instance + */ + Stream.create = function create(properties) { + return new Stream(properties); + }; + + /** + * Encodes the specified Stream message. Does not implicitly {@link google.cloud.visionai.v1alpha1.Stream.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.Stream + * @static + * @param {google.cloud.visionai.v1alpha1.IStream} message Stream message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Stream.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.displayName); + if (message.enableHlsPlayback != null && Object.hasOwnProperty.call(message, "enableHlsPlayback")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.enableHlsPlayback); + if (message.mediaWarehouseAsset != null && Object.hasOwnProperty.call(message, "mediaWarehouseAsset")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.mediaWarehouseAsset); + return writer; + }; + + /** + * Encodes the specified Stream message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.Stream.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.Stream + * @static + * @param {google.cloud.visionai.v1alpha1.IStream} message Stream message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Stream.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Stream message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.Stream + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.Stream} Stream + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Stream.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.Stream(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.labels, key); + message.labels[key] = value; + break; + } + case 5: { + if (message.annotations === $util.emptyObject) + message.annotations = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.annotations, key); + message.annotations[key] = value; + break; + } + case 6: { + message.displayName = reader.string(); + break; + } + case 7: { + message.enableHlsPlayback = reader.bool(); + break; + } + case 8: { + message.mediaWarehouseAsset = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Stream message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.Stream + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.Stream} Stream + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Stream.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Stream message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.Stream + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Stream.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime, long + 1); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime, long + 1); + if (error) + return "updateTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!$util.isObject(message.annotations)) + return "annotations: object expected"; + var key = Object.keys(message.annotations); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.annotations[key[i]])) + return "annotations: string{k:string} expected"; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.enableHlsPlayback != null && message.hasOwnProperty("enableHlsPlayback")) + if (typeof message.enableHlsPlayback !== "boolean") + return "enableHlsPlayback: boolean expected"; + if (message.mediaWarehouseAsset != null && message.hasOwnProperty("mediaWarehouseAsset")) + if (!$util.isString(message.mediaWarehouseAsset)) + return "mediaWarehouseAsset: string expected"; + return null; + }; + + /** + * Creates a Stream message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.Stream + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.Stream} Stream + */ + Stream.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.Stream) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.Stream(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Stream.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime, long + 1); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Stream.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime, long + 1); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Stream.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.labels, keys[i]); + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + } + if (object.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Stream.annotations: object expected"); + message.annotations = {}; + for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.annotations, keys[i]); + message.annotations[keys[i]] = String(object.annotations[keys[i]]); + } + } + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.enableHlsPlayback != null) + message.enableHlsPlayback = Boolean(object.enableHlsPlayback); + if (object.mediaWarehouseAsset != null) + message.mediaWarehouseAsset = String(object.mediaWarehouseAsset); + return message; + }; + + /** + * Creates a plain object from a Stream message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.Stream + * @static + * @param {google.cloud.visionai.v1alpha1.Stream} message Stream + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Stream.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.labels = {}; + object.annotations = {}; + } + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.displayName = ""; + object.enableHlsPlayback = false; + object.mediaWarehouseAsset = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.labels, keys2[j]); + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + } + if (message.annotations && (keys2 = Object.keys(message.annotations)).length) { + object.annotations = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.annotations, keys2[j]); + object.annotations[keys2[j]] = message.annotations[keys2[j]]; + } + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.enableHlsPlayback != null && message.hasOwnProperty("enableHlsPlayback")) + object.enableHlsPlayback = message.enableHlsPlayback; + if (message.mediaWarehouseAsset != null && message.hasOwnProperty("mediaWarehouseAsset")) + object.mediaWarehouseAsset = message.mediaWarehouseAsset; + return object; + }; + + /** + * Converts this Stream to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.Stream + * @instance + * @returns {Object.} JSON object + */ + Stream.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Stream + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.Stream + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Stream.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.Stream"; + }; + + return Stream; + })(); + + v1alpha1.Event = (function() { + + /** + * Properties of an Event. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IEvent + * @property {string|null} [name] Event name + * @property {google.protobuf.ITimestamp|null} [createTime] Event createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Event updateTime + * @property {Object.|null} [labels] Event labels + * @property {Object.|null} [annotations] Event annotations + * @property {google.cloud.visionai.v1alpha1.Event.Clock|null} [alignmentClock] Event alignmentClock + * @property {google.protobuf.IDuration|null} [gracePeriod] Event gracePeriod + */ + + /** + * Constructs a new Event. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents an Event. + * @implements IEvent + * @constructor + * @param {google.cloud.visionai.v1alpha1.IEvent=} [properties] Properties to set + */ + function Event(properties) { + this.labels = {}; + this.annotations = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Event name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.Event + * @instance + */ + Event.prototype.name = ""; + + /** + * Event createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.visionai.v1alpha1.Event + * @instance + */ + Event.prototype.createTime = null; + + /** + * Event updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.visionai.v1alpha1.Event + * @instance + */ + Event.prototype.updateTime = null; + + /** + * Event labels. + * @member {Object.} labels + * @memberof google.cloud.visionai.v1alpha1.Event + * @instance + */ + Event.prototype.labels = $util.emptyObject; + + /** + * Event annotations. + * @member {Object.} annotations + * @memberof google.cloud.visionai.v1alpha1.Event + * @instance + */ + Event.prototype.annotations = $util.emptyObject; + + /** + * Event alignmentClock. + * @member {google.cloud.visionai.v1alpha1.Event.Clock} alignmentClock + * @memberof google.cloud.visionai.v1alpha1.Event + * @instance + */ + Event.prototype.alignmentClock = 0; + + /** + * Event gracePeriod. + * @member {google.protobuf.IDuration|null|undefined} gracePeriod + * @memberof google.cloud.visionai.v1alpha1.Event + * @instance + */ + Event.prototype.gracePeriod = null; + + /** + * Creates a new Event instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.Event + * @static + * @param {google.cloud.visionai.v1alpha1.IEvent=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.Event} Event instance + */ + Event.create = function create(properties) { + return new Event(properties); + }; + + /** + * Encodes the specified Event message. Does not implicitly {@link google.cloud.visionai.v1alpha1.Event.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.Event + * @static + * @param {google.cloud.visionai.v1alpha1.IEvent} message Event message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Event.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + if (message.alignmentClock != null && Object.hasOwnProperty.call(message, "alignmentClock")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.alignmentClock); + if (message.gracePeriod != null && Object.hasOwnProperty.call(message, "gracePeriod")) + $root.google.protobuf.Duration.encode(message.gracePeriod, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Event message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.Event.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.Event + * @static + * @param {google.cloud.visionai.v1alpha1.IEvent} message Event message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Event.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Event message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.Event + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.Event} Event + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Event.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.Event(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.labels, key); + message.labels[key] = value; + break; + } + case 5: { + if (message.annotations === $util.emptyObject) + message.annotations = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.annotations, key); + message.annotations[key] = value; + break; + } + case 6: { + message.alignmentClock = reader.int32(); + break; + } + case 7: { + message.gracePeriod = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an Event message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.Event + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.Event} Event + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Event.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Event message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.Event + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Event.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime, long + 1); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime, long + 1); + if (error) + return "updateTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!$util.isObject(message.annotations)) + return "annotations: object expected"; + var key = Object.keys(message.annotations); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.annotations[key[i]])) + return "annotations: string{k:string} expected"; + } + if (message.alignmentClock != null && message.hasOwnProperty("alignmentClock")) + switch (message.alignmentClock) { + default: + return "alignmentClock: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.gracePeriod != null && message.hasOwnProperty("gracePeriod")) { + var error = $root.google.protobuf.Duration.verify(message.gracePeriod, long + 1); + if (error) + return "gracePeriod." + error; + } + return null; + }; + + /** + * Creates an Event message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.Event + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.Event} Event + */ + Event.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.Event) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.Event(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Event.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime, long + 1); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Event.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime, long + 1); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Event.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.labels, keys[i]); + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + } + if (object.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Event.annotations: object expected"); + message.annotations = {}; + for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.annotations, keys[i]); + message.annotations[keys[i]] = String(object.annotations[keys[i]]); + } + } + switch (object.alignmentClock) { + default: + if (typeof object.alignmentClock === "number") { + message.alignmentClock = object.alignmentClock; + break; + } + break; + case "CLOCK_UNSPECIFIED": + case 0: + message.alignmentClock = 0; + break; + case "CAPTURE": + case 1: + message.alignmentClock = 1; + break; + case "INGEST": + case 2: + message.alignmentClock = 2; + break; + } + if (object.gracePeriod != null) { + if (typeof object.gracePeriod !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Event.gracePeriod: object expected"); + message.gracePeriod = $root.google.protobuf.Duration.fromObject(object.gracePeriod, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an Event message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.Event + * @static + * @param {google.cloud.visionai.v1alpha1.Event} message Event + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Event.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.labels = {}; + object.annotations = {}; + } + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.alignmentClock = options.enums === String ? "CLOCK_UNSPECIFIED" : 0; + object.gracePeriod = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.labels, keys2[j]); + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + } + if (message.annotations && (keys2 = Object.keys(message.annotations)).length) { + object.annotations = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.annotations, keys2[j]); + object.annotations[keys2[j]] = message.annotations[keys2[j]]; + } + } + if (message.alignmentClock != null && message.hasOwnProperty("alignmentClock")) + object.alignmentClock = options.enums === String ? $root.google.cloud.visionai.v1alpha1.Event.Clock[message.alignmentClock] === undefined ? message.alignmentClock : $root.google.cloud.visionai.v1alpha1.Event.Clock[message.alignmentClock] : message.alignmentClock; + if (message.gracePeriod != null && message.hasOwnProperty("gracePeriod")) + object.gracePeriod = $root.google.protobuf.Duration.toObject(message.gracePeriod, options); + return object; + }; + + /** + * Converts this Event to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.Event + * @instance + * @returns {Object.} JSON object + */ + Event.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Event + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.Event + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Event.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.Event"; + }; + + /** + * Clock enum. + * @name google.cloud.visionai.v1alpha1.Event.Clock + * @enum {number} + * @property {number} CLOCK_UNSPECIFIED=0 CLOCK_UNSPECIFIED value + * @property {number} CAPTURE=1 CAPTURE value + * @property {number} INGEST=2 INGEST value + */ + Event.Clock = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLOCK_UNSPECIFIED"] = 0; + values[valuesById[1] = "CAPTURE"] = 1; + values[valuesById[2] = "INGEST"] = 2; + return values; + })(); + + return Event; + })(); + + v1alpha1.Series = (function() { + + /** + * Properties of a Series. + * @memberof google.cloud.visionai.v1alpha1 + * @interface ISeries + * @property {string|null} [name] Series name + * @property {google.protobuf.ITimestamp|null} [createTime] Series createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Series updateTime + * @property {Object.|null} [labels] Series labels + * @property {Object.|null} [annotations] Series annotations + * @property {string|null} [stream] Series stream + * @property {string|null} [event] Series event + */ + + /** + * Constructs a new Series. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a Series. + * @implements ISeries + * @constructor + * @param {google.cloud.visionai.v1alpha1.ISeries=} [properties] Properties to set + */ + function Series(properties) { + this.labels = {}; + this.annotations = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Series name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.Series + * @instance + */ + Series.prototype.name = ""; + + /** + * Series createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.visionai.v1alpha1.Series + * @instance + */ + Series.prototype.createTime = null; + + /** + * Series updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.visionai.v1alpha1.Series + * @instance + */ + Series.prototype.updateTime = null; + + /** + * Series labels. + * @member {Object.} labels + * @memberof google.cloud.visionai.v1alpha1.Series + * @instance + */ + Series.prototype.labels = $util.emptyObject; + + /** + * Series annotations. + * @member {Object.} annotations + * @memberof google.cloud.visionai.v1alpha1.Series + * @instance + */ + Series.prototype.annotations = $util.emptyObject; + + /** + * Series stream. + * @member {string} stream + * @memberof google.cloud.visionai.v1alpha1.Series + * @instance + */ + Series.prototype.stream = ""; + + /** + * Series event. + * @member {string} event + * @memberof google.cloud.visionai.v1alpha1.Series + * @instance + */ + Series.prototype.event = ""; + + /** + * Creates a new Series instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.Series + * @static + * @param {google.cloud.visionai.v1alpha1.ISeries=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.Series} Series instance + */ + Series.create = function create(properties) { + return new Series(properties); + }; + + /** + * Encodes the specified Series message. Does not implicitly {@link google.cloud.visionai.v1alpha1.Series.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.Series + * @static + * @param {google.cloud.visionai.v1alpha1.ISeries} message Series message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Series.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + if (message.stream != null && Object.hasOwnProperty.call(message, "stream")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.stream); + if (message.event != null && Object.hasOwnProperty.call(message, "event")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.event); + return writer; + }; + + /** + * Encodes the specified Series message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.Series.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.Series + * @static + * @param {google.cloud.visionai.v1alpha1.ISeries} message Series message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Series.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Series message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.Series + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.Series} Series + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Series.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.Series(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.labels, key); + message.labels[key] = value; + break; + } + case 5: { + if (message.annotations === $util.emptyObject) + message.annotations = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.annotations, key); + message.annotations[key] = value; + break; + } + case 6: { + message.stream = reader.string(); + break; + } + case 7: { + message.event = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Series message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.Series + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.Series} Series + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Series.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Series message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.Series + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Series.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime, long + 1); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime, long + 1); + if (error) + return "updateTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!$util.isObject(message.annotations)) + return "annotations: object expected"; + var key = Object.keys(message.annotations); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.annotations[key[i]])) + return "annotations: string{k:string} expected"; + } + if (message.stream != null && message.hasOwnProperty("stream")) + if (!$util.isString(message.stream)) + return "stream: string expected"; + if (message.event != null && message.hasOwnProperty("event")) + if (!$util.isString(message.event)) + return "event: string expected"; + return null; + }; + + /** + * Creates a Series message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.Series + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.Series} Series + */ + Series.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.Series) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.Series(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Series.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime, long + 1); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Series.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime, long + 1); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Series.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.labels, keys[i]); + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + } + if (object.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Series.annotations: object expected"); + message.annotations = {}; + for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.annotations, keys[i]); + message.annotations[keys[i]] = String(object.annotations[keys[i]]); + } + } + if (object.stream != null) + message.stream = String(object.stream); + if (object.event != null) + message.event = String(object.event); + return message; + }; + + /** + * Creates a plain object from a Series message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.Series + * @static + * @param {google.cloud.visionai.v1alpha1.Series} message Series + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Series.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.labels = {}; + object.annotations = {}; + } + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.stream = ""; + object.event = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.labels, keys2[j]); + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + } + if (message.annotations && (keys2 = Object.keys(message.annotations)).length) { + object.annotations = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.annotations, keys2[j]); + object.annotations[keys2[j]] = message.annotations[keys2[j]]; + } + } + if (message.stream != null && message.hasOwnProperty("stream")) + object.stream = message.stream; + if (message.event != null && message.hasOwnProperty("event")) + object.event = message.event; + return object; + }; + + /** + * Converts this Series to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.Series + * @instance + * @returns {Object.} JSON object + */ + Series.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Series + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.Series + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Series.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.Series"; + }; + + return Series; + })(); + + v1alpha1.Channel = (function() { + + /** + * Properties of a Channel. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IChannel + * @property {string|null} [name] Channel name + * @property {google.protobuf.ITimestamp|null} [createTime] Channel createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Channel updateTime + * @property {Object.|null} [labels] Channel labels + * @property {Object.|null} [annotations] Channel annotations + * @property {string|null} [stream] Channel stream + * @property {string|null} [event] Channel event + */ + + /** + * Constructs a new Channel. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a Channel. + * @implements IChannel + * @constructor + * @param {google.cloud.visionai.v1alpha1.IChannel=} [properties] Properties to set + */ + function Channel(properties) { + this.labels = {}; + this.annotations = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Channel name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.Channel + * @instance + */ + Channel.prototype.name = ""; + + /** + * Channel createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.visionai.v1alpha1.Channel + * @instance + */ + Channel.prototype.createTime = null; + + /** + * Channel updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.visionai.v1alpha1.Channel + * @instance + */ + Channel.prototype.updateTime = null; + + /** + * Channel labels. + * @member {Object.} labels + * @memberof google.cloud.visionai.v1alpha1.Channel + * @instance + */ + Channel.prototype.labels = $util.emptyObject; + + /** + * Channel annotations. + * @member {Object.} annotations + * @memberof google.cloud.visionai.v1alpha1.Channel + * @instance + */ + Channel.prototype.annotations = $util.emptyObject; + + /** + * Channel stream. + * @member {string} stream + * @memberof google.cloud.visionai.v1alpha1.Channel + * @instance + */ + Channel.prototype.stream = ""; + + /** + * Channel event. + * @member {string} event + * @memberof google.cloud.visionai.v1alpha1.Channel + * @instance + */ + Channel.prototype.event = ""; + + /** + * Creates a new Channel instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.Channel + * @static + * @param {google.cloud.visionai.v1alpha1.IChannel=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.Channel} Channel instance + */ + Channel.create = function create(properties) { + return new Channel(properties); + }; + + /** + * Encodes the specified Channel message. Does not implicitly {@link google.cloud.visionai.v1alpha1.Channel.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.Channel + * @static + * @param {google.cloud.visionai.v1alpha1.IChannel} message Channel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Channel.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + if (message.stream != null && Object.hasOwnProperty.call(message, "stream")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.stream); + if (message.event != null && Object.hasOwnProperty.call(message, "event")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.event); + return writer; + }; + + /** + * Encodes the specified Channel message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.Channel.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.Channel + * @static + * @param {google.cloud.visionai.v1alpha1.IChannel} message Channel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Channel.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Channel message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.Channel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.Channel} Channel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Channel.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.Channel(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.labels, key); + message.labels[key] = value; + break; + } + case 5: { + if (message.annotations === $util.emptyObject) + message.annotations = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.annotations, key); + message.annotations[key] = value; + break; + } + case 6: { + message.stream = reader.string(); + break; + } + case 7: { + message.event = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Channel message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.Channel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.Channel} Channel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Channel.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Channel message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.Channel + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Channel.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime, long + 1); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime, long + 1); + if (error) + return "updateTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!$util.isObject(message.annotations)) + return "annotations: object expected"; + var key = Object.keys(message.annotations); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.annotations[key[i]])) + return "annotations: string{k:string} expected"; + } + if (message.stream != null && message.hasOwnProperty("stream")) + if (!$util.isString(message.stream)) + return "stream: string expected"; + if (message.event != null && message.hasOwnProperty("event")) + if (!$util.isString(message.event)) + return "event: string expected"; + return null; + }; + + /** + * Creates a Channel message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.Channel + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.Channel} Channel + */ + Channel.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.Channel) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.Channel(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Channel.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime, long + 1); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Channel.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime, long + 1); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Channel.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.labels, keys[i]); + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + } + if (object.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Channel.annotations: object expected"); + message.annotations = {}; + for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.annotations, keys[i]); + message.annotations[keys[i]] = String(object.annotations[keys[i]]); + } + } + if (object.stream != null) + message.stream = String(object.stream); + if (object.event != null) + message.event = String(object.event); + return message; + }; + + /** + * Creates a plain object from a Channel message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.Channel + * @static + * @param {google.cloud.visionai.v1alpha1.Channel} message Channel + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Channel.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.labels = {}; + object.annotations = {}; + } + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.stream = ""; + object.event = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.labels, keys2[j]); + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + } + if (message.annotations && (keys2 = Object.keys(message.annotations)).length) { + object.annotations = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.annotations, keys2[j]); + object.annotations[keys2[j]] = message.annotations[keys2[j]]; + } + } + if (message.stream != null && message.hasOwnProperty("stream")) + object.stream = message.stream; + if (message.event != null && message.hasOwnProperty("event")) + object.event = message.event; + return object; + }; + + /** + * Converts this Channel to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.Channel + * @instance + * @returns {Object.} JSON object + */ + Channel.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Channel + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.Channel + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Channel.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.Channel"; + }; + + return Channel; + })(); + + v1alpha1.StreamsService = (function() { + + /** + * Constructs a new StreamsService service. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a StreamsService + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function StreamsService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (StreamsService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = StreamsService; + + /** + * Creates new StreamsService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {StreamsService} RPC service. Useful where requests and/or responses are streamed. + */ + StreamsService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.StreamsService|listClusters}. + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @typedef ListClustersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.visionai.v1alpha1.ListClustersResponse} [response] ListClustersResponse + */ + + /** + * Calls ListClusters. + * @function listClusters + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @instance + * @param {google.cloud.visionai.v1alpha1.IListClustersRequest} request ListClustersRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.StreamsService.ListClustersCallback} callback Node-style callback called with the error, if any, and ListClustersResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StreamsService.prototype.listClusters = function listClusters(request, callback) { + return this.rpcCall(listClusters, $root.google.cloud.visionai.v1alpha1.ListClustersRequest, $root.google.cloud.visionai.v1alpha1.ListClustersResponse, request, callback); + }, "name", { value: "ListClusters" }); + + /** + * Calls ListClusters. + * @function listClusters + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @instance + * @param {google.cloud.visionai.v1alpha1.IListClustersRequest} request ListClustersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.StreamsService|getCluster}. + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @typedef GetClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.visionai.v1alpha1.Cluster} [response] Cluster + */ + + /** + * Calls GetCluster. + * @function getCluster + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @instance + * @param {google.cloud.visionai.v1alpha1.IGetClusterRequest} request GetClusterRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.StreamsService.GetClusterCallback} callback Node-style callback called with the error, if any, and Cluster + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StreamsService.prototype.getCluster = function getCluster(request, callback) { + return this.rpcCall(getCluster, $root.google.cloud.visionai.v1alpha1.GetClusterRequest, $root.google.cloud.visionai.v1alpha1.Cluster, request, callback); + }, "name", { value: "GetCluster" }); + + /** + * Calls GetCluster. + * @function getCluster + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @instance + * @param {google.cloud.visionai.v1alpha1.IGetClusterRequest} request GetClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.StreamsService|createCluster}. + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @typedef CreateClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateCluster. + * @function createCluster + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @instance + * @param {google.cloud.visionai.v1alpha1.ICreateClusterRequest} request CreateClusterRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.StreamsService.CreateClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StreamsService.prototype.createCluster = function createCluster(request, callback) { + return this.rpcCall(createCluster, $root.google.cloud.visionai.v1alpha1.CreateClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateCluster" }); + + /** + * Calls CreateCluster. + * @function createCluster + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @instance + * @param {google.cloud.visionai.v1alpha1.ICreateClusterRequest} request CreateClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.StreamsService|updateCluster}. + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @typedef UpdateClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateCluster. + * @function updateCluster + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @instance + * @param {google.cloud.visionai.v1alpha1.IUpdateClusterRequest} request UpdateClusterRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.StreamsService.UpdateClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StreamsService.prototype.updateCluster = function updateCluster(request, callback) { + return this.rpcCall(updateCluster, $root.google.cloud.visionai.v1alpha1.UpdateClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateCluster" }); + + /** + * Calls UpdateCluster. + * @function updateCluster + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @instance + * @param {google.cloud.visionai.v1alpha1.IUpdateClusterRequest} request UpdateClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.StreamsService|deleteCluster}. + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @typedef DeleteClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteCluster. + * @function deleteCluster + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @instance + * @param {google.cloud.visionai.v1alpha1.IDeleteClusterRequest} request DeleteClusterRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.StreamsService.DeleteClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StreamsService.prototype.deleteCluster = function deleteCluster(request, callback) { + return this.rpcCall(deleteCluster, $root.google.cloud.visionai.v1alpha1.DeleteClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteCluster" }); + + /** + * Calls DeleteCluster. + * @function deleteCluster + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @instance + * @param {google.cloud.visionai.v1alpha1.IDeleteClusterRequest} request DeleteClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.StreamsService|listStreams}. + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @typedef ListStreamsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.visionai.v1alpha1.ListStreamsResponse} [response] ListStreamsResponse + */ + + /** + * Calls ListStreams. + * @function listStreams + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @instance + * @param {google.cloud.visionai.v1alpha1.IListStreamsRequest} request ListStreamsRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.StreamsService.ListStreamsCallback} callback Node-style callback called with the error, if any, and ListStreamsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StreamsService.prototype.listStreams = function listStreams(request, callback) { + return this.rpcCall(listStreams, $root.google.cloud.visionai.v1alpha1.ListStreamsRequest, $root.google.cloud.visionai.v1alpha1.ListStreamsResponse, request, callback); + }, "name", { value: "ListStreams" }); + + /** + * Calls ListStreams. + * @function listStreams + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @instance + * @param {google.cloud.visionai.v1alpha1.IListStreamsRequest} request ListStreamsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.StreamsService|getStream}. + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @typedef GetStreamCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.visionai.v1alpha1.Stream} [response] Stream + */ + + /** + * Calls GetStream. + * @function getStream + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @instance + * @param {google.cloud.visionai.v1alpha1.IGetStreamRequest} request GetStreamRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.StreamsService.GetStreamCallback} callback Node-style callback called with the error, if any, and Stream + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StreamsService.prototype.getStream = function getStream(request, callback) { + return this.rpcCall(getStream, $root.google.cloud.visionai.v1alpha1.GetStreamRequest, $root.google.cloud.visionai.v1alpha1.Stream, request, callback); + }, "name", { value: "GetStream" }); + + /** + * Calls GetStream. + * @function getStream + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @instance + * @param {google.cloud.visionai.v1alpha1.IGetStreamRequest} request GetStreamRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.StreamsService|createStream}. + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @typedef CreateStreamCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateStream. + * @function createStream + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @instance + * @param {google.cloud.visionai.v1alpha1.ICreateStreamRequest} request CreateStreamRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.StreamsService.CreateStreamCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StreamsService.prototype.createStream = function createStream(request, callback) { + return this.rpcCall(createStream, $root.google.cloud.visionai.v1alpha1.CreateStreamRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateStream" }); + + /** + * Calls CreateStream. + * @function createStream + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @instance + * @param {google.cloud.visionai.v1alpha1.ICreateStreamRequest} request CreateStreamRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.StreamsService|updateStream}. + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @typedef UpdateStreamCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateStream. + * @function updateStream + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @instance + * @param {google.cloud.visionai.v1alpha1.IUpdateStreamRequest} request UpdateStreamRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.StreamsService.UpdateStreamCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StreamsService.prototype.updateStream = function updateStream(request, callback) { + return this.rpcCall(updateStream, $root.google.cloud.visionai.v1alpha1.UpdateStreamRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateStream" }); + + /** + * Calls UpdateStream. + * @function updateStream + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @instance + * @param {google.cloud.visionai.v1alpha1.IUpdateStreamRequest} request UpdateStreamRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.StreamsService|deleteStream}. + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @typedef DeleteStreamCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteStream. + * @function deleteStream + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @instance + * @param {google.cloud.visionai.v1alpha1.IDeleteStreamRequest} request DeleteStreamRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.StreamsService.DeleteStreamCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StreamsService.prototype.deleteStream = function deleteStream(request, callback) { + return this.rpcCall(deleteStream, $root.google.cloud.visionai.v1alpha1.DeleteStreamRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteStream" }); + + /** + * Calls DeleteStream. + * @function deleteStream + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @instance + * @param {google.cloud.visionai.v1alpha1.IDeleteStreamRequest} request DeleteStreamRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.StreamsService|generateStreamHlsToken}. + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @typedef GenerateStreamHlsTokenCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenResponse} [response] GenerateStreamHlsTokenResponse + */ + + /** + * Calls GenerateStreamHlsToken. + * @function generateStreamHlsToken + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @instance + * @param {google.cloud.visionai.v1alpha1.IGenerateStreamHlsTokenRequest} request GenerateStreamHlsTokenRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.StreamsService.GenerateStreamHlsTokenCallback} callback Node-style callback called with the error, if any, and GenerateStreamHlsTokenResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StreamsService.prototype.generateStreamHlsToken = function generateStreamHlsToken(request, callback) { + return this.rpcCall(generateStreamHlsToken, $root.google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenRequest, $root.google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenResponse, request, callback); + }, "name", { value: "GenerateStreamHlsToken" }); + + /** + * Calls GenerateStreamHlsToken. + * @function generateStreamHlsToken + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @instance + * @param {google.cloud.visionai.v1alpha1.IGenerateStreamHlsTokenRequest} request GenerateStreamHlsTokenRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.StreamsService|listEvents}. + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @typedef ListEventsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.visionai.v1alpha1.ListEventsResponse} [response] ListEventsResponse + */ + + /** + * Calls ListEvents. + * @function listEvents + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @instance + * @param {google.cloud.visionai.v1alpha1.IListEventsRequest} request ListEventsRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.StreamsService.ListEventsCallback} callback Node-style callback called with the error, if any, and ListEventsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StreamsService.prototype.listEvents = function listEvents(request, callback) { + return this.rpcCall(listEvents, $root.google.cloud.visionai.v1alpha1.ListEventsRequest, $root.google.cloud.visionai.v1alpha1.ListEventsResponse, request, callback); + }, "name", { value: "ListEvents" }); + + /** + * Calls ListEvents. + * @function listEvents + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @instance + * @param {google.cloud.visionai.v1alpha1.IListEventsRequest} request ListEventsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.StreamsService|getEvent}. + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @typedef GetEventCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.visionai.v1alpha1.Event} [response] Event + */ + + /** + * Calls GetEvent. + * @function getEvent + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @instance + * @param {google.cloud.visionai.v1alpha1.IGetEventRequest} request GetEventRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.StreamsService.GetEventCallback} callback Node-style callback called with the error, if any, and Event + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StreamsService.prototype.getEvent = function getEvent(request, callback) { + return this.rpcCall(getEvent, $root.google.cloud.visionai.v1alpha1.GetEventRequest, $root.google.cloud.visionai.v1alpha1.Event, request, callback); + }, "name", { value: "GetEvent" }); + + /** + * Calls GetEvent. + * @function getEvent + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @instance + * @param {google.cloud.visionai.v1alpha1.IGetEventRequest} request GetEventRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.StreamsService|createEvent}. + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @typedef CreateEventCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateEvent. + * @function createEvent + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @instance + * @param {google.cloud.visionai.v1alpha1.ICreateEventRequest} request CreateEventRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.StreamsService.CreateEventCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StreamsService.prototype.createEvent = function createEvent(request, callback) { + return this.rpcCall(createEvent, $root.google.cloud.visionai.v1alpha1.CreateEventRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateEvent" }); + + /** + * Calls CreateEvent. + * @function createEvent + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @instance + * @param {google.cloud.visionai.v1alpha1.ICreateEventRequest} request CreateEventRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.StreamsService|updateEvent}. + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @typedef UpdateEventCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateEvent. + * @function updateEvent + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @instance + * @param {google.cloud.visionai.v1alpha1.IUpdateEventRequest} request UpdateEventRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.StreamsService.UpdateEventCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StreamsService.prototype.updateEvent = function updateEvent(request, callback) { + return this.rpcCall(updateEvent, $root.google.cloud.visionai.v1alpha1.UpdateEventRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateEvent" }); + + /** + * Calls UpdateEvent. + * @function updateEvent + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @instance + * @param {google.cloud.visionai.v1alpha1.IUpdateEventRequest} request UpdateEventRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.StreamsService|deleteEvent}. + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @typedef DeleteEventCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteEvent. + * @function deleteEvent + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @instance + * @param {google.cloud.visionai.v1alpha1.IDeleteEventRequest} request DeleteEventRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.StreamsService.DeleteEventCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StreamsService.prototype.deleteEvent = function deleteEvent(request, callback) { + return this.rpcCall(deleteEvent, $root.google.cloud.visionai.v1alpha1.DeleteEventRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteEvent" }); + + /** + * Calls DeleteEvent. + * @function deleteEvent + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @instance + * @param {google.cloud.visionai.v1alpha1.IDeleteEventRequest} request DeleteEventRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.StreamsService|listSeries}. + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @typedef ListSeriesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.visionai.v1alpha1.ListSeriesResponse} [response] ListSeriesResponse + */ + + /** + * Calls ListSeries. + * @function listSeries + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @instance + * @param {google.cloud.visionai.v1alpha1.IListSeriesRequest} request ListSeriesRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.StreamsService.ListSeriesCallback} callback Node-style callback called with the error, if any, and ListSeriesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StreamsService.prototype.listSeries = function listSeries(request, callback) { + return this.rpcCall(listSeries, $root.google.cloud.visionai.v1alpha1.ListSeriesRequest, $root.google.cloud.visionai.v1alpha1.ListSeriesResponse, request, callback); + }, "name", { value: "ListSeries" }); + + /** + * Calls ListSeries. + * @function listSeries + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @instance + * @param {google.cloud.visionai.v1alpha1.IListSeriesRequest} request ListSeriesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.StreamsService|getSeries}. + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @typedef GetSeriesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.visionai.v1alpha1.Series} [response] Series + */ + + /** + * Calls GetSeries. + * @function getSeries + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @instance + * @param {google.cloud.visionai.v1alpha1.IGetSeriesRequest} request GetSeriesRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.StreamsService.GetSeriesCallback} callback Node-style callback called with the error, if any, and Series + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StreamsService.prototype.getSeries = function getSeries(request, callback) { + return this.rpcCall(getSeries, $root.google.cloud.visionai.v1alpha1.GetSeriesRequest, $root.google.cloud.visionai.v1alpha1.Series, request, callback); + }, "name", { value: "GetSeries" }); + + /** + * Calls GetSeries. + * @function getSeries + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @instance + * @param {google.cloud.visionai.v1alpha1.IGetSeriesRequest} request GetSeriesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.StreamsService|createSeries}. + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @typedef CreateSeriesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateSeries. + * @function createSeries + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @instance + * @param {google.cloud.visionai.v1alpha1.ICreateSeriesRequest} request CreateSeriesRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.StreamsService.CreateSeriesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StreamsService.prototype.createSeries = function createSeries(request, callback) { + return this.rpcCall(createSeries, $root.google.cloud.visionai.v1alpha1.CreateSeriesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateSeries" }); + + /** + * Calls CreateSeries. + * @function createSeries + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @instance + * @param {google.cloud.visionai.v1alpha1.ICreateSeriesRequest} request CreateSeriesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.StreamsService|updateSeries}. + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @typedef UpdateSeriesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateSeries. + * @function updateSeries + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @instance + * @param {google.cloud.visionai.v1alpha1.IUpdateSeriesRequest} request UpdateSeriesRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.StreamsService.UpdateSeriesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StreamsService.prototype.updateSeries = function updateSeries(request, callback) { + return this.rpcCall(updateSeries, $root.google.cloud.visionai.v1alpha1.UpdateSeriesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateSeries" }); + + /** + * Calls UpdateSeries. + * @function updateSeries + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @instance + * @param {google.cloud.visionai.v1alpha1.IUpdateSeriesRequest} request UpdateSeriesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.StreamsService|deleteSeries}. + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @typedef DeleteSeriesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteSeries. + * @function deleteSeries + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @instance + * @param {google.cloud.visionai.v1alpha1.IDeleteSeriesRequest} request DeleteSeriesRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.StreamsService.DeleteSeriesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StreamsService.prototype.deleteSeries = function deleteSeries(request, callback) { + return this.rpcCall(deleteSeries, $root.google.cloud.visionai.v1alpha1.DeleteSeriesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteSeries" }); + + /** + * Calls DeleteSeries. + * @function deleteSeries + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @instance + * @param {google.cloud.visionai.v1alpha1.IDeleteSeriesRequest} request DeleteSeriesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.StreamsService|materializeChannel}. + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @typedef MaterializeChannelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls MaterializeChannel. + * @function materializeChannel + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @instance + * @param {google.cloud.visionai.v1alpha1.IMaterializeChannelRequest} request MaterializeChannelRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.StreamsService.MaterializeChannelCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StreamsService.prototype.materializeChannel = function materializeChannel(request, callback) { + return this.rpcCall(materializeChannel, $root.google.cloud.visionai.v1alpha1.MaterializeChannelRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "MaterializeChannel" }); + + /** + * Calls MaterializeChannel. + * @function materializeChannel + * @memberof google.cloud.visionai.v1alpha1.StreamsService + * @instance + * @param {google.cloud.visionai.v1alpha1.IMaterializeChannelRequest} request MaterializeChannelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return StreamsService; + })(); + + v1alpha1.ListClustersRequest = (function() { + + /** + * Properties of a ListClustersRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IListClustersRequest + * @property {string|null} [parent] ListClustersRequest parent + * @property {number|null} [pageSize] ListClustersRequest pageSize + * @property {string|null} [pageToken] ListClustersRequest pageToken + * @property {string|null} [filter] ListClustersRequest filter + * @property {string|null} [orderBy] ListClustersRequest orderBy + */ + + /** + * Constructs a new ListClustersRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a ListClustersRequest. + * @implements IListClustersRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IListClustersRequest=} [properties] Properties to set + */ + function ListClustersRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListClustersRequest parent. + * @member {string} parent + * @memberof google.cloud.visionai.v1alpha1.ListClustersRequest + * @instance + */ + ListClustersRequest.prototype.parent = ""; + + /** + * ListClustersRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.visionai.v1alpha1.ListClustersRequest + * @instance + */ + ListClustersRequest.prototype.pageSize = 0; + + /** + * ListClustersRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.visionai.v1alpha1.ListClustersRequest + * @instance + */ + ListClustersRequest.prototype.pageToken = ""; + + /** + * ListClustersRequest filter. + * @member {string} filter + * @memberof google.cloud.visionai.v1alpha1.ListClustersRequest + * @instance + */ + ListClustersRequest.prototype.filter = ""; + + /** + * ListClustersRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.visionai.v1alpha1.ListClustersRequest + * @instance + */ + ListClustersRequest.prototype.orderBy = ""; + + /** + * Creates a new ListClustersRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ListClustersRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IListClustersRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ListClustersRequest} ListClustersRequest instance + */ + ListClustersRequest.create = function create(properties) { + return new ListClustersRequest(properties); + }; + + /** + * Encodes the specified ListClustersRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListClustersRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ListClustersRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IListClustersRequest} message ListClustersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListClustersRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListClustersRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListClustersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListClustersRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IListClustersRequest} message ListClustersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListClustersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListClustersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ListClustersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ListClustersRequest} ListClustersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListClustersRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ListClustersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListClustersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListClustersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ListClustersRequest} ListClustersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListClustersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListClustersRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ListClustersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListClustersRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListClustersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ListClustersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ListClustersRequest} ListClustersRequest + */ + ListClustersRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ListClustersRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ListClustersRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListClustersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ListClustersRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ListClustersRequest} message ListClustersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListClustersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListClustersRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ListClustersRequest + * @instance + * @returns {Object.} JSON object + */ + ListClustersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListClustersRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ListClustersRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListClustersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ListClustersRequest"; + }; + + return ListClustersRequest; + })(); + + v1alpha1.ListClustersResponse = (function() { + + /** + * Properties of a ListClustersResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IListClustersResponse + * @property {Array.|null} [clusters] ListClustersResponse clusters + * @property {string|null} [nextPageToken] ListClustersResponse nextPageToken + * @property {Array.|null} [unreachable] ListClustersResponse unreachable + */ + + /** + * Constructs a new ListClustersResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a ListClustersResponse. + * @implements IListClustersResponse + * @constructor + * @param {google.cloud.visionai.v1alpha1.IListClustersResponse=} [properties] Properties to set + */ + function ListClustersResponse(properties) { + this.clusters = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListClustersResponse clusters. + * @member {Array.} clusters + * @memberof google.cloud.visionai.v1alpha1.ListClustersResponse + * @instance + */ + ListClustersResponse.prototype.clusters = $util.emptyArray; + + /** + * ListClustersResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.visionai.v1alpha1.ListClustersResponse + * @instance + */ + ListClustersResponse.prototype.nextPageToken = ""; + + /** + * ListClustersResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.visionai.v1alpha1.ListClustersResponse + * @instance + */ + ListClustersResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListClustersResponse instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ListClustersResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IListClustersResponse=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ListClustersResponse} ListClustersResponse instance + */ + ListClustersResponse.create = function create(properties) { + return new ListClustersResponse(properties); + }; + + /** + * Encodes the specified ListClustersResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListClustersResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ListClustersResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IListClustersResponse} message ListClustersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListClustersResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clusters != null && message.clusters.length) + for (var i = 0; i < message.clusters.length; ++i) + $root.google.cloud.visionai.v1alpha1.Cluster.encode(message.clusters[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListClustersResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListClustersResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListClustersResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IListClustersResponse} message ListClustersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListClustersResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListClustersResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ListClustersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ListClustersResponse} ListClustersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListClustersResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ListClustersResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.clusters && message.clusters.length)) + message.clusters = []; + message.clusters.push($root.google.cloud.visionai.v1alpha1.Cluster.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListClustersResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListClustersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ListClustersResponse} ListClustersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListClustersResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListClustersResponse message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ListClustersResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListClustersResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.clusters != null && message.hasOwnProperty("clusters")) { + if (!Array.isArray(message.clusters)) + return "clusters: array expected"; + for (var i = 0; i < message.clusters.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.Cluster.verify(message.clusters[i], long + 1); + if (error) + return "clusters." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListClustersResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ListClustersResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ListClustersResponse} ListClustersResponse + */ + ListClustersResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ListClustersResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ListClustersResponse(); + if (object.clusters) { + if (!Array.isArray(object.clusters)) + throw TypeError(".google.cloud.visionai.v1alpha1.ListClustersResponse.clusters: array expected"); + message.clusters = []; + for (var i = 0; i < object.clusters.length; ++i) { + if (typeof object.clusters[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ListClustersResponse.clusters: object expected"); + message.clusters[i] = $root.google.cloud.visionai.v1alpha1.Cluster.fromObject(object.clusters[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.visionai.v1alpha1.ListClustersResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListClustersResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ListClustersResponse + * @static + * @param {google.cloud.visionai.v1alpha1.ListClustersResponse} message ListClustersResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListClustersResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.clusters = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.clusters && message.clusters.length) { + object.clusters = []; + for (var j = 0; j < message.clusters.length; ++j) + object.clusters[j] = $root.google.cloud.visionai.v1alpha1.Cluster.toObject(message.clusters[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListClustersResponse to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ListClustersResponse + * @instance + * @returns {Object.} JSON object + */ + ListClustersResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListClustersResponse + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ListClustersResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListClustersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ListClustersResponse"; + }; + + return ListClustersResponse; + })(); + + v1alpha1.GetClusterRequest = (function() { + + /** + * Properties of a GetClusterRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IGetClusterRequest + * @property {string|null} [name] GetClusterRequest name + */ + + /** + * Constructs a new GetClusterRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a GetClusterRequest. + * @implements IGetClusterRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IGetClusterRequest=} [properties] Properties to set + */ + function GetClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetClusterRequest name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.GetClusterRequest + * @instance + */ + GetClusterRequest.prototype.name = ""; + + /** + * Creates a new GetClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.GetClusterRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IGetClusterRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.GetClusterRequest} GetClusterRequest instance + */ + GetClusterRequest.create = function create(properties) { + return new GetClusterRequest(properties); + }; + + /** + * Encodes the specified GetClusterRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.GetClusterRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IGetClusterRequest} message GetClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetClusterRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.GetClusterRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IGetClusterRequest} message GetClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.GetClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.GetClusterRequest} GetClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetClusterRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.GetClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.GetClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.GetClusterRequest} GetClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetClusterRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.GetClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetClusterRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.GetClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.GetClusterRequest} GetClusterRequest + */ + GetClusterRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.GetClusterRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.GetClusterRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.GetClusterRequest + * @static + * @param {google.cloud.visionai.v1alpha1.GetClusterRequest} message GetClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.GetClusterRequest + * @instance + * @returns {Object.} JSON object + */ + GetClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetClusterRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.GetClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.GetClusterRequest"; + }; + + return GetClusterRequest; + })(); + + v1alpha1.CreateClusterRequest = (function() { + + /** + * Properties of a CreateClusterRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface ICreateClusterRequest + * @property {string|null} [parent] CreateClusterRequest parent + * @property {string|null} [clusterId] CreateClusterRequest clusterId + * @property {google.cloud.visionai.v1alpha1.ICluster|null} [cluster] CreateClusterRequest cluster + * @property {string|null} [requestId] CreateClusterRequest requestId + */ + + /** + * Constructs a new CreateClusterRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a CreateClusterRequest. + * @implements ICreateClusterRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.ICreateClusterRequest=} [properties] Properties to set + */ + function CreateClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateClusterRequest parent. + * @member {string} parent + * @memberof google.cloud.visionai.v1alpha1.CreateClusterRequest + * @instance + */ + CreateClusterRequest.prototype.parent = ""; + + /** + * CreateClusterRequest clusterId. + * @member {string} clusterId + * @memberof google.cloud.visionai.v1alpha1.CreateClusterRequest + * @instance + */ + CreateClusterRequest.prototype.clusterId = ""; + + /** + * CreateClusterRequest cluster. + * @member {google.cloud.visionai.v1alpha1.ICluster|null|undefined} cluster + * @memberof google.cloud.visionai.v1alpha1.CreateClusterRequest + * @instance + */ + CreateClusterRequest.prototype.cluster = null; + + /** + * CreateClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.visionai.v1alpha1.CreateClusterRequest + * @instance + */ + CreateClusterRequest.prototype.requestId = ""; + + /** + * Creates a new CreateClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.CreateClusterRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ICreateClusterRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.CreateClusterRequest} CreateClusterRequest instance + */ + CreateClusterRequest.create = function create(properties) { + return new CreateClusterRequest(properties); + }; + + /** + * Encodes the specified CreateClusterRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.CreateClusterRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ICreateClusterRequest} message CreateClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.clusterId != null && Object.hasOwnProperty.call(message, "clusterId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterId); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + $root.google.cloud.visionai.v1alpha1.Cluster.encode(message.cluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.CreateClusterRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ICreateClusterRequest} message CreateClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.CreateClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.CreateClusterRequest} CreateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateClusterRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.CreateClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.clusterId = reader.string(); + break; + } + case 3: { + message.cluster = $root.google.cloud.visionai.v1alpha1.Cluster.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreateClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.CreateClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.CreateClusterRequest} CreateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateClusterRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.CreateClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateClusterRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + if (!$util.isString(message.clusterId)) + return "clusterId: string expected"; + if (message.cluster != null && message.hasOwnProperty("cluster")) { + var error = $root.google.cloud.visionai.v1alpha1.Cluster.verify(message.cluster, long + 1); + if (error) + return "cluster." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.CreateClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.CreateClusterRequest} CreateClusterRequest + */ + CreateClusterRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.CreateClusterRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.CreateClusterRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.clusterId != null) + message.clusterId = String(object.clusterId); + if (object.cluster != null) { + if (typeof object.cluster !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.CreateClusterRequest.cluster: object expected"); + message.cluster = $root.google.cloud.visionai.v1alpha1.Cluster.fromObject(object.cluster, long + 1); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.CreateClusterRequest + * @static + * @param {google.cloud.visionai.v1alpha1.CreateClusterRequest} message CreateClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.clusterId = ""; + object.cluster = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + object.clusterId = message.clusterId; + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = $root.google.cloud.visionai.v1alpha1.Cluster.toObject(message.cluster, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.CreateClusterRequest + * @instance + * @returns {Object.} JSON object + */ + CreateClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateClusterRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.CreateClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.CreateClusterRequest"; + }; + + return CreateClusterRequest; + })(); + + v1alpha1.UpdateClusterRequest = (function() { + + /** + * Properties of an UpdateClusterRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IUpdateClusterRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateClusterRequest updateMask + * @property {google.cloud.visionai.v1alpha1.ICluster|null} [cluster] UpdateClusterRequest cluster + * @property {string|null} [requestId] UpdateClusterRequest requestId + */ + + /** + * Constructs a new UpdateClusterRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents an UpdateClusterRequest. + * @implements IUpdateClusterRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IUpdateClusterRequest=} [properties] Properties to set + */ + function UpdateClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateClusterRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.visionai.v1alpha1.UpdateClusterRequest + * @instance + */ + UpdateClusterRequest.prototype.updateMask = null; + + /** + * UpdateClusterRequest cluster. + * @member {google.cloud.visionai.v1alpha1.ICluster|null|undefined} cluster + * @memberof google.cloud.visionai.v1alpha1.UpdateClusterRequest + * @instance + */ + UpdateClusterRequest.prototype.cluster = null; + + /** + * UpdateClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.visionai.v1alpha1.UpdateClusterRequest + * @instance + */ + UpdateClusterRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.UpdateClusterRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IUpdateClusterRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.UpdateClusterRequest} UpdateClusterRequest instance + */ + UpdateClusterRequest.create = function create(properties) { + return new UpdateClusterRequest(properties); + }; + + /** + * Encodes the specified UpdateClusterRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.UpdateClusterRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IUpdateClusterRequest} message UpdateClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + $root.google.cloud.visionai.v1alpha1.Cluster.encode(message.cluster, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified UpdateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.UpdateClusterRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IUpdateClusterRequest} message UpdateClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.UpdateClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.UpdateClusterRequest} UpdateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateClusterRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.UpdateClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.cluster = $root.google.cloud.visionai.v1alpha1.Cluster.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.UpdateClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.UpdateClusterRequest} UpdateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateClusterRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.UpdateClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateClusterRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + if (message.cluster != null && message.hasOwnProperty("cluster")) { + var error = $root.google.cloud.visionai.v1alpha1.Cluster.verify(message.cluster, long + 1); + if (error) + return "cluster." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an UpdateClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.UpdateClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.UpdateClusterRequest} UpdateClusterRequest + */ + UpdateClusterRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.UpdateClusterRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.UpdateClusterRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.UpdateClusterRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + if (object.cluster != null) { + if (typeof object.cluster !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.UpdateClusterRequest.cluster: object expected"); + message.cluster = $root.google.cloud.visionai.v1alpha1.Cluster.fromObject(object.cluster, long + 1); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.UpdateClusterRequest + * @static + * @param {google.cloud.visionai.v1alpha1.UpdateClusterRequest} message UpdateClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.cluster = null; + object.requestId = ""; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = $root.google.cloud.visionai.v1alpha1.Cluster.toObject(message.cluster, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UpdateClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.UpdateClusterRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateClusterRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.UpdateClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.UpdateClusterRequest"; + }; + + return UpdateClusterRequest; + })(); + + v1alpha1.DeleteClusterRequest = (function() { + + /** + * Properties of a DeleteClusterRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IDeleteClusterRequest + * @property {string|null} [name] DeleteClusterRequest name + * @property {string|null} [requestId] DeleteClusterRequest requestId + */ + + /** + * Constructs a new DeleteClusterRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a DeleteClusterRequest. + * @implements IDeleteClusterRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IDeleteClusterRequest=} [properties] Properties to set + */ + function DeleteClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteClusterRequest name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.DeleteClusterRequest + * @instance + */ + DeleteClusterRequest.prototype.name = ""; + + /** + * DeleteClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.visionai.v1alpha1.DeleteClusterRequest + * @instance + */ + DeleteClusterRequest.prototype.requestId = ""; + + /** + * Creates a new DeleteClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.DeleteClusterRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IDeleteClusterRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.DeleteClusterRequest} DeleteClusterRequest instance + */ + DeleteClusterRequest.create = function create(properties) { + return new DeleteClusterRequest(properties); + }; + + /** + * Encodes the specified DeleteClusterRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.DeleteClusterRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IDeleteClusterRequest} message DeleteClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified DeleteClusterRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.DeleteClusterRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IDeleteClusterRequest} message DeleteClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.DeleteClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.DeleteClusterRequest} DeleteClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteClusterRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.DeleteClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.DeleteClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.DeleteClusterRequest} DeleteClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteClusterRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.DeleteClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteClusterRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a DeleteClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.DeleteClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.DeleteClusterRequest} DeleteClusterRequest + */ + DeleteClusterRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.DeleteClusterRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.DeleteClusterRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.DeleteClusterRequest + * @static + * @param {google.cloud.visionai.v1alpha1.DeleteClusterRequest} message DeleteClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this DeleteClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.DeleteClusterRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteClusterRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.DeleteClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.DeleteClusterRequest"; + }; + + return DeleteClusterRequest; + })(); + + v1alpha1.ListStreamsRequest = (function() { + + /** + * Properties of a ListStreamsRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IListStreamsRequest + * @property {string|null} [parent] ListStreamsRequest parent + * @property {number|null} [pageSize] ListStreamsRequest pageSize + * @property {string|null} [pageToken] ListStreamsRequest pageToken + * @property {string|null} [filter] ListStreamsRequest filter + * @property {string|null} [orderBy] ListStreamsRequest orderBy + */ + + /** + * Constructs a new ListStreamsRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a ListStreamsRequest. + * @implements IListStreamsRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IListStreamsRequest=} [properties] Properties to set + */ + function ListStreamsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListStreamsRequest parent. + * @member {string} parent + * @memberof google.cloud.visionai.v1alpha1.ListStreamsRequest + * @instance + */ + ListStreamsRequest.prototype.parent = ""; + + /** + * ListStreamsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.visionai.v1alpha1.ListStreamsRequest + * @instance + */ + ListStreamsRequest.prototype.pageSize = 0; + + /** + * ListStreamsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.visionai.v1alpha1.ListStreamsRequest + * @instance + */ + ListStreamsRequest.prototype.pageToken = ""; + + /** + * ListStreamsRequest filter. + * @member {string} filter + * @memberof google.cloud.visionai.v1alpha1.ListStreamsRequest + * @instance + */ + ListStreamsRequest.prototype.filter = ""; + + /** + * ListStreamsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.visionai.v1alpha1.ListStreamsRequest + * @instance + */ + ListStreamsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListStreamsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ListStreamsRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IListStreamsRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ListStreamsRequest} ListStreamsRequest instance + */ + ListStreamsRequest.create = function create(properties) { + return new ListStreamsRequest(properties); + }; + + /** + * Encodes the specified ListStreamsRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListStreamsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ListStreamsRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IListStreamsRequest} message ListStreamsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListStreamsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListStreamsRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListStreamsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListStreamsRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IListStreamsRequest} message ListStreamsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListStreamsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListStreamsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ListStreamsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ListStreamsRequest} ListStreamsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListStreamsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ListStreamsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListStreamsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListStreamsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ListStreamsRequest} ListStreamsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListStreamsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListStreamsRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ListStreamsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListStreamsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListStreamsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ListStreamsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ListStreamsRequest} ListStreamsRequest + */ + ListStreamsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ListStreamsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ListStreamsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListStreamsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ListStreamsRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ListStreamsRequest} message ListStreamsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListStreamsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListStreamsRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ListStreamsRequest + * @instance + * @returns {Object.} JSON object + */ + ListStreamsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListStreamsRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ListStreamsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListStreamsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ListStreamsRequest"; + }; + + return ListStreamsRequest; + })(); + + v1alpha1.ListStreamsResponse = (function() { + + /** + * Properties of a ListStreamsResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IListStreamsResponse + * @property {Array.|null} [streams] ListStreamsResponse streams + * @property {string|null} [nextPageToken] ListStreamsResponse nextPageToken + * @property {Array.|null} [unreachable] ListStreamsResponse unreachable + */ + + /** + * Constructs a new ListStreamsResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a ListStreamsResponse. + * @implements IListStreamsResponse + * @constructor + * @param {google.cloud.visionai.v1alpha1.IListStreamsResponse=} [properties] Properties to set + */ + function ListStreamsResponse(properties) { + this.streams = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListStreamsResponse streams. + * @member {Array.} streams + * @memberof google.cloud.visionai.v1alpha1.ListStreamsResponse + * @instance + */ + ListStreamsResponse.prototype.streams = $util.emptyArray; + + /** + * ListStreamsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.visionai.v1alpha1.ListStreamsResponse + * @instance + */ + ListStreamsResponse.prototype.nextPageToken = ""; + + /** + * ListStreamsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.visionai.v1alpha1.ListStreamsResponse + * @instance + */ + ListStreamsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListStreamsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ListStreamsResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IListStreamsResponse=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ListStreamsResponse} ListStreamsResponse instance + */ + ListStreamsResponse.create = function create(properties) { + return new ListStreamsResponse(properties); + }; + + /** + * Encodes the specified ListStreamsResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListStreamsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ListStreamsResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IListStreamsResponse} message ListStreamsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListStreamsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.streams != null && message.streams.length) + for (var i = 0; i < message.streams.length; ++i) + $root.google.cloud.visionai.v1alpha1.Stream.encode(message.streams[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListStreamsResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListStreamsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListStreamsResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IListStreamsResponse} message ListStreamsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListStreamsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListStreamsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ListStreamsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ListStreamsResponse} ListStreamsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListStreamsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ListStreamsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.streams && message.streams.length)) + message.streams = []; + message.streams.push($root.google.cloud.visionai.v1alpha1.Stream.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListStreamsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListStreamsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ListStreamsResponse} ListStreamsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListStreamsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListStreamsResponse message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ListStreamsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListStreamsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.streams != null && message.hasOwnProperty("streams")) { + if (!Array.isArray(message.streams)) + return "streams: array expected"; + for (var i = 0; i < message.streams.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.Stream.verify(message.streams[i], long + 1); + if (error) + return "streams." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListStreamsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ListStreamsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ListStreamsResponse} ListStreamsResponse + */ + ListStreamsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ListStreamsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ListStreamsResponse(); + if (object.streams) { + if (!Array.isArray(object.streams)) + throw TypeError(".google.cloud.visionai.v1alpha1.ListStreamsResponse.streams: array expected"); + message.streams = []; + for (var i = 0; i < object.streams.length; ++i) { + if (typeof object.streams[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ListStreamsResponse.streams: object expected"); + message.streams[i] = $root.google.cloud.visionai.v1alpha1.Stream.fromObject(object.streams[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.visionai.v1alpha1.ListStreamsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListStreamsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ListStreamsResponse + * @static + * @param {google.cloud.visionai.v1alpha1.ListStreamsResponse} message ListStreamsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListStreamsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.streams = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.streams && message.streams.length) { + object.streams = []; + for (var j = 0; j < message.streams.length; ++j) + object.streams[j] = $root.google.cloud.visionai.v1alpha1.Stream.toObject(message.streams[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListStreamsResponse to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ListStreamsResponse + * @instance + * @returns {Object.} JSON object + */ + ListStreamsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListStreamsResponse + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ListStreamsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListStreamsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ListStreamsResponse"; + }; + + return ListStreamsResponse; + })(); + + v1alpha1.GetStreamRequest = (function() { + + /** + * Properties of a GetStreamRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IGetStreamRequest + * @property {string|null} [name] GetStreamRequest name + */ + + /** + * Constructs a new GetStreamRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a GetStreamRequest. + * @implements IGetStreamRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IGetStreamRequest=} [properties] Properties to set + */ + function GetStreamRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetStreamRequest name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.GetStreamRequest + * @instance + */ + GetStreamRequest.prototype.name = ""; + + /** + * Creates a new GetStreamRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.GetStreamRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IGetStreamRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.GetStreamRequest} GetStreamRequest instance + */ + GetStreamRequest.create = function create(properties) { + return new GetStreamRequest(properties); + }; + + /** + * Encodes the specified GetStreamRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetStreamRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.GetStreamRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IGetStreamRequest} message GetStreamRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetStreamRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetStreamRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetStreamRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.GetStreamRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IGetStreamRequest} message GetStreamRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetStreamRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetStreamRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.GetStreamRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.GetStreamRequest} GetStreamRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetStreamRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.GetStreamRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetStreamRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.GetStreamRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.GetStreamRequest} GetStreamRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetStreamRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetStreamRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.GetStreamRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetStreamRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetStreamRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.GetStreamRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.GetStreamRequest} GetStreamRequest + */ + GetStreamRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.GetStreamRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.GetStreamRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetStreamRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.GetStreamRequest + * @static + * @param {google.cloud.visionai.v1alpha1.GetStreamRequest} message GetStreamRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetStreamRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetStreamRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.GetStreamRequest + * @instance + * @returns {Object.} JSON object + */ + GetStreamRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetStreamRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.GetStreamRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetStreamRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.GetStreamRequest"; + }; + + return GetStreamRequest; + })(); + + v1alpha1.CreateStreamRequest = (function() { + + /** + * Properties of a CreateStreamRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface ICreateStreamRequest + * @property {string|null} [parent] CreateStreamRequest parent + * @property {string|null} [streamId] CreateStreamRequest streamId + * @property {google.cloud.visionai.v1alpha1.IStream|null} [stream] CreateStreamRequest stream + * @property {string|null} [requestId] CreateStreamRequest requestId + */ + + /** + * Constructs a new CreateStreamRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a CreateStreamRequest. + * @implements ICreateStreamRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.ICreateStreamRequest=} [properties] Properties to set + */ + function CreateStreamRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateStreamRequest parent. + * @member {string} parent + * @memberof google.cloud.visionai.v1alpha1.CreateStreamRequest + * @instance + */ + CreateStreamRequest.prototype.parent = ""; + + /** + * CreateStreamRequest streamId. + * @member {string} streamId + * @memberof google.cloud.visionai.v1alpha1.CreateStreamRequest + * @instance + */ + CreateStreamRequest.prototype.streamId = ""; + + /** + * CreateStreamRequest stream. + * @member {google.cloud.visionai.v1alpha1.IStream|null|undefined} stream + * @memberof google.cloud.visionai.v1alpha1.CreateStreamRequest + * @instance + */ + CreateStreamRequest.prototype.stream = null; + + /** + * CreateStreamRequest requestId. + * @member {string} requestId + * @memberof google.cloud.visionai.v1alpha1.CreateStreamRequest + * @instance + */ + CreateStreamRequest.prototype.requestId = ""; + + /** + * Creates a new CreateStreamRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.CreateStreamRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ICreateStreamRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.CreateStreamRequest} CreateStreamRequest instance + */ + CreateStreamRequest.create = function create(properties) { + return new CreateStreamRequest(properties); + }; + + /** + * Encodes the specified CreateStreamRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateStreamRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.CreateStreamRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ICreateStreamRequest} message CreateStreamRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateStreamRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.streamId != null && Object.hasOwnProperty.call(message, "streamId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.streamId); + if (message.stream != null && Object.hasOwnProperty.call(message, "stream")) + $root.google.cloud.visionai.v1alpha1.Stream.encode(message.stream, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateStreamRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateStreamRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.CreateStreamRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ICreateStreamRequest} message CreateStreamRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateStreamRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateStreamRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.CreateStreamRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.CreateStreamRequest} CreateStreamRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateStreamRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.CreateStreamRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.streamId = reader.string(); + break; + } + case 3: { + message.stream = $root.google.cloud.visionai.v1alpha1.Stream.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreateStreamRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.CreateStreamRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.CreateStreamRequest} CreateStreamRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateStreamRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateStreamRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.CreateStreamRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateStreamRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.streamId != null && message.hasOwnProperty("streamId")) + if (!$util.isString(message.streamId)) + return "streamId: string expected"; + if (message.stream != null && message.hasOwnProperty("stream")) { + var error = $root.google.cloud.visionai.v1alpha1.Stream.verify(message.stream, long + 1); + if (error) + return "stream." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateStreamRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.CreateStreamRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.CreateStreamRequest} CreateStreamRequest + */ + CreateStreamRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.CreateStreamRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.CreateStreamRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.streamId != null) + message.streamId = String(object.streamId); + if (object.stream != null) { + if (typeof object.stream !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.CreateStreamRequest.stream: object expected"); + message.stream = $root.google.cloud.visionai.v1alpha1.Stream.fromObject(object.stream, long + 1); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateStreamRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.CreateStreamRequest + * @static + * @param {google.cloud.visionai.v1alpha1.CreateStreamRequest} message CreateStreamRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateStreamRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.streamId = ""; + object.stream = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.streamId != null && message.hasOwnProperty("streamId")) + object.streamId = message.streamId; + if (message.stream != null && message.hasOwnProperty("stream")) + object.stream = $root.google.cloud.visionai.v1alpha1.Stream.toObject(message.stream, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateStreamRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.CreateStreamRequest + * @instance + * @returns {Object.} JSON object + */ + CreateStreamRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateStreamRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.CreateStreamRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateStreamRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.CreateStreamRequest"; + }; + + return CreateStreamRequest; + })(); + + v1alpha1.UpdateStreamRequest = (function() { + + /** + * Properties of an UpdateStreamRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IUpdateStreamRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateStreamRequest updateMask + * @property {google.cloud.visionai.v1alpha1.IStream|null} [stream] UpdateStreamRequest stream + * @property {string|null} [requestId] UpdateStreamRequest requestId + */ + + /** + * Constructs a new UpdateStreamRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents an UpdateStreamRequest. + * @implements IUpdateStreamRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IUpdateStreamRequest=} [properties] Properties to set + */ + function UpdateStreamRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateStreamRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.visionai.v1alpha1.UpdateStreamRequest + * @instance + */ + UpdateStreamRequest.prototype.updateMask = null; + + /** + * UpdateStreamRequest stream. + * @member {google.cloud.visionai.v1alpha1.IStream|null|undefined} stream + * @memberof google.cloud.visionai.v1alpha1.UpdateStreamRequest + * @instance + */ + UpdateStreamRequest.prototype.stream = null; + + /** + * UpdateStreamRequest requestId. + * @member {string} requestId + * @memberof google.cloud.visionai.v1alpha1.UpdateStreamRequest + * @instance + */ + UpdateStreamRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateStreamRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.UpdateStreamRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IUpdateStreamRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.UpdateStreamRequest} UpdateStreamRequest instance + */ + UpdateStreamRequest.create = function create(properties) { + return new UpdateStreamRequest(properties); + }; + + /** + * Encodes the specified UpdateStreamRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateStreamRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.UpdateStreamRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IUpdateStreamRequest} message UpdateStreamRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateStreamRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.stream != null && Object.hasOwnProperty.call(message, "stream")) + $root.google.cloud.visionai.v1alpha1.Stream.encode(message.stream, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified UpdateStreamRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateStreamRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.UpdateStreamRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IUpdateStreamRequest} message UpdateStreamRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateStreamRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateStreamRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.UpdateStreamRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.UpdateStreamRequest} UpdateStreamRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateStreamRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.UpdateStreamRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.stream = $root.google.cloud.visionai.v1alpha1.Stream.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateStreamRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.UpdateStreamRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.UpdateStreamRequest} UpdateStreamRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateStreamRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateStreamRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.UpdateStreamRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateStreamRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + if (message.stream != null && message.hasOwnProperty("stream")) { + var error = $root.google.cloud.visionai.v1alpha1.Stream.verify(message.stream, long + 1); + if (error) + return "stream." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an UpdateStreamRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.UpdateStreamRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.UpdateStreamRequest} UpdateStreamRequest + */ + UpdateStreamRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.UpdateStreamRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.UpdateStreamRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.UpdateStreamRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + if (object.stream != null) { + if (typeof object.stream !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.UpdateStreamRequest.stream: object expected"); + message.stream = $root.google.cloud.visionai.v1alpha1.Stream.fromObject(object.stream, long + 1); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateStreamRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.UpdateStreamRequest + * @static + * @param {google.cloud.visionai.v1alpha1.UpdateStreamRequest} message UpdateStreamRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateStreamRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.stream = null; + object.requestId = ""; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.stream != null && message.hasOwnProperty("stream")) + object.stream = $root.google.cloud.visionai.v1alpha1.Stream.toObject(message.stream, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UpdateStreamRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.UpdateStreamRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateStreamRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateStreamRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.UpdateStreamRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateStreamRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.UpdateStreamRequest"; + }; + + return UpdateStreamRequest; + })(); + + v1alpha1.DeleteStreamRequest = (function() { + + /** + * Properties of a DeleteStreamRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IDeleteStreamRequest + * @property {string|null} [name] DeleteStreamRequest name + * @property {string|null} [requestId] DeleteStreamRequest requestId + */ + + /** + * Constructs a new DeleteStreamRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a DeleteStreamRequest. + * @implements IDeleteStreamRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IDeleteStreamRequest=} [properties] Properties to set + */ + function DeleteStreamRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteStreamRequest name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.DeleteStreamRequest + * @instance + */ + DeleteStreamRequest.prototype.name = ""; + + /** + * DeleteStreamRequest requestId. + * @member {string} requestId + * @memberof google.cloud.visionai.v1alpha1.DeleteStreamRequest + * @instance + */ + DeleteStreamRequest.prototype.requestId = ""; + + /** + * Creates a new DeleteStreamRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.DeleteStreamRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IDeleteStreamRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.DeleteStreamRequest} DeleteStreamRequest instance + */ + DeleteStreamRequest.create = function create(properties) { + return new DeleteStreamRequest(properties); + }; + + /** + * Encodes the specified DeleteStreamRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteStreamRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.DeleteStreamRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IDeleteStreamRequest} message DeleteStreamRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteStreamRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified DeleteStreamRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteStreamRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.DeleteStreamRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IDeleteStreamRequest} message DeleteStreamRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteStreamRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteStreamRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.DeleteStreamRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.DeleteStreamRequest} DeleteStreamRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteStreamRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.DeleteStreamRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteStreamRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.DeleteStreamRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.DeleteStreamRequest} DeleteStreamRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteStreamRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteStreamRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.DeleteStreamRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteStreamRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a DeleteStreamRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.DeleteStreamRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.DeleteStreamRequest} DeleteStreamRequest + */ + DeleteStreamRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.DeleteStreamRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.DeleteStreamRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteStreamRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.DeleteStreamRequest + * @static + * @param {google.cloud.visionai.v1alpha1.DeleteStreamRequest} message DeleteStreamRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteStreamRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this DeleteStreamRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.DeleteStreamRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteStreamRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteStreamRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.DeleteStreamRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteStreamRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.DeleteStreamRequest"; + }; + + return DeleteStreamRequest; + })(); + + v1alpha1.GetStreamThumbnailResponse = (function() { + + /** + * Properties of a GetStreamThumbnailResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IGetStreamThumbnailResponse + */ + + /** + * Constructs a new GetStreamThumbnailResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a GetStreamThumbnailResponse. + * @implements IGetStreamThumbnailResponse + * @constructor + * @param {google.cloud.visionai.v1alpha1.IGetStreamThumbnailResponse=} [properties] Properties to set + */ + function GetStreamThumbnailResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new GetStreamThumbnailResponse instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.GetStreamThumbnailResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IGetStreamThumbnailResponse=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.GetStreamThumbnailResponse} GetStreamThumbnailResponse instance + */ + GetStreamThumbnailResponse.create = function create(properties) { + return new GetStreamThumbnailResponse(properties); + }; + + /** + * Encodes the specified GetStreamThumbnailResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetStreamThumbnailResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.GetStreamThumbnailResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IGetStreamThumbnailResponse} message GetStreamThumbnailResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetStreamThumbnailResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified GetStreamThumbnailResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetStreamThumbnailResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.GetStreamThumbnailResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IGetStreamThumbnailResponse} message GetStreamThumbnailResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetStreamThumbnailResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetStreamThumbnailResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.GetStreamThumbnailResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.GetStreamThumbnailResponse} GetStreamThumbnailResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetStreamThumbnailResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.GetStreamThumbnailResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetStreamThumbnailResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.GetStreamThumbnailResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.GetStreamThumbnailResponse} GetStreamThumbnailResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetStreamThumbnailResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetStreamThumbnailResponse message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.GetStreamThumbnailResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetStreamThumbnailResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates a GetStreamThumbnailResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.GetStreamThumbnailResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.GetStreamThumbnailResponse} GetStreamThumbnailResponse + */ + GetStreamThumbnailResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.GetStreamThumbnailResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.google.cloud.visionai.v1alpha1.GetStreamThumbnailResponse(); + }; + + /** + * Creates a plain object from a GetStreamThumbnailResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.GetStreamThumbnailResponse + * @static + * @param {google.cloud.visionai.v1alpha1.GetStreamThumbnailResponse} message GetStreamThumbnailResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetStreamThumbnailResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this GetStreamThumbnailResponse to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.GetStreamThumbnailResponse + * @instance + * @returns {Object.} JSON object + */ + GetStreamThumbnailResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetStreamThumbnailResponse + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.GetStreamThumbnailResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetStreamThumbnailResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.GetStreamThumbnailResponse"; + }; + + return GetStreamThumbnailResponse; + })(); + + v1alpha1.GenerateStreamHlsTokenRequest = (function() { + + /** + * Properties of a GenerateStreamHlsTokenRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IGenerateStreamHlsTokenRequest + * @property {string|null} [stream] GenerateStreamHlsTokenRequest stream + */ + + /** + * Constructs a new GenerateStreamHlsTokenRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a GenerateStreamHlsTokenRequest. + * @implements IGenerateStreamHlsTokenRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IGenerateStreamHlsTokenRequest=} [properties] Properties to set + */ + function GenerateStreamHlsTokenRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerateStreamHlsTokenRequest stream. + * @member {string} stream + * @memberof google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenRequest + * @instance + */ + GenerateStreamHlsTokenRequest.prototype.stream = ""; + + /** + * Creates a new GenerateStreamHlsTokenRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IGenerateStreamHlsTokenRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenRequest} GenerateStreamHlsTokenRequest instance + */ + GenerateStreamHlsTokenRequest.create = function create(properties) { + return new GenerateStreamHlsTokenRequest(properties); + }; + + /** + * Encodes the specified GenerateStreamHlsTokenRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IGenerateStreamHlsTokenRequest} message GenerateStreamHlsTokenRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateStreamHlsTokenRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stream != null && Object.hasOwnProperty.call(message, "stream")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.stream); + return writer; + }; + + /** + * Encodes the specified GenerateStreamHlsTokenRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IGenerateStreamHlsTokenRequest} message GenerateStreamHlsTokenRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateStreamHlsTokenRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateStreamHlsTokenRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenRequest} GenerateStreamHlsTokenRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateStreamHlsTokenRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.stream = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GenerateStreamHlsTokenRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenRequest} GenerateStreamHlsTokenRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateStreamHlsTokenRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateStreamHlsTokenRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateStreamHlsTokenRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.stream != null && message.hasOwnProperty("stream")) + if (!$util.isString(message.stream)) + return "stream: string expected"; + return null; + }; + + /** + * Creates a GenerateStreamHlsTokenRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenRequest} GenerateStreamHlsTokenRequest + */ + GenerateStreamHlsTokenRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenRequest(); + if (object.stream != null) + message.stream = String(object.stream); + return message; + }; + + /** + * Creates a plain object from a GenerateStreamHlsTokenRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenRequest + * @static + * @param {google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenRequest} message GenerateStreamHlsTokenRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateStreamHlsTokenRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.stream = ""; + if (message.stream != null && message.hasOwnProperty("stream")) + object.stream = message.stream; + return object; + }; + + /** + * Converts this GenerateStreamHlsTokenRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenRequest + * @instance + * @returns {Object.} JSON object + */ + GenerateStreamHlsTokenRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateStreamHlsTokenRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateStreamHlsTokenRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenRequest"; + }; + + return GenerateStreamHlsTokenRequest; + })(); + + v1alpha1.GenerateStreamHlsTokenResponse = (function() { + + /** + * Properties of a GenerateStreamHlsTokenResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IGenerateStreamHlsTokenResponse + * @property {string|null} [token] GenerateStreamHlsTokenResponse token + * @property {google.protobuf.ITimestamp|null} [expirationTime] GenerateStreamHlsTokenResponse expirationTime + */ + + /** + * Constructs a new GenerateStreamHlsTokenResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a GenerateStreamHlsTokenResponse. + * @implements IGenerateStreamHlsTokenResponse + * @constructor + * @param {google.cloud.visionai.v1alpha1.IGenerateStreamHlsTokenResponse=} [properties] Properties to set + */ + function GenerateStreamHlsTokenResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerateStreamHlsTokenResponse token. + * @member {string} token + * @memberof google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenResponse + * @instance + */ + GenerateStreamHlsTokenResponse.prototype.token = ""; + + /** + * GenerateStreamHlsTokenResponse expirationTime. + * @member {google.protobuf.ITimestamp|null|undefined} expirationTime + * @memberof google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenResponse + * @instance + */ + GenerateStreamHlsTokenResponse.prototype.expirationTime = null; + + /** + * Creates a new GenerateStreamHlsTokenResponse instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IGenerateStreamHlsTokenResponse=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenResponse} GenerateStreamHlsTokenResponse instance + */ + GenerateStreamHlsTokenResponse.create = function create(properties) { + return new GenerateStreamHlsTokenResponse(properties); + }; + + /** + * Encodes the specified GenerateStreamHlsTokenResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IGenerateStreamHlsTokenResponse} message GenerateStreamHlsTokenResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateStreamHlsTokenResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.token != null && Object.hasOwnProperty.call(message, "token")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.token); + if (message.expirationTime != null && Object.hasOwnProperty.call(message, "expirationTime")) + $root.google.protobuf.Timestamp.encode(message.expirationTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GenerateStreamHlsTokenResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IGenerateStreamHlsTokenResponse} message GenerateStreamHlsTokenResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateStreamHlsTokenResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateStreamHlsTokenResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenResponse} GenerateStreamHlsTokenResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateStreamHlsTokenResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.token = reader.string(); + break; + } + case 2: { + message.expirationTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GenerateStreamHlsTokenResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenResponse} GenerateStreamHlsTokenResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateStreamHlsTokenResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateStreamHlsTokenResponse message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateStreamHlsTokenResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.token != null && message.hasOwnProperty("token")) + if (!$util.isString(message.token)) + return "token: string expected"; + if (message.expirationTime != null && message.hasOwnProperty("expirationTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expirationTime, long + 1); + if (error) + return "expirationTime." + error; + } + return null; + }; + + /** + * Creates a GenerateStreamHlsTokenResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenResponse} GenerateStreamHlsTokenResponse + */ + GenerateStreamHlsTokenResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenResponse(); + if (object.token != null) + message.token = String(object.token); + if (object.expirationTime != null) { + if (typeof object.expirationTime !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenResponse.expirationTime: object expected"); + message.expirationTime = $root.google.protobuf.Timestamp.fromObject(object.expirationTime, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a GenerateStreamHlsTokenResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenResponse + * @static + * @param {google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenResponse} message GenerateStreamHlsTokenResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateStreamHlsTokenResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.token = ""; + object.expirationTime = null; + } + if (message.token != null && message.hasOwnProperty("token")) + object.token = message.token; + if (message.expirationTime != null && message.hasOwnProperty("expirationTime")) + object.expirationTime = $root.google.protobuf.Timestamp.toObject(message.expirationTime, options); + return object; + }; + + /** + * Converts this GenerateStreamHlsTokenResponse to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenResponse + * @instance + * @returns {Object.} JSON object + */ + GenerateStreamHlsTokenResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateStreamHlsTokenResponse + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateStreamHlsTokenResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenResponse"; + }; + + return GenerateStreamHlsTokenResponse; + })(); + + v1alpha1.ListEventsRequest = (function() { + + /** + * Properties of a ListEventsRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IListEventsRequest + * @property {string|null} [parent] ListEventsRequest parent + * @property {number|null} [pageSize] ListEventsRequest pageSize + * @property {string|null} [pageToken] ListEventsRequest pageToken + * @property {string|null} [filter] ListEventsRequest filter + * @property {string|null} [orderBy] ListEventsRequest orderBy + */ + + /** + * Constructs a new ListEventsRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a ListEventsRequest. + * @implements IListEventsRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IListEventsRequest=} [properties] Properties to set + */ + function ListEventsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEventsRequest parent. + * @member {string} parent + * @memberof google.cloud.visionai.v1alpha1.ListEventsRequest + * @instance + */ + ListEventsRequest.prototype.parent = ""; + + /** + * ListEventsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.visionai.v1alpha1.ListEventsRequest + * @instance + */ + ListEventsRequest.prototype.pageSize = 0; + + /** + * ListEventsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.visionai.v1alpha1.ListEventsRequest + * @instance + */ + ListEventsRequest.prototype.pageToken = ""; + + /** + * ListEventsRequest filter. + * @member {string} filter + * @memberof google.cloud.visionai.v1alpha1.ListEventsRequest + * @instance + */ + ListEventsRequest.prototype.filter = ""; + + /** + * ListEventsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.visionai.v1alpha1.ListEventsRequest + * @instance + */ + ListEventsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListEventsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ListEventsRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IListEventsRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ListEventsRequest} ListEventsRequest instance + */ + ListEventsRequest.create = function create(properties) { + return new ListEventsRequest(properties); + }; + + /** + * Encodes the specified ListEventsRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListEventsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ListEventsRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IListEventsRequest} message ListEventsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEventsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListEventsRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListEventsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListEventsRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IListEventsRequest} message ListEventsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEventsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEventsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ListEventsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ListEventsRequest} ListEventsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEventsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ListEventsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListEventsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListEventsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ListEventsRequest} ListEventsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEventsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEventsRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ListEventsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEventsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListEventsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ListEventsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ListEventsRequest} ListEventsRequest + */ + ListEventsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ListEventsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ListEventsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListEventsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ListEventsRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ListEventsRequest} message ListEventsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEventsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListEventsRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ListEventsRequest + * @instance + * @returns {Object.} JSON object + */ + ListEventsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEventsRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ListEventsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEventsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ListEventsRequest"; + }; + + return ListEventsRequest; + })(); + + v1alpha1.ListEventsResponse = (function() { + + /** + * Properties of a ListEventsResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IListEventsResponse + * @property {Array.|null} [events] ListEventsResponse events + * @property {string|null} [nextPageToken] ListEventsResponse nextPageToken + * @property {Array.|null} [unreachable] ListEventsResponse unreachable + */ + + /** + * Constructs a new ListEventsResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a ListEventsResponse. + * @implements IListEventsResponse + * @constructor + * @param {google.cloud.visionai.v1alpha1.IListEventsResponse=} [properties] Properties to set + */ + function ListEventsResponse(properties) { + this.events = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEventsResponse events. + * @member {Array.} events + * @memberof google.cloud.visionai.v1alpha1.ListEventsResponse + * @instance + */ + ListEventsResponse.prototype.events = $util.emptyArray; + + /** + * ListEventsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.visionai.v1alpha1.ListEventsResponse + * @instance + */ + ListEventsResponse.prototype.nextPageToken = ""; + + /** + * ListEventsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.visionai.v1alpha1.ListEventsResponse + * @instance + */ + ListEventsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListEventsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ListEventsResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IListEventsResponse=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ListEventsResponse} ListEventsResponse instance + */ + ListEventsResponse.create = function create(properties) { + return new ListEventsResponse(properties); + }; + + /** + * Encodes the specified ListEventsResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListEventsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ListEventsResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IListEventsResponse} message ListEventsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEventsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.events != null && message.events.length) + for (var i = 0; i < message.events.length; ++i) + $root.google.cloud.visionai.v1alpha1.Event.encode(message.events[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListEventsResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListEventsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListEventsResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IListEventsResponse} message ListEventsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEventsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEventsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ListEventsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ListEventsResponse} ListEventsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEventsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ListEventsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.events && message.events.length)) + message.events = []; + message.events.push($root.google.cloud.visionai.v1alpha1.Event.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListEventsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListEventsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ListEventsResponse} ListEventsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEventsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEventsResponse message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ListEventsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEventsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.events != null && message.hasOwnProperty("events")) { + if (!Array.isArray(message.events)) + return "events: array expected"; + for (var i = 0; i < message.events.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.Event.verify(message.events[i], long + 1); + if (error) + return "events." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListEventsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ListEventsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ListEventsResponse} ListEventsResponse + */ + ListEventsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ListEventsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ListEventsResponse(); + if (object.events) { + if (!Array.isArray(object.events)) + throw TypeError(".google.cloud.visionai.v1alpha1.ListEventsResponse.events: array expected"); + message.events = []; + for (var i = 0; i < object.events.length; ++i) { + if (typeof object.events[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ListEventsResponse.events: object expected"); + message.events[i] = $root.google.cloud.visionai.v1alpha1.Event.fromObject(object.events[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.visionai.v1alpha1.ListEventsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListEventsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ListEventsResponse + * @static + * @param {google.cloud.visionai.v1alpha1.ListEventsResponse} message ListEventsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEventsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.events = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.events && message.events.length) { + object.events = []; + for (var j = 0; j < message.events.length; ++j) + object.events[j] = $root.google.cloud.visionai.v1alpha1.Event.toObject(message.events[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListEventsResponse to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ListEventsResponse + * @instance + * @returns {Object.} JSON object + */ + ListEventsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEventsResponse + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ListEventsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEventsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ListEventsResponse"; + }; + + return ListEventsResponse; + })(); + + v1alpha1.GetEventRequest = (function() { + + /** + * Properties of a GetEventRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IGetEventRequest + * @property {string|null} [name] GetEventRequest name + */ + + /** + * Constructs a new GetEventRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a GetEventRequest. + * @implements IGetEventRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IGetEventRequest=} [properties] Properties to set + */ + function GetEventRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetEventRequest name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.GetEventRequest + * @instance + */ + GetEventRequest.prototype.name = ""; + + /** + * Creates a new GetEventRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.GetEventRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IGetEventRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.GetEventRequest} GetEventRequest instance + */ + GetEventRequest.create = function create(properties) { + return new GetEventRequest(properties); + }; + + /** + * Encodes the specified GetEventRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetEventRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.GetEventRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IGetEventRequest} message GetEventRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEventRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetEventRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetEventRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.GetEventRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IGetEventRequest} message GetEventRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEventRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEventRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.GetEventRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.GetEventRequest} GetEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEventRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.GetEventRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetEventRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.GetEventRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.GetEventRequest} GetEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEventRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEventRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.GetEventRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEventRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetEventRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.GetEventRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.GetEventRequest} GetEventRequest + */ + GetEventRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.GetEventRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.GetEventRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetEventRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.GetEventRequest + * @static + * @param {google.cloud.visionai.v1alpha1.GetEventRequest} message GetEventRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEventRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetEventRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.GetEventRequest + * @instance + * @returns {Object.} JSON object + */ + GetEventRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetEventRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.GetEventRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetEventRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.GetEventRequest"; + }; + + return GetEventRequest; + })(); + + v1alpha1.CreateEventRequest = (function() { + + /** + * Properties of a CreateEventRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface ICreateEventRequest + * @property {string|null} [parent] CreateEventRequest parent + * @property {string|null} [eventId] CreateEventRequest eventId + * @property {google.cloud.visionai.v1alpha1.IEvent|null} [event] CreateEventRequest event + * @property {string|null} [requestId] CreateEventRequest requestId + */ + + /** + * Constructs a new CreateEventRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a CreateEventRequest. + * @implements ICreateEventRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.ICreateEventRequest=} [properties] Properties to set + */ + function CreateEventRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateEventRequest parent. + * @member {string} parent + * @memberof google.cloud.visionai.v1alpha1.CreateEventRequest + * @instance + */ + CreateEventRequest.prototype.parent = ""; + + /** + * CreateEventRequest eventId. + * @member {string} eventId + * @memberof google.cloud.visionai.v1alpha1.CreateEventRequest + * @instance + */ + CreateEventRequest.prototype.eventId = ""; + + /** + * CreateEventRequest event. + * @member {google.cloud.visionai.v1alpha1.IEvent|null|undefined} event + * @memberof google.cloud.visionai.v1alpha1.CreateEventRequest + * @instance + */ + CreateEventRequest.prototype.event = null; + + /** + * CreateEventRequest requestId. + * @member {string} requestId + * @memberof google.cloud.visionai.v1alpha1.CreateEventRequest + * @instance + */ + CreateEventRequest.prototype.requestId = ""; + + /** + * Creates a new CreateEventRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.CreateEventRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ICreateEventRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.CreateEventRequest} CreateEventRequest instance + */ + CreateEventRequest.create = function create(properties) { + return new CreateEventRequest(properties); + }; + + /** + * Encodes the specified CreateEventRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateEventRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.CreateEventRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ICreateEventRequest} message CreateEventRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateEventRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.eventId != null && Object.hasOwnProperty.call(message, "eventId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.eventId); + if (message.event != null && Object.hasOwnProperty.call(message, "event")) + $root.google.cloud.visionai.v1alpha1.Event.encode(message.event, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateEventRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateEventRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.CreateEventRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ICreateEventRequest} message CreateEventRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateEventRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateEventRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.CreateEventRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.CreateEventRequest} CreateEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateEventRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.CreateEventRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.eventId = reader.string(); + break; + } + case 3: { + message.event = $root.google.cloud.visionai.v1alpha1.Event.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreateEventRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.CreateEventRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.CreateEventRequest} CreateEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateEventRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateEventRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.CreateEventRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateEventRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.eventId != null && message.hasOwnProperty("eventId")) + if (!$util.isString(message.eventId)) + return "eventId: string expected"; + if (message.event != null && message.hasOwnProperty("event")) { + var error = $root.google.cloud.visionai.v1alpha1.Event.verify(message.event, long + 1); + if (error) + return "event." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateEventRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.CreateEventRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.CreateEventRequest} CreateEventRequest + */ + CreateEventRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.CreateEventRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.CreateEventRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.eventId != null) + message.eventId = String(object.eventId); + if (object.event != null) { + if (typeof object.event !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.CreateEventRequest.event: object expected"); + message.event = $root.google.cloud.visionai.v1alpha1.Event.fromObject(object.event, long + 1); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateEventRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.CreateEventRequest + * @static + * @param {google.cloud.visionai.v1alpha1.CreateEventRequest} message CreateEventRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateEventRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.eventId = ""; + object.event = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.eventId != null && message.hasOwnProperty("eventId")) + object.eventId = message.eventId; + if (message.event != null && message.hasOwnProperty("event")) + object.event = $root.google.cloud.visionai.v1alpha1.Event.toObject(message.event, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateEventRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.CreateEventRequest + * @instance + * @returns {Object.} JSON object + */ + CreateEventRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateEventRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.CreateEventRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateEventRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.CreateEventRequest"; + }; + + return CreateEventRequest; + })(); + + v1alpha1.UpdateEventRequest = (function() { + + /** + * Properties of an UpdateEventRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IUpdateEventRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateEventRequest updateMask + * @property {google.cloud.visionai.v1alpha1.IEvent|null} [event] UpdateEventRequest event + * @property {string|null} [requestId] UpdateEventRequest requestId + */ + + /** + * Constructs a new UpdateEventRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents an UpdateEventRequest. + * @implements IUpdateEventRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IUpdateEventRequest=} [properties] Properties to set + */ + function UpdateEventRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateEventRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.visionai.v1alpha1.UpdateEventRequest + * @instance + */ + UpdateEventRequest.prototype.updateMask = null; + + /** + * UpdateEventRequest event. + * @member {google.cloud.visionai.v1alpha1.IEvent|null|undefined} event + * @memberof google.cloud.visionai.v1alpha1.UpdateEventRequest + * @instance + */ + UpdateEventRequest.prototype.event = null; + + /** + * UpdateEventRequest requestId. + * @member {string} requestId + * @memberof google.cloud.visionai.v1alpha1.UpdateEventRequest + * @instance + */ + UpdateEventRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateEventRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.UpdateEventRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IUpdateEventRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.UpdateEventRequest} UpdateEventRequest instance + */ + UpdateEventRequest.create = function create(properties) { + return new UpdateEventRequest(properties); + }; + + /** + * Encodes the specified UpdateEventRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateEventRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.UpdateEventRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IUpdateEventRequest} message UpdateEventRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateEventRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.event != null && Object.hasOwnProperty.call(message, "event")) + $root.google.cloud.visionai.v1alpha1.Event.encode(message.event, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified UpdateEventRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateEventRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.UpdateEventRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IUpdateEventRequest} message UpdateEventRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateEventRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateEventRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.UpdateEventRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.UpdateEventRequest} UpdateEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateEventRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.UpdateEventRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.event = $root.google.cloud.visionai.v1alpha1.Event.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateEventRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.UpdateEventRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.UpdateEventRequest} UpdateEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateEventRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateEventRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.UpdateEventRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateEventRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + if (message.event != null && message.hasOwnProperty("event")) { + var error = $root.google.cloud.visionai.v1alpha1.Event.verify(message.event, long + 1); + if (error) + return "event." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an UpdateEventRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.UpdateEventRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.UpdateEventRequest} UpdateEventRequest + */ + UpdateEventRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.UpdateEventRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.UpdateEventRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.UpdateEventRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + if (object.event != null) { + if (typeof object.event !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.UpdateEventRequest.event: object expected"); + message.event = $root.google.cloud.visionai.v1alpha1.Event.fromObject(object.event, long + 1); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateEventRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.UpdateEventRequest + * @static + * @param {google.cloud.visionai.v1alpha1.UpdateEventRequest} message UpdateEventRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateEventRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.event = null; + object.requestId = ""; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.event != null && message.hasOwnProperty("event")) + object.event = $root.google.cloud.visionai.v1alpha1.Event.toObject(message.event, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UpdateEventRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.UpdateEventRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateEventRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateEventRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.UpdateEventRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateEventRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.UpdateEventRequest"; + }; + + return UpdateEventRequest; + })(); + + v1alpha1.DeleteEventRequest = (function() { + + /** + * Properties of a DeleteEventRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IDeleteEventRequest + * @property {string|null} [name] DeleteEventRequest name + * @property {string|null} [requestId] DeleteEventRequest requestId + */ + + /** + * Constructs a new DeleteEventRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a DeleteEventRequest. + * @implements IDeleteEventRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IDeleteEventRequest=} [properties] Properties to set + */ + function DeleteEventRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteEventRequest name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.DeleteEventRequest + * @instance + */ + DeleteEventRequest.prototype.name = ""; + + /** + * DeleteEventRequest requestId. + * @member {string} requestId + * @memberof google.cloud.visionai.v1alpha1.DeleteEventRequest + * @instance + */ + DeleteEventRequest.prototype.requestId = ""; + + /** + * Creates a new DeleteEventRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.DeleteEventRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IDeleteEventRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.DeleteEventRequest} DeleteEventRequest instance + */ + DeleteEventRequest.create = function create(properties) { + return new DeleteEventRequest(properties); + }; + + /** + * Encodes the specified DeleteEventRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteEventRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.DeleteEventRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IDeleteEventRequest} message DeleteEventRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteEventRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified DeleteEventRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteEventRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.DeleteEventRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IDeleteEventRequest} message DeleteEventRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteEventRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteEventRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.DeleteEventRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.DeleteEventRequest} DeleteEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteEventRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.DeleteEventRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteEventRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.DeleteEventRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.DeleteEventRequest} DeleteEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteEventRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteEventRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.DeleteEventRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteEventRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a DeleteEventRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.DeleteEventRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.DeleteEventRequest} DeleteEventRequest + */ + DeleteEventRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.DeleteEventRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.DeleteEventRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteEventRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.DeleteEventRequest + * @static + * @param {google.cloud.visionai.v1alpha1.DeleteEventRequest} message DeleteEventRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteEventRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this DeleteEventRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.DeleteEventRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteEventRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteEventRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.DeleteEventRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteEventRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.DeleteEventRequest"; + }; + + return DeleteEventRequest; + })(); + + v1alpha1.ListSeriesRequest = (function() { + + /** + * Properties of a ListSeriesRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IListSeriesRequest + * @property {string|null} [parent] ListSeriesRequest parent + * @property {number|null} [pageSize] ListSeriesRequest pageSize + * @property {string|null} [pageToken] ListSeriesRequest pageToken + * @property {string|null} [filter] ListSeriesRequest filter + * @property {string|null} [orderBy] ListSeriesRequest orderBy + */ + + /** + * Constructs a new ListSeriesRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a ListSeriesRequest. + * @implements IListSeriesRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IListSeriesRequest=} [properties] Properties to set + */ + function ListSeriesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSeriesRequest parent. + * @member {string} parent + * @memberof google.cloud.visionai.v1alpha1.ListSeriesRequest + * @instance + */ + ListSeriesRequest.prototype.parent = ""; + + /** + * ListSeriesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.visionai.v1alpha1.ListSeriesRequest + * @instance + */ + ListSeriesRequest.prototype.pageSize = 0; + + /** + * ListSeriesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.visionai.v1alpha1.ListSeriesRequest + * @instance + */ + ListSeriesRequest.prototype.pageToken = ""; + + /** + * ListSeriesRequest filter. + * @member {string} filter + * @memberof google.cloud.visionai.v1alpha1.ListSeriesRequest + * @instance + */ + ListSeriesRequest.prototype.filter = ""; + + /** + * ListSeriesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.visionai.v1alpha1.ListSeriesRequest + * @instance + */ + ListSeriesRequest.prototype.orderBy = ""; + + /** + * Creates a new ListSeriesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ListSeriesRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IListSeriesRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ListSeriesRequest} ListSeriesRequest instance + */ + ListSeriesRequest.create = function create(properties) { + return new ListSeriesRequest(properties); + }; + + /** + * Encodes the specified ListSeriesRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListSeriesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ListSeriesRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IListSeriesRequest} message ListSeriesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSeriesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListSeriesRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListSeriesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListSeriesRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IListSeriesRequest} message ListSeriesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSeriesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSeriesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ListSeriesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ListSeriesRequest} ListSeriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSeriesRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ListSeriesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListSeriesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListSeriesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ListSeriesRequest} ListSeriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSeriesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSeriesRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ListSeriesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSeriesRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListSeriesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ListSeriesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ListSeriesRequest} ListSeriesRequest + */ + ListSeriesRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ListSeriesRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ListSeriesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListSeriesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ListSeriesRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ListSeriesRequest} message ListSeriesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSeriesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListSeriesRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ListSeriesRequest + * @instance + * @returns {Object.} JSON object + */ + ListSeriesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSeriesRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ListSeriesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSeriesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ListSeriesRequest"; + }; + + return ListSeriesRequest; + })(); + + v1alpha1.ListSeriesResponse = (function() { + + /** + * Properties of a ListSeriesResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IListSeriesResponse + * @property {Array.|null} [series] ListSeriesResponse series + * @property {string|null} [nextPageToken] ListSeriesResponse nextPageToken + * @property {Array.|null} [unreachable] ListSeriesResponse unreachable + */ + + /** + * Constructs a new ListSeriesResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a ListSeriesResponse. + * @implements IListSeriesResponse + * @constructor + * @param {google.cloud.visionai.v1alpha1.IListSeriesResponse=} [properties] Properties to set + */ + function ListSeriesResponse(properties) { + this.series = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSeriesResponse series. + * @member {Array.} series + * @memberof google.cloud.visionai.v1alpha1.ListSeriesResponse + * @instance + */ + ListSeriesResponse.prototype.series = $util.emptyArray; + + /** + * ListSeriesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.visionai.v1alpha1.ListSeriesResponse + * @instance + */ + ListSeriesResponse.prototype.nextPageToken = ""; + + /** + * ListSeriesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.visionai.v1alpha1.ListSeriesResponse + * @instance + */ + ListSeriesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListSeriesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ListSeriesResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IListSeriesResponse=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ListSeriesResponse} ListSeriesResponse instance + */ + ListSeriesResponse.create = function create(properties) { + return new ListSeriesResponse(properties); + }; + + /** + * Encodes the specified ListSeriesResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListSeriesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ListSeriesResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IListSeriesResponse} message ListSeriesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSeriesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.series != null && message.series.length) + for (var i = 0; i < message.series.length; ++i) + $root.google.cloud.visionai.v1alpha1.Series.encode(message.series[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListSeriesResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListSeriesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListSeriesResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IListSeriesResponse} message ListSeriesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSeriesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSeriesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ListSeriesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ListSeriesResponse} ListSeriesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSeriesResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ListSeriesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.series && message.series.length)) + message.series = []; + message.series.push($root.google.cloud.visionai.v1alpha1.Series.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListSeriesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListSeriesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ListSeriesResponse} ListSeriesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSeriesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSeriesResponse message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ListSeriesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSeriesResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.series != null && message.hasOwnProperty("series")) { + if (!Array.isArray(message.series)) + return "series: array expected"; + for (var i = 0; i < message.series.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.Series.verify(message.series[i], long + 1); + if (error) + return "series." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListSeriesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ListSeriesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ListSeriesResponse} ListSeriesResponse + */ + ListSeriesResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ListSeriesResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ListSeriesResponse(); + if (object.series) { + if (!Array.isArray(object.series)) + throw TypeError(".google.cloud.visionai.v1alpha1.ListSeriesResponse.series: array expected"); + message.series = []; + for (var i = 0; i < object.series.length; ++i) { + if (typeof object.series[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ListSeriesResponse.series: object expected"); + message.series[i] = $root.google.cloud.visionai.v1alpha1.Series.fromObject(object.series[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.visionai.v1alpha1.ListSeriesResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListSeriesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ListSeriesResponse + * @static + * @param {google.cloud.visionai.v1alpha1.ListSeriesResponse} message ListSeriesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSeriesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.series = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.series && message.series.length) { + object.series = []; + for (var j = 0; j < message.series.length; ++j) + object.series[j] = $root.google.cloud.visionai.v1alpha1.Series.toObject(message.series[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListSeriesResponse to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ListSeriesResponse + * @instance + * @returns {Object.} JSON object + */ + ListSeriesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSeriesResponse + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ListSeriesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSeriesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ListSeriesResponse"; + }; + + return ListSeriesResponse; + })(); + + v1alpha1.GetSeriesRequest = (function() { + + /** + * Properties of a GetSeriesRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IGetSeriesRequest + * @property {string|null} [name] GetSeriesRequest name + */ + + /** + * Constructs a new GetSeriesRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a GetSeriesRequest. + * @implements IGetSeriesRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IGetSeriesRequest=} [properties] Properties to set + */ + function GetSeriesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetSeriesRequest name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.GetSeriesRequest + * @instance + */ + GetSeriesRequest.prototype.name = ""; + + /** + * Creates a new GetSeriesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.GetSeriesRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IGetSeriesRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.GetSeriesRequest} GetSeriesRequest instance + */ + GetSeriesRequest.create = function create(properties) { + return new GetSeriesRequest(properties); + }; + + /** + * Encodes the specified GetSeriesRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetSeriesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.GetSeriesRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IGetSeriesRequest} message GetSeriesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSeriesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetSeriesRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetSeriesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.GetSeriesRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IGetSeriesRequest} message GetSeriesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSeriesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSeriesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.GetSeriesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.GetSeriesRequest} GetSeriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSeriesRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.GetSeriesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetSeriesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.GetSeriesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.GetSeriesRequest} GetSeriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSeriesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSeriesRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.GetSeriesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSeriesRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetSeriesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.GetSeriesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.GetSeriesRequest} GetSeriesRequest + */ + GetSeriesRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.GetSeriesRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.GetSeriesRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetSeriesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.GetSeriesRequest + * @static + * @param {google.cloud.visionai.v1alpha1.GetSeriesRequest} message GetSeriesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSeriesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetSeriesRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.GetSeriesRequest + * @instance + * @returns {Object.} JSON object + */ + GetSeriesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetSeriesRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.GetSeriesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetSeriesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.GetSeriesRequest"; + }; + + return GetSeriesRequest; + })(); + + v1alpha1.CreateSeriesRequest = (function() { + + /** + * Properties of a CreateSeriesRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface ICreateSeriesRequest + * @property {string|null} [parent] CreateSeriesRequest parent + * @property {string|null} [seriesId] CreateSeriesRequest seriesId + * @property {google.cloud.visionai.v1alpha1.ISeries|null} [series] CreateSeriesRequest series + * @property {string|null} [requestId] CreateSeriesRequest requestId + */ + + /** + * Constructs a new CreateSeriesRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a CreateSeriesRequest. + * @implements ICreateSeriesRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.ICreateSeriesRequest=} [properties] Properties to set + */ + function CreateSeriesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateSeriesRequest parent. + * @member {string} parent + * @memberof google.cloud.visionai.v1alpha1.CreateSeriesRequest + * @instance + */ + CreateSeriesRequest.prototype.parent = ""; + + /** + * CreateSeriesRequest seriesId. + * @member {string} seriesId + * @memberof google.cloud.visionai.v1alpha1.CreateSeriesRequest + * @instance + */ + CreateSeriesRequest.prototype.seriesId = ""; + + /** + * CreateSeriesRequest series. + * @member {google.cloud.visionai.v1alpha1.ISeries|null|undefined} series + * @memberof google.cloud.visionai.v1alpha1.CreateSeriesRequest + * @instance + */ + CreateSeriesRequest.prototype.series = null; + + /** + * CreateSeriesRequest requestId. + * @member {string} requestId + * @memberof google.cloud.visionai.v1alpha1.CreateSeriesRequest + * @instance + */ + CreateSeriesRequest.prototype.requestId = ""; + + /** + * Creates a new CreateSeriesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.CreateSeriesRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ICreateSeriesRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.CreateSeriesRequest} CreateSeriesRequest instance + */ + CreateSeriesRequest.create = function create(properties) { + return new CreateSeriesRequest(properties); + }; + + /** + * Encodes the specified CreateSeriesRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateSeriesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.CreateSeriesRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ICreateSeriesRequest} message CreateSeriesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSeriesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.seriesId != null && Object.hasOwnProperty.call(message, "seriesId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.seriesId); + if (message.series != null && Object.hasOwnProperty.call(message, "series")) + $root.google.cloud.visionai.v1alpha1.Series.encode(message.series, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateSeriesRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateSeriesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.CreateSeriesRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ICreateSeriesRequest} message CreateSeriesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSeriesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateSeriesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.CreateSeriesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.CreateSeriesRequest} CreateSeriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSeriesRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.CreateSeriesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.seriesId = reader.string(); + break; + } + case 3: { + message.series = $root.google.cloud.visionai.v1alpha1.Series.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreateSeriesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.CreateSeriesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.CreateSeriesRequest} CreateSeriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSeriesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateSeriesRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.CreateSeriesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateSeriesRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.seriesId != null && message.hasOwnProperty("seriesId")) + if (!$util.isString(message.seriesId)) + return "seriesId: string expected"; + if (message.series != null && message.hasOwnProperty("series")) { + var error = $root.google.cloud.visionai.v1alpha1.Series.verify(message.series, long + 1); + if (error) + return "series." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateSeriesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.CreateSeriesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.CreateSeriesRequest} CreateSeriesRequest + */ + CreateSeriesRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.CreateSeriesRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.CreateSeriesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.seriesId != null) + message.seriesId = String(object.seriesId); + if (object.series != null) { + if (typeof object.series !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.CreateSeriesRequest.series: object expected"); + message.series = $root.google.cloud.visionai.v1alpha1.Series.fromObject(object.series, long + 1); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateSeriesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.CreateSeriesRequest + * @static + * @param {google.cloud.visionai.v1alpha1.CreateSeriesRequest} message CreateSeriesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateSeriesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.seriesId = ""; + object.series = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.seriesId != null && message.hasOwnProperty("seriesId")) + object.seriesId = message.seriesId; + if (message.series != null && message.hasOwnProperty("series")) + object.series = $root.google.cloud.visionai.v1alpha1.Series.toObject(message.series, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateSeriesRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.CreateSeriesRequest + * @instance + * @returns {Object.} JSON object + */ + CreateSeriesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateSeriesRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.CreateSeriesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateSeriesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.CreateSeriesRequest"; + }; + + return CreateSeriesRequest; + })(); + + v1alpha1.UpdateSeriesRequest = (function() { + + /** + * Properties of an UpdateSeriesRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IUpdateSeriesRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSeriesRequest updateMask + * @property {google.cloud.visionai.v1alpha1.ISeries|null} [series] UpdateSeriesRequest series + * @property {string|null} [requestId] UpdateSeriesRequest requestId + */ + + /** + * Constructs a new UpdateSeriesRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents an UpdateSeriesRequest. + * @implements IUpdateSeriesRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IUpdateSeriesRequest=} [properties] Properties to set + */ + function UpdateSeriesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateSeriesRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.visionai.v1alpha1.UpdateSeriesRequest + * @instance + */ + UpdateSeriesRequest.prototype.updateMask = null; + + /** + * UpdateSeriesRequest series. + * @member {google.cloud.visionai.v1alpha1.ISeries|null|undefined} series + * @memberof google.cloud.visionai.v1alpha1.UpdateSeriesRequest + * @instance + */ + UpdateSeriesRequest.prototype.series = null; + + /** + * UpdateSeriesRequest requestId. + * @member {string} requestId + * @memberof google.cloud.visionai.v1alpha1.UpdateSeriesRequest + * @instance + */ + UpdateSeriesRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateSeriesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.UpdateSeriesRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IUpdateSeriesRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.UpdateSeriesRequest} UpdateSeriesRequest instance + */ + UpdateSeriesRequest.create = function create(properties) { + return new UpdateSeriesRequest(properties); + }; + + /** + * Encodes the specified UpdateSeriesRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateSeriesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.UpdateSeriesRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IUpdateSeriesRequest} message UpdateSeriesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSeriesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.series != null && Object.hasOwnProperty.call(message, "series")) + $root.google.cloud.visionai.v1alpha1.Series.encode(message.series, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified UpdateSeriesRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateSeriesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.UpdateSeriesRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IUpdateSeriesRequest} message UpdateSeriesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSeriesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateSeriesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.UpdateSeriesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.UpdateSeriesRequest} UpdateSeriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSeriesRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.UpdateSeriesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.series = $root.google.cloud.visionai.v1alpha1.Series.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateSeriesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.UpdateSeriesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.UpdateSeriesRequest} UpdateSeriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSeriesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateSeriesRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.UpdateSeriesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateSeriesRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + if (message.series != null && message.hasOwnProperty("series")) { + var error = $root.google.cloud.visionai.v1alpha1.Series.verify(message.series, long + 1); + if (error) + return "series." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an UpdateSeriesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.UpdateSeriesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.UpdateSeriesRequest} UpdateSeriesRequest + */ + UpdateSeriesRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.UpdateSeriesRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.UpdateSeriesRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.UpdateSeriesRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + if (object.series != null) { + if (typeof object.series !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.UpdateSeriesRequest.series: object expected"); + message.series = $root.google.cloud.visionai.v1alpha1.Series.fromObject(object.series, long + 1); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateSeriesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.UpdateSeriesRequest + * @static + * @param {google.cloud.visionai.v1alpha1.UpdateSeriesRequest} message UpdateSeriesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateSeriesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.series = null; + object.requestId = ""; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.series != null && message.hasOwnProperty("series")) + object.series = $root.google.cloud.visionai.v1alpha1.Series.toObject(message.series, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UpdateSeriesRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.UpdateSeriesRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateSeriesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateSeriesRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.UpdateSeriesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateSeriesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.UpdateSeriesRequest"; + }; + + return UpdateSeriesRequest; + })(); + + v1alpha1.DeleteSeriesRequest = (function() { + + /** + * Properties of a DeleteSeriesRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IDeleteSeriesRequest + * @property {string|null} [name] DeleteSeriesRequest name + * @property {string|null} [requestId] DeleteSeriesRequest requestId + */ + + /** + * Constructs a new DeleteSeriesRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a DeleteSeriesRequest. + * @implements IDeleteSeriesRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IDeleteSeriesRequest=} [properties] Properties to set + */ + function DeleteSeriesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteSeriesRequest name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.DeleteSeriesRequest + * @instance + */ + DeleteSeriesRequest.prototype.name = ""; + + /** + * DeleteSeriesRequest requestId. + * @member {string} requestId + * @memberof google.cloud.visionai.v1alpha1.DeleteSeriesRequest + * @instance + */ + DeleteSeriesRequest.prototype.requestId = ""; + + /** + * Creates a new DeleteSeriesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.DeleteSeriesRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IDeleteSeriesRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.DeleteSeriesRequest} DeleteSeriesRequest instance + */ + DeleteSeriesRequest.create = function create(properties) { + return new DeleteSeriesRequest(properties); + }; + + /** + * Encodes the specified DeleteSeriesRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteSeriesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.DeleteSeriesRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IDeleteSeriesRequest} message DeleteSeriesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSeriesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified DeleteSeriesRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteSeriesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.DeleteSeriesRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IDeleteSeriesRequest} message DeleteSeriesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSeriesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteSeriesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.DeleteSeriesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.DeleteSeriesRequest} DeleteSeriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSeriesRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.DeleteSeriesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteSeriesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.DeleteSeriesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.DeleteSeriesRequest} DeleteSeriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSeriesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteSeriesRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.DeleteSeriesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteSeriesRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a DeleteSeriesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.DeleteSeriesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.DeleteSeriesRequest} DeleteSeriesRequest + */ + DeleteSeriesRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.DeleteSeriesRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.DeleteSeriesRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteSeriesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.DeleteSeriesRequest + * @static + * @param {google.cloud.visionai.v1alpha1.DeleteSeriesRequest} message DeleteSeriesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteSeriesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this DeleteSeriesRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.DeleteSeriesRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteSeriesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteSeriesRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.DeleteSeriesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteSeriesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.DeleteSeriesRequest"; + }; + + return DeleteSeriesRequest; + })(); + + v1alpha1.MaterializeChannelRequest = (function() { + + /** + * Properties of a MaterializeChannelRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IMaterializeChannelRequest + * @property {string|null} [parent] MaterializeChannelRequest parent + * @property {string|null} [channelId] MaterializeChannelRequest channelId + * @property {google.cloud.visionai.v1alpha1.IChannel|null} [channel] MaterializeChannelRequest channel + * @property {string|null} [requestId] MaterializeChannelRequest requestId + */ + + /** + * Constructs a new MaterializeChannelRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a MaterializeChannelRequest. + * @implements IMaterializeChannelRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IMaterializeChannelRequest=} [properties] Properties to set + */ + function MaterializeChannelRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * MaterializeChannelRequest parent. + * @member {string} parent + * @memberof google.cloud.visionai.v1alpha1.MaterializeChannelRequest + * @instance + */ + MaterializeChannelRequest.prototype.parent = ""; + + /** + * MaterializeChannelRequest channelId. + * @member {string} channelId + * @memberof google.cloud.visionai.v1alpha1.MaterializeChannelRequest + * @instance + */ + MaterializeChannelRequest.prototype.channelId = ""; + + /** + * MaterializeChannelRequest channel. + * @member {google.cloud.visionai.v1alpha1.IChannel|null|undefined} channel + * @memberof google.cloud.visionai.v1alpha1.MaterializeChannelRequest + * @instance + */ + MaterializeChannelRequest.prototype.channel = null; + + /** + * MaterializeChannelRequest requestId. + * @member {string} requestId + * @memberof google.cloud.visionai.v1alpha1.MaterializeChannelRequest + * @instance + */ + MaterializeChannelRequest.prototype.requestId = ""; + + /** + * Creates a new MaterializeChannelRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.MaterializeChannelRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IMaterializeChannelRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.MaterializeChannelRequest} MaterializeChannelRequest instance + */ + MaterializeChannelRequest.create = function create(properties) { + return new MaterializeChannelRequest(properties); + }; + + /** + * Encodes the specified MaterializeChannelRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.MaterializeChannelRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.MaterializeChannelRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IMaterializeChannelRequest} message MaterializeChannelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MaterializeChannelRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.channelId != null && Object.hasOwnProperty.call(message, "channelId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.channelId); + if (message.channel != null && Object.hasOwnProperty.call(message, "channel")) + $root.google.cloud.visionai.v1alpha1.Channel.encode(message.channel, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified MaterializeChannelRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.MaterializeChannelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.MaterializeChannelRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IMaterializeChannelRequest} message MaterializeChannelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MaterializeChannelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MaterializeChannelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.MaterializeChannelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.MaterializeChannelRequest} MaterializeChannelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MaterializeChannelRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.MaterializeChannelRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.channelId = reader.string(); + break; + } + case 3: { + message.channel = $root.google.cloud.visionai.v1alpha1.Channel.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a MaterializeChannelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.MaterializeChannelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.MaterializeChannelRequest} MaterializeChannelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MaterializeChannelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MaterializeChannelRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.MaterializeChannelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MaterializeChannelRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.channelId != null && message.hasOwnProperty("channelId")) + if (!$util.isString(message.channelId)) + return "channelId: string expected"; + if (message.channel != null && message.hasOwnProperty("channel")) { + var error = $root.google.cloud.visionai.v1alpha1.Channel.verify(message.channel, long + 1); + if (error) + return "channel." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a MaterializeChannelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.MaterializeChannelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.MaterializeChannelRequest} MaterializeChannelRequest + */ + MaterializeChannelRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.MaterializeChannelRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.MaterializeChannelRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.channelId != null) + message.channelId = String(object.channelId); + if (object.channel != null) { + if (typeof object.channel !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.MaterializeChannelRequest.channel: object expected"); + message.channel = $root.google.cloud.visionai.v1alpha1.Channel.fromObject(object.channel, long + 1); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a MaterializeChannelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.MaterializeChannelRequest + * @static + * @param {google.cloud.visionai.v1alpha1.MaterializeChannelRequest} message MaterializeChannelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MaterializeChannelRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.channelId = ""; + object.channel = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.channelId != null && message.hasOwnProperty("channelId")) + object.channelId = message.channelId; + if (message.channel != null && message.hasOwnProperty("channel")) + object.channel = $root.google.cloud.visionai.v1alpha1.Channel.toObject(message.channel, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this MaterializeChannelRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.MaterializeChannelRequest + * @instance + * @returns {Object.} JSON object + */ + MaterializeChannelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MaterializeChannelRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.MaterializeChannelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MaterializeChannelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.MaterializeChannelRequest"; + }; + + return MaterializeChannelRequest; + })(); + + v1alpha1.Warehouse = (function() { + + /** + * Constructs a new Warehouse service. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a Warehouse + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Warehouse(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Warehouse.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Warehouse; + + /** + * Creates new Warehouse service using the specified rpc implementation. + * @function create + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Warehouse} RPC service. Useful where requests and/or responses are streamed. + */ + Warehouse.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|createAsset}. + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @typedef CreateAssetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.visionai.v1alpha1.Asset} [response] Asset + */ + + /** + * Calls CreateAsset. + * @function createAsset + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.ICreateAssetRequest} request CreateAssetRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.Warehouse.CreateAssetCallback} callback Node-style callback called with the error, if any, and Asset + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Warehouse.prototype.createAsset = function createAsset(request, callback) { + return this.rpcCall(createAsset, $root.google.cloud.visionai.v1alpha1.CreateAssetRequest, $root.google.cloud.visionai.v1alpha1.Asset, request, callback); + }, "name", { value: "CreateAsset" }); + + /** + * Calls CreateAsset. + * @function createAsset + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.ICreateAssetRequest} request CreateAssetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|updateAsset}. + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @typedef UpdateAssetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.visionai.v1alpha1.Asset} [response] Asset + */ + + /** + * Calls UpdateAsset. + * @function updateAsset + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.IUpdateAssetRequest} request UpdateAssetRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.Warehouse.UpdateAssetCallback} callback Node-style callback called with the error, if any, and Asset + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Warehouse.prototype.updateAsset = function updateAsset(request, callback) { + return this.rpcCall(updateAsset, $root.google.cloud.visionai.v1alpha1.UpdateAssetRequest, $root.google.cloud.visionai.v1alpha1.Asset, request, callback); + }, "name", { value: "UpdateAsset" }); + + /** + * Calls UpdateAsset. + * @function updateAsset + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.IUpdateAssetRequest} request UpdateAssetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|getAsset}. + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @typedef GetAssetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.visionai.v1alpha1.Asset} [response] Asset + */ + + /** + * Calls GetAsset. + * @function getAsset + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.IGetAssetRequest} request GetAssetRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.Warehouse.GetAssetCallback} callback Node-style callback called with the error, if any, and Asset + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Warehouse.prototype.getAsset = function getAsset(request, callback) { + return this.rpcCall(getAsset, $root.google.cloud.visionai.v1alpha1.GetAssetRequest, $root.google.cloud.visionai.v1alpha1.Asset, request, callback); + }, "name", { value: "GetAsset" }); + + /** + * Calls GetAsset. + * @function getAsset + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.IGetAssetRequest} request GetAssetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|listAssets}. + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @typedef ListAssetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.visionai.v1alpha1.ListAssetsResponse} [response] ListAssetsResponse + */ + + /** + * Calls ListAssets. + * @function listAssets + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.IListAssetsRequest} request ListAssetsRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.Warehouse.ListAssetsCallback} callback Node-style callback called with the error, if any, and ListAssetsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Warehouse.prototype.listAssets = function listAssets(request, callback) { + return this.rpcCall(listAssets, $root.google.cloud.visionai.v1alpha1.ListAssetsRequest, $root.google.cloud.visionai.v1alpha1.ListAssetsResponse, request, callback); + }, "name", { value: "ListAssets" }); + + /** + * Calls ListAssets. + * @function listAssets + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.IListAssetsRequest} request ListAssetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|deleteAsset}. + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @typedef DeleteAssetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteAsset. + * @function deleteAsset + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.IDeleteAssetRequest} request DeleteAssetRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.Warehouse.DeleteAssetCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Warehouse.prototype.deleteAsset = function deleteAsset(request, callback) { + return this.rpcCall(deleteAsset, $root.google.cloud.visionai.v1alpha1.DeleteAssetRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteAsset" }); + + /** + * Calls DeleteAsset. + * @function deleteAsset + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.IDeleteAssetRequest} request DeleteAssetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|createCorpus}. + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @typedef CreateCorpusCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateCorpus. + * @function createCorpus + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.ICreateCorpusRequest} request CreateCorpusRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.Warehouse.CreateCorpusCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Warehouse.prototype.createCorpus = function createCorpus(request, callback) { + return this.rpcCall(createCorpus, $root.google.cloud.visionai.v1alpha1.CreateCorpusRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateCorpus" }); + + /** + * Calls CreateCorpus. + * @function createCorpus + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.ICreateCorpusRequest} request CreateCorpusRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|getCorpus}. + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @typedef GetCorpusCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.visionai.v1alpha1.Corpus} [response] Corpus + */ + + /** + * Calls GetCorpus. + * @function getCorpus + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.IGetCorpusRequest} request GetCorpusRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.Warehouse.GetCorpusCallback} callback Node-style callback called with the error, if any, and Corpus + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Warehouse.prototype.getCorpus = function getCorpus(request, callback) { + return this.rpcCall(getCorpus, $root.google.cloud.visionai.v1alpha1.GetCorpusRequest, $root.google.cloud.visionai.v1alpha1.Corpus, request, callback); + }, "name", { value: "GetCorpus" }); + + /** + * Calls GetCorpus. + * @function getCorpus + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.IGetCorpusRequest} request GetCorpusRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|updateCorpus}. + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @typedef UpdateCorpusCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.visionai.v1alpha1.Corpus} [response] Corpus + */ + + /** + * Calls UpdateCorpus. + * @function updateCorpus + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.IUpdateCorpusRequest} request UpdateCorpusRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.Warehouse.UpdateCorpusCallback} callback Node-style callback called with the error, if any, and Corpus + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Warehouse.prototype.updateCorpus = function updateCorpus(request, callback) { + return this.rpcCall(updateCorpus, $root.google.cloud.visionai.v1alpha1.UpdateCorpusRequest, $root.google.cloud.visionai.v1alpha1.Corpus, request, callback); + }, "name", { value: "UpdateCorpus" }); + + /** + * Calls UpdateCorpus. + * @function updateCorpus + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.IUpdateCorpusRequest} request UpdateCorpusRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|listCorpora}. + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @typedef ListCorporaCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.visionai.v1alpha1.ListCorporaResponse} [response] ListCorporaResponse + */ + + /** + * Calls ListCorpora. + * @function listCorpora + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.IListCorporaRequest} request ListCorporaRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.Warehouse.ListCorporaCallback} callback Node-style callback called with the error, if any, and ListCorporaResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Warehouse.prototype.listCorpora = function listCorpora(request, callback) { + return this.rpcCall(listCorpora, $root.google.cloud.visionai.v1alpha1.ListCorporaRequest, $root.google.cloud.visionai.v1alpha1.ListCorporaResponse, request, callback); + }, "name", { value: "ListCorpora" }); + + /** + * Calls ListCorpora. + * @function listCorpora + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.IListCorporaRequest} request ListCorporaRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|deleteCorpus}. + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @typedef DeleteCorpusCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteCorpus. + * @function deleteCorpus + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.IDeleteCorpusRequest} request DeleteCorpusRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.Warehouse.DeleteCorpusCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Warehouse.prototype.deleteCorpus = function deleteCorpus(request, callback) { + return this.rpcCall(deleteCorpus, $root.google.cloud.visionai.v1alpha1.DeleteCorpusRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteCorpus" }); + + /** + * Calls DeleteCorpus. + * @function deleteCorpus + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.IDeleteCorpusRequest} request DeleteCorpusRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|createDataSchema}. + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @typedef CreateDataSchemaCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.visionai.v1alpha1.DataSchema} [response] DataSchema + */ + + /** + * Calls CreateDataSchema. + * @function createDataSchema + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.ICreateDataSchemaRequest} request CreateDataSchemaRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.Warehouse.CreateDataSchemaCallback} callback Node-style callback called with the error, if any, and DataSchema + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Warehouse.prototype.createDataSchema = function createDataSchema(request, callback) { + return this.rpcCall(createDataSchema, $root.google.cloud.visionai.v1alpha1.CreateDataSchemaRequest, $root.google.cloud.visionai.v1alpha1.DataSchema, request, callback); + }, "name", { value: "CreateDataSchema" }); + + /** + * Calls CreateDataSchema. + * @function createDataSchema + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.ICreateDataSchemaRequest} request CreateDataSchemaRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|updateDataSchema}. + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @typedef UpdateDataSchemaCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.visionai.v1alpha1.DataSchema} [response] DataSchema + */ + + /** + * Calls UpdateDataSchema. + * @function updateDataSchema + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.IUpdateDataSchemaRequest} request UpdateDataSchemaRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.Warehouse.UpdateDataSchemaCallback} callback Node-style callback called with the error, if any, and DataSchema + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Warehouse.prototype.updateDataSchema = function updateDataSchema(request, callback) { + return this.rpcCall(updateDataSchema, $root.google.cloud.visionai.v1alpha1.UpdateDataSchemaRequest, $root.google.cloud.visionai.v1alpha1.DataSchema, request, callback); + }, "name", { value: "UpdateDataSchema" }); + + /** + * Calls UpdateDataSchema. + * @function updateDataSchema + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.IUpdateDataSchemaRequest} request UpdateDataSchemaRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|getDataSchema}. + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @typedef GetDataSchemaCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.visionai.v1alpha1.DataSchema} [response] DataSchema + */ + + /** + * Calls GetDataSchema. + * @function getDataSchema + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.IGetDataSchemaRequest} request GetDataSchemaRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.Warehouse.GetDataSchemaCallback} callback Node-style callback called with the error, if any, and DataSchema + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Warehouse.prototype.getDataSchema = function getDataSchema(request, callback) { + return this.rpcCall(getDataSchema, $root.google.cloud.visionai.v1alpha1.GetDataSchemaRequest, $root.google.cloud.visionai.v1alpha1.DataSchema, request, callback); + }, "name", { value: "GetDataSchema" }); + + /** + * Calls GetDataSchema. + * @function getDataSchema + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.IGetDataSchemaRequest} request GetDataSchemaRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|deleteDataSchema}. + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @typedef DeleteDataSchemaCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteDataSchema. + * @function deleteDataSchema + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.IDeleteDataSchemaRequest} request DeleteDataSchemaRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.Warehouse.DeleteDataSchemaCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Warehouse.prototype.deleteDataSchema = function deleteDataSchema(request, callback) { + return this.rpcCall(deleteDataSchema, $root.google.cloud.visionai.v1alpha1.DeleteDataSchemaRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteDataSchema" }); + + /** + * Calls DeleteDataSchema. + * @function deleteDataSchema + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.IDeleteDataSchemaRequest} request DeleteDataSchemaRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|listDataSchemas}. + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @typedef ListDataSchemasCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.visionai.v1alpha1.ListDataSchemasResponse} [response] ListDataSchemasResponse + */ + + /** + * Calls ListDataSchemas. + * @function listDataSchemas + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.IListDataSchemasRequest} request ListDataSchemasRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.Warehouse.ListDataSchemasCallback} callback Node-style callback called with the error, if any, and ListDataSchemasResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Warehouse.prototype.listDataSchemas = function listDataSchemas(request, callback) { + return this.rpcCall(listDataSchemas, $root.google.cloud.visionai.v1alpha1.ListDataSchemasRequest, $root.google.cloud.visionai.v1alpha1.ListDataSchemasResponse, request, callback); + }, "name", { value: "ListDataSchemas" }); + + /** + * Calls ListDataSchemas. + * @function listDataSchemas + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.IListDataSchemasRequest} request ListDataSchemasRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|createAnnotation}. + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @typedef CreateAnnotationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.visionai.v1alpha1.Annotation} [response] Annotation + */ + + /** + * Calls CreateAnnotation. + * @function createAnnotation + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.ICreateAnnotationRequest} request CreateAnnotationRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.Warehouse.CreateAnnotationCallback} callback Node-style callback called with the error, if any, and Annotation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Warehouse.prototype.createAnnotation = function createAnnotation(request, callback) { + return this.rpcCall(createAnnotation, $root.google.cloud.visionai.v1alpha1.CreateAnnotationRequest, $root.google.cloud.visionai.v1alpha1.Annotation, request, callback); + }, "name", { value: "CreateAnnotation" }); + + /** + * Calls CreateAnnotation. + * @function createAnnotation + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.ICreateAnnotationRequest} request CreateAnnotationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|getAnnotation}. + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @typedef GetAnnotationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.visionai.v1alpha1.Annotation} [response] Annotation + */ + + /** + * Calls GetAnnotation. + * @function getAnnotation + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.IGetAnnotationRequest} request GetAnnotationRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.Warehouse.GetAnnotationCallback} callback Node-style callback called with the error, if any, and Annotation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Warehouse.prototype.getAnnotation = function getAnnotation(request, callback) { + return this.rpcCall(getAnnotation, $root.google.cloud.visionai.v1alpha1.GetAnnotationRequest, $root.google.cloud.visionai.v1alpha1.Annotation, request, callback); + }, "name", { value: "GetAnnotation" }); + + /** + * Calls GetAnnotation. + * @function getAnnotation + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.IGetAnnotationRequest} request GetAnnotationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|listAnnotations}. + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @typedef ListAnnotationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.visionai.v1alpha1.ListAnnotationsResponse} [response] ListAnnotationsResponse + */ + + /** + * Calls ListAnnotations. + * @function listAnnotations + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.IListAnnotationsRequest} request ListAnnotationsRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.Warehouse.ListAnnotationsCallback} callback Node-style callback called with the error, if any, and ListAnnotationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Warehouse.prototype.listAnnotations = function listAnnotations(request, callback) { + return this.rpcCall(listAnnotations, $root.google.cloud.visionai.v1alpha1.ListAnnotationsRequest, $root.google.cloud.visionai.v1alpha1.ListAnnotationsResponse, request, callback); + }, "name", { value: "ListAnnotations" }); + + /** + * Calls ListAnnotations. + * @function listAnnotations + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.IListAnnotationsRequest} request ListAnnotationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|updateAnnotation}. + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @typedef UpdateAnnotationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.visionai.v1alpha1.Annotation} [response] Annotation + */ + + /** + * Calls UpdateAnnotation. + * @function updateAnnotation + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.IUpdateAnnotationRequest} request UpdateAnnotationRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.Warehouse.UpdateAnnotationCallback} callback Node-style callback called with the error, if any, and Annotation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Warehouse.prototype.updateAnnotation = function updateAnnotation(request, callback) { + return this.rpcCall(updateAnnotation, $root.google.cloud.visionai.v1alpha1.UpdateAnnotationRequest, $root.google.cloud.visionai.v1alpha1.Annotation, request, callback); + }, "name", { value: "UpdateAnnotation" }); + + /** + * Calls UpdateAnnotation. + * @function updateAnnotation + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.IUpdateAnnotationRequest} request UpdateAnnotationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|deleteAnnotation}. + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @typedef DeleteAnnotationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteAnnotation. + * @function deleteAnnotation + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.IDeleteAnnotationRequest} request DeleteAnnotationRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.Warehouse.DeleteAnnotationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Warehouse.prototype.deleteAnnotation = function deleteAnnotation(request, callback) { + return this.rpcCall(deleteAnnotation, $root.google.cloud.visionai.v1alpha1.DeleteAnnotationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteAnnotation" }); + + /** + * Calls DeleteAnnotation. + * @function deleteAnnotation + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.IDeleteAnnotationRequest} request DeleteAnnotationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|ingestAsset}. + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @typedef IngestAssetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.visionai.v1alpha1.IngestAssetResponse} [response] IngestAssetResponse + */ + + /** + * Calls IngestAsset. + * @function ingestAsset + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.IIngestAssetRequest} request IngestAssetRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.Warehouse.IngestAssetCallback} callback Node-style callback called with the error, if any, and IngestAssetResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Warehouse.prototype.ingestAsset = function ingestAsset(request, callback) { + return this.rpcCall(ingestAsset, $root.google.cloud.visionai.v1alpha1.IngestAssetRequest, $root.google.cloud.visionai.v1alpha1.IngestAssetResponse, request, callback); + }, "name", { value: "IngestAsset" }); + + /** + * Calls IngestAsset. + * @function ingestAsset + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.IIngestAssetRequest} request IngestAssetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|clipAsset}. + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @typedef ClipAssetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.visionai.v1alpha1.ClipAssetResponse} [response] ClipAssetResponse + */ + + /** + * Calls ClipAsset. + * @function clipAsset + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.IClipAssetRequest} request ClipAssetRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.Warehouse.ClipAssetCallback} callback Node-style callback called with the error, if any, and ClipAssetResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Warehouse.prototype.clipAsset = function clipAsset(request, callback) { + return this.rpcCall(clipAsset, $root.google.cloud.visionai.v1alpha1.ClipAssetRequest, $root.google.cloud.visionai.v1alpha1.ClipAssetResponse, request, callback); + }, "name", { value: "ClipAsset" }); + + /** + * Calls ClipAsset. + * @function clipAsset + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.IClipAssetRequest} request ClipAssetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|generateHlsUri}. + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @typedef GenerateHlsUriCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.visionai.v1alpha1.GenerateHlsUriResponse} [response] GenerateHlsUriResponse + */ + + /** + * Calls GenerateHlsUri. + * @function generateHlsUri + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.IGenerateHlsUriRequest} request GenerateHlsUriRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.Warehouse.GenerateHlsUriCallback} callback Node-style callback called with the error, if any, and GenerateHlsUriResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Warehouse.prototype.generateHlsUri = function generateHlsUri(request, callback) { + return this.rpcCall(generateHlsUri, $root.google.cloud.visionai.v1alpha1.GenerateHlsUriRequest, $root.google.cloud.visionai.v1alpha1.GenerateHlsUriResponse, request, callback); + }, "name", { value: "GenerateHlsUri" }); + + /** + * Calls GenerateHlsUri. + * @function generateHlsUri + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.IGenerateHlsUriRequest} request GenerateHlsUriRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|createSearchConfig}. + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @typedef CreateSearchConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.visionai.v1alpha1.SearchConfig} [response] SearchConfig + */ + + /** + * Calls CreateSearchConfig. + * @function createSearchConfig + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.ICreateSearchConfigRequest} request CreateSearchConfigRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.Warehouse.CreateSearchConfigCallback} callback Node-style callback called with the error, if any, and SearchConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Warehouse.prototype.createSearchConfig = function createSearchConfig(request, callback) { + return this.rpcCall(createSearchConfig, $root.google.cloud.visionai.v1alpha1.CreateSearchConfigRequest, $root.google.cloud.visionai.v1alpha1.SearchConfig, request, callback); + }, "name", { value: "CreateSearchConfig" }); + + /** + * Calls CreateSearchConfig. + * @function createSearchConfig + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.ICreateSearchConfigRequest} request CreateSearchConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|updateSearchConfig}. + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @typedef UpdateSearchConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.visionai.v1alpha1.SearchConfig} [response] SearchConfig + */ + + /** + * Calls UpdateSearchConfig. + * @function updateSearchConfig + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.IUpdateSearchConfigRequest} request UpdateSearchConfigRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.Warehouse.UpdateSearchConfigCallback} callback Node-style callback called with the error, if any, and SearchConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Warehouse.prototype.updateSearchConfig = function updateSearchConfig(request, callback) { + return this.rpcCall(updateSearchConfig, $root.google.cloud.visionai.v1alpha1.UpdateSearchConfigRequest, $root.google.cloud.visionai.v1alpha1.SearchConfig, request, callback); + }, "name", { value: "UpdateSearchConfig" }); + + /** + * Calls UpdateSearchConfig. + * @function updateSearchConfig + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.IUpdateSearchConfigRequest} request UpdateSearchConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|getSearchConfig}. + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @typedef GetSearchConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.visionai.v1alpha1.SearchConfig} [response] SearchConfig + */ + + /** + * Calls GetSearchConfig. + * @function getSearchConfig + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.IGetSearchConfigRequest} request GetSearchConfigRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.Warehouse.GetSearchConfigCallback} callback Node-style callback called with the error, if any, and SearchConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Warehouse.prototype.getSearchConfig = function getSearchConfig(request, callback) { + return this.rpcCall(getSearchConfig, $root.google.cloud.visionai.v1alpha1.GetSearchConfigRequest, $root.google.cloud.visionai.v1alpha1.SearchConfig, request, callback); + }, "name", { value: "GetSearchConfig" }); + + /** + * Calls GetSearchConfig. + * @function getSearchConfig + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.IGetSearchConfigRequest} request GetSearchConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|deleteSearchConfig}. + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @typedef DeleteSearchConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteSearchConfig. + * @function deleteSearchConfig + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.IDeleteSearchConfigRequest} request DeleteSearchConfigRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.Warehouse.DeleteSearchConfigCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Warehouse.prototype.deleteSearchConfig = function deleteSearchConfig(request, callback) { + return this.rpcCall(deleteSearchConfig, $root.google.cloud.visionai.v1alpha1.DeleteSearchConfigRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteSearchConfig" }); + + /** + * Calls DeleteSearchConfig. + * @function deleteSearchConfig + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.IDeleteSearchConfigRequest} request DeleteSearchConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|listSearchConfigs}. + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @typedef ListSearchConfigsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.visionai.v1alpha1.ListSearchConfigsResponse} [response] ListSearchConfigsResponse + */ + + /** + * Calls ListSearchConfigs. + * @function listSearchConfigs + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.IListSearchConfigsRequest} request ListSearchConfigsRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.Warehouse.ListSearchConfigsCallback} callback Node-style callback called with the error, if any, and ListSearchConfigsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Warehouse.prototype.listSearchConfigs = function listSearchConfigs(request, callback) { + return this.rpcCall(listSearchConfigs, $root.google.cloud.visionai.v1alpha1.ListSearchConfigsRequest, $root.google.cloud.visionai.v1alpha1.ListSearchConfigsResponse, request, callback); + }, "name", { value: "ListSearchConfigs" }); + + /** + * Calls ListSearchConfigs. + * @function listSearchConfigs + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.IListSearchConfigsRequest} request ListSearchConfigsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.visionai.v1alpha1.Warehouse|searchAssets}. + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @typedef SearchAssetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.visionai.v1alpha1.SearchAssetsResponse} [response] SearchAssetsResponse + */ + + /** + * Calls SearchAssets. + * @function searchAssets + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.ISearchAssetsRequest} request SearchAssetsRequest message or plain object + * @param {google.cloud.visionai.v1alpha1.Warehouse.SearchAssetsCallback} callback Node-style callback called with the error, if any, and SearchAssetsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Warehouse.prototype.searchAssets = function searchAssets(request, callback) { + return this.rpcCall(searchAssets, $root.google.cloud.visionai.v1alpha1.SearchAssetsRequest, $root.google.cloud.visionai.v1alpha1.SearchAssetsResponse, request, callback); + }, "name", { value: "SearchAssets" }); + + /** + * Calls SearchAssets. + * @function searchAssets + * @memberof google.cloud.visionai.v1alpha1.Warehouse + * @instance + * @param {google.cloud.visionai.v1alpha1.ISearchAssetsRequest} request SearchAssetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Warehouse; + })(); + + /** + * FacetBucketType enum. + * @name google.cloud.visionai.v1alpha1.FacetBucketType + * @enum {number} + * @property {number} FACET_BUCKET_TYPE_UNSPECIFIED=0 FACET_BUCKET_TYPE_UNSPECIFIED value + * @property {number} FACET_BUCKET_TYPE_VALUE=1 FACET_BUCKET_TYPE_VALUE value + * @property {number} FACET_BUCKET_TYPE_DATETIME=2 FACET_BUCKET_TYPE_DATETIME value + * @property {number} FACET_BUCKET_TYPE_FIXED_RANGE=3 FACET_BUCKET_TYPE_FIXED_RANGE value + * @property {number} FACET_BUCKET_TYPE_CUSTOM_RANGE=4 FACET_BUCKET_TYPE_CUSTOM_RANGE value + */ + v1alpha1.FacetBucketType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FACET_BUCKET_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "FACET_BUCKET_TYPE_VALUE"] = 1; + values[valuesById[2] = "FACET_BUCKET_TYPE_DATETIME"] = 2; + values[valuesById[3] = "FACET_BUCKET_TYPE_FIXED_RANGE"] = 3; + values[valuesById[4] = "FACET_BUCKET_TYPE_CUSTOM_RANGE"] = 4; + return values; + })(); + + v1alpha1.CreateAssetRequest = (function() { + + /** + * Properties of a CreateAssetRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface ICreateAssetRequest + * @property {string|null} [parent] CreateAssetRequest parent + * @property {google.cloud.visionai.v1alpha1.IAsset|null} [asset] CreateAssetRequest asset + * @property {string|null} [assetId] CreateAssetRequest assetId + */ + + /** + * Constructs a new CreateAssetRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a CreateAssetRequest. + * @implements ICreateAssetRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.ICreateAssetRequest=} [properties] Properties to set + */ + function CreateAssetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateAssetRequest parent. + * @member {string} parent + * @memberof google.cloud.visionai.v1alpha1.CreateAssetRequest + * @instance + */ + CreateAssetRequest.prototype.parent = ""; + + /** + * CreateAssetRequest asset. + * @member {google.cloud.visionai.v1alpha1.IAsset|null|undefined} asset + * @memberof google.cloud.visionai.v1alpha1.CreateAssetRequest + * @instance + */ + CreateAssetRequest.prototype.asset = null; + + /** + * CreateAssetRequest assetId. + * @member {string|null|undefined} assetId + * @memberof google.cloud.visionai.v1alpha1.CreateAssetRequest + * @instance + */ + CreateAssetRequest.prototype.assetId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CreateAssetRequest.prototype, "_assetId", { + get: $util.oneOfGetter($oneOfFields = ["assetId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CreateAssetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.CreateAssetRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ICreateAssetRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.CreateAssetRequest} CreateAssetRequest instance + */ + CreateAssetRequest.create = function create(properties) { + return new CreateAssetRequest(properties); + }; + + /** + * Encodes the specified CreateAssetRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateAssetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.CreateAssetRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ICreateAssetRequest} message CreateAssetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAssetRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.asset != null && Object.hasOwnProperty.call(message, "asset")) + $root.google.cloud.visionai.v1alpha1.Asset.encode(message.asset, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.assetId != null && Object.hasOwnProperty.call(message, "assetId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.assetId); + return writer; + }; + + /** + * Encodes the specified CreateAssetRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateAssetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.CreateAssetRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ICreateAssetRequest} message CreateAssetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAssetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateAssetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.CreateAssetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.CreateAssetRequest} CreateAssetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAssetRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.CreateAssetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.asset = $root.google.cloud.visionai.v1alpha1.Asset.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.assetId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreateAssetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.CreateAssetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.CreateAssetRequest} CreateAssetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAssetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateAssetRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.CreateAssetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateAssetRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.asset != null && message.hasOwnProperty("asset")) { + var error = $root.google.cloud.visionai.v1alpha1.Asset.verify(message.asset, long + 1); + if (error) + return "asset." + error; + } + if (message.assetId != null && message.hasOwnProperty("assetId")) { + properties._assetId = 1; + if (!$util.isString(message.assetId)) + return "assetId: string expected"; + } + return null; + }; + + /** + * Creates a CreateAssetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.CreateAssetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.CreateAssetRequest} CreateAssetRequest + */ + CreateAssetRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.CreateAssetRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.CreateAssetRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.asset != null) { + if (typeof object.asset !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.CreateAssetRequest.asset: object expected"); + message.asset = $root.google.cloud.visionai.v1alpha1.Asset.fromObject(object.asset, long + 1); + } + if (object.assetId != null) + message.assetId = String(object.assetId); + return message; + }; + + /** + * Creates a plain object from a CreateAssetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.CreateAssetRequest + * @static + * @param {google.cloud.visionai.v1alpha1.CreateAssetRequest} message CreateAssetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateAssetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.asset = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.asset != null && message.hasOwnProperty("asset")) + object.asset = $root.google.cloud.visionai.v1alpha1.Asset.toObject(message.asset, options); + if (message.assetId != null && message.hasOwnProperty("assetId")) { + object.assetId = message.assetId; + if (options.oneofs) + object._assetId = "assetId"; + } + return object; + }; + + /** + * Converts this CreateAssetRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.CreateAssetRequest + * @instance + * @returns {Object.} JSON object + */ + CreateAssetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateAssetRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.CreateAssetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateAssetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.CreateAssetRequest"; + }; + + return CreateAssetRequest; + })(); + + v1alpha1.GetAssetRequest = (function() { + + /** + * Properties of a GetAssetRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IGetAssetRequest + * @property {string|null} [name] GetAssetRequest name + */ + + /** + * Constructs a new GetAssetRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a GetAssetRequest. + * @implements IGetAssetRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IGetAssetRequest=} [properties] Properties to set + */ + function GetAssetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetAssetRequest name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.GetAssetRequest + * @instance + */ + GetAssetRequest.prototype.name = ""; + + /** + * Creates a new GetAssetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.GetAssetRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IGetAssetRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.GetAssetRequest} GetAssetRequest instance + */ + GetAssetRequest.create = function create(properties) { + return new GetAssetRequest(properties); + }; + + /** + * Encodes the specified GetAssetRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetAssetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.GetAssetRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IGetAssetRequest} message GetAssetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAssetRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetAssetRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetAssetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.GetAssetRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IGetAssetRequest} message GetAssetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAssetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetAssetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.GetAssetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.GetAssetRequest} GetAssetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAssetRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.GetAssetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetAssetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.GetAssetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.GetAssetRequest} GetAssetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAssetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetAssetRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.GetAssetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetAssetRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetAssetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.GetAssetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.GetAssetRequest} GetAssetRequest + */ + GetAssetRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.GetAssetRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.GetAssetRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetAssetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.GetAssetRequest + * @static + * @param {google.cloud.visionai.v1alpha1.GetAssetRequest} message GetAssetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetAssetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetAssetRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.GetAssetRequest + * @instance + * @returns {Object.} JSON object + */ + GetAssetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetAssetRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.GetAssetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetAssetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.GetAssetRequest"; + }; + + return GetAssetRequest; + })(); + + v1alpha1.ListAssetsRequest = (function() { + + /** + * Properties of a ListAssetsRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IListAssetsRequest + * @property {string|null} [parent] ListAssetsRequest parent + * @property {number|null} [pageSize] ListAssetsRequest pageSize + * @property {string|null} [pageToken] ListAssetsRequest pageToken + */ + + /** + * Constructs a new ListAssetsRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a ListAssetsRequest. + * @implements IListAssetsRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IListAssetsRequest=} [properties] Properties to set + */ + function ListAssetsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAssetsRequest parent. + * @member {string} parent + * @memberof google.cloud.visionai.v1alpha1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.parent = ""; + + /** + * ListAssetsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.visionai.v1alpha1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.pageSize = 0; + + /** + * ListAssetsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.visionai.v1alpha1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListAssetsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ListAssetsRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IListAssetsRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ListAssetsRequest} ListAssetsRequest instance + */ + ListAssetsRequest.create = function create(properties) { + return new ListAssetsRequest(properties); + }; + + /** + * Encodes the specified ListAssetsRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListAssetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ListAssetsRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IListAssetsRequest} message ListAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListAssetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListAssetsRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IListAssetsRequest} message ListAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAssetsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ListAssetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ListAssetsRequest} ListAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ListAssetsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListAssetsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListAssetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ListAssetsRequest} ListAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAssetsRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ListAssetsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAssetsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListAssetsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ListAssetsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ListAssetsRequest} ListAssetsRequest + */ + ListAssetsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ListAssetsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ListAssetsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListAssetsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ListAssetsRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ListAssetsRequest} message ListAssetsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAssetsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListAssetsRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ListAssetsRequest + * @instance + * @returns {Object.} JSON object + */ + ListAssetsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAssetsRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ListAssetsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAssetsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ListAssetsRequest"; + }; + + return ListAssetsRequest; + })(); + + v1alpha1.ListAssetsResponse = (function() { + + /** + * Properties of a ListAssetsResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IListAssetsResponse + * @property {Array.|null} [assets] ListAssetsResponse assets + * @property {string|null} [nextPageToken] ListAssetsResponse nextPageToken + */ + + /** + * Constructs a new ListAssetsResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a ListAssetsResponse. + * @implements IListAssetsResponse + * @constructor + * @param {google.cloud.visionai.v1alpha1.IListAssetsResponse=} [properties] Properties to set + */ + function ListAssetsResponse(properties) { + this.assets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAssetsResponse assets. + * @member {Array.} assets + * @memberof google.cloud.visionai.v1alpha1.ListAssetsResponse + * @instance + */ + ListAssetsResponse.prototype.assets = $util.emptyArray; + + /** + * ListAssetsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.visionai.v1alpha1.ListAssetsResponse + * @instance + */ + ListAssetsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListAssetsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ListAssetsResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IListAssetsResponse=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ListAssetsResponse} ListAssetsResponse instance + */ + ListAssetsResponse.create = function create(properties) { + return new ListAssetsResponse(properties); + }; + + /** + * Encodes the specified ListAssetsResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListAssetsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ListAssetsResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IListAssetsResponse} message ListAssetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.assets != null && message.assets.length) + for (var i = 0; i < message.assets.length; ++i) + $root.google.cloud.visionai.v1alpha1.Asset.encode(message.assets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListAssetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListAssetsResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IListAssetsResponse} message ListAssetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAssetsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ListAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ListAssetsResponse} ListAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ListAssetsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.assets && message.assets.length)) + message.assets = []; + message.assets.push($root.google.cloud.visionai.v1alpha1.Asset.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListAssetsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ListAssetsResponse} ListAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAssetsResponse message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ListAssetsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAssetsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.assets != null && message.hasOwnProperty("assets")) { + if (!Array.isArray(message.assets)) + return "assets: array expected"; + for (var i = 0; i < message.assets.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.Asset.verify(message.assets[i], long + 1); + if (error) + return "assets." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ListAssetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ListAssetsResponse} ListAssetsResponse + */ + ListAssetsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ListAssetsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ListAssetsResponse(); + if (object.assets) { + if (!Array.isArray(object.assets)) + throw TypeError(".google.cloud.visionai.v1alpha1.ListAssetsResponse.assets: array expected"); + message.assets = []; + for (var i = 0; i < object.assets.length; ++i) { + if (typeof object.assets[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ListAssetsResponse.assets: object expected"); + message.assets[i] = $root.google.cloud.visionai.v1alpha1.Asset.fromObject(object.assets[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListAssetsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ListAssetsResponse + * @static + * @param {google.cloud.visionai.v1alpha1.ListAssetsResponse} message ListAssetsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAssetsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.assets = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.assets && message.assets.length) { + object.assets = []; + for (var j = 0; j < message.assets.length; ++j) + object.assets[j] = $root.google.cloud.visionai.v1alpha1.Asset.toObject(message.assets[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListAssetsResponse to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ListAssetsResponse + * @instance + * @returns {Object.} JSON object + */ + ListAssetsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAssetsResponse + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ListAssetsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAssetsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ListAssetsResponse"; + }; + + return ListAssetsResponse; + })(); + + v1alpha1.UpdateAssetRequest = (function() { + + /** + * Properties of an UpdateAssetRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IUpdateAssetRequest + * @property {google.cloud.visionai.v1alpha1.IAsset|null} [asset] UpdateAssetRequest asset + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateAssetRequest updateMask + */ + + /** + * Constructs a new UpdateAssetRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents an UpdateAssetRequest. + * @implements IUpdateAssetRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IUpdateAssetRequest=} [properties] Properties to set + */ + function UpdateAssetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateAssetRequest asset. + * @member {google.cloud.visionai.v1alpha1.IAsset|null|undefined} asset + * @memberof google.cloud.visionai.v1alpha1.UpdateAssetRequest + * @instance + */ + UpdateAssetRequest.prototype.asset = null; + + /** + * UpdateAssetRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.visionai.v1alpha1.UpdateAssetRequest + * @instance + */ + UpdateAssetRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateAssetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.UpdateAssetRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IUpdateAssetRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.UpdateAssetRequest} UpdateAssetRequest instance + */ + UpdateAssetRequest.create = function create(properties) { + return new UpdateAssetRequest(properties); + }; + + /** + * Encodes the specified UpdateAssetRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateAssetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.UpdateAssetRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IUpdateAssetRequest} message UpdateAssetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAssetRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.asset != null && Object.hasOwnProperty.call(message, "asset")) + $root.google.cloud.visionai.v1alpha1.Asset.encode(message.asset, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateAssetRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateAssetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.UpdateAssetRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IUpdateAssetRequest} message UpdateAssetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAssetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateAssetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.UpdateAssetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.UpdateAssetRequest} UpdateAssetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAssetRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.UpdateAssetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.asset = $root.google.cloud.visionai.v1alpha1.Asset.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateAssetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.UpdateAssetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.UpdateAssetRequest} UpdateAssetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAssetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateAssetRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.UpdateAssetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateAssetRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.asset != null && message.hasOwnProperty("asset")) { + var error = $root.google.cloud.visionai.v1alpha1.Asset.verify(message.asset, long + 1); + if (error) + return "asset." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateAssetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.UpdateAssetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.UpdateAssetRequest} UpdateAssetRequest + */ + UpdateAssetRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.UpdateAssetRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.UpdateAssetRequest(); + if (object.asset != null) { + if (typeof object.asset !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.UpdateAssetRequest.asset: object expected"); + message.asset = $root.google.cloud.visionai.v1alpha1.Asset.fromObject(object.asset, long + 1); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.UpdateAssetRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an UpdateAssetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.UpdateAssetRequest + * @static + * @param {google.cloud.visionai.v1alpha1.UpdateAssetRequest} message UpdateAssetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateAssetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.asset = null; + object.updateMask = null; + } + if (message.asset != null && message.hasOwnProperty("asset")) + object.asset = $root.google.cloud.visionai.v1alpha1.Asset.toObject(message.asset, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateAssetRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.UpdateAssetRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateAssetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateAssetRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.UpdateAssetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateAssetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.UpdateAssetRequest"; + }; + + return UpdateAssetRequest; + })(); + + v1alpha1.DeleteAssetRequest = (function() { + + /** + * Properties of a DeleteAssetRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IDeleteAssetRequest + * @property {string|null} [name] DeleteAssetRequest name + */ + + /** + * Constructs a new DeleteAssetRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a DeleteAssetRequest. + * @implements IDeleteAssetRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IDeleteAssetRequest=} [properties] Properties to set + */ + function DeleteAssetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteAssetRequest name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.DeleteAssetRequest + * @instance + */ + DeleteAssetRequest.prototype.name = ""; + + /** + * Creates a new DeleteAssetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.DeleteAssetRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IDeleteAssetRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.DeleteAssetRequest} DeleteAssetRequest instance + */ + DeleteAssetRequest.create = function create(properties) { + return new DeleteAssetRequest(properties); + }; + + /** + * Encodes the specified DeleteAssetRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteAssetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.DeleteAssetRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IDeleteAssetRequest} message DeleteAssetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAssetRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteAssetRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteAssetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.DeleteAssetRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IDeleteAssetRequest} message DeleteAssetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAssetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteAssetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.DeleteAssetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.DeleteAssetRequest} DeleteAssetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAssetRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.DeleteAssetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteAssetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.DeleteAssetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.DeleteAssetRequest} DeleteAssetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAssetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteAssetRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.DeleteAssetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteAssetRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteAssetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.DeleteAssetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.DeleteAssetRequest} DeleteAssetRequest + */ + DeleteAssetRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.DeleteAssetRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.DeleteAssetRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteAssetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.DeleteAssetRequest + * @static + * @param {google.cloud.visionai.v1alpha1.DeleteAssetRequest} message DeleteAssetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteAssetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteAssetRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.DeleteAssetRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteAssetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteAssetRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.DeleteAssetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteAssetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.DeleteAssetRequest"; + }; + + return DeleteAssetRequest; + })(); + + v1alpha1.Asset = (function() { + + /** + * Properties of an Asset. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IAsset + * @property {string|null} [name] Asset name + * @property {google.protobuf.IDuration|null} [ttl] Asset ttl + */ + + /** + * Constructs a new Asset. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents an Asset. + * @implements IAsset + * @constructor + * @param {google.cloud.visionai.v1alpha1.IAsset=} [properties] Properties to set + */ + function Asset(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Asset name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.Asset + * @instance + */ + Asset.prototype.name = ""; + + /** + * Asset ttl. + * @member {google.protobuf.IDuration|null|undefined} ttl + * @memberof google.cloud.visionai.v1alpha1.Asset + * @instance + */ + Asset.prototype.ttl = null; + + /** + * Creates a new Asset instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.Asset + * @static + * @param {google.cloud.visionai.v1alpha1.IAsset=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.Asset} Asset instance + */ + Asset.create = function create(properties) { + return new Asset(properties); + }; + + /** + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.visionai.v1alpha1.Asset.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.Asset + * @static + * @param {google.cloud.visionai.v1alpha1.IAsset} message Asset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Asset.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.ttl != null && Object.hasOwnProperty.call(message, "ttl")) + $root.google.protobuf.Duration.encode(message.ttl, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.Asset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.Asset + * @static + * @param {google.cloud.visionai.v1alpha1.IAsset} message Asset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Asset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Asset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.Asset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.Asset} Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Asset.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.Asset(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.ttl = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an Asset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.Asset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.Asset} Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Asset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Asset message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.Asset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Asset.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.ttl != null && message.hasOwnProperty("ttl")) { + var error = $root.google.protobuf.Duration.verify(message.ttl, long + 1); + if (error) + return "ttl." + error; + } + return null; + }; + + /** + * Creates an Asset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.Asset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.Asset} Asset + */ + Asset.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.Asset) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.Asset(); + if (object.name != null) + message.name = String(object.name); + if (object.ttl != null) { + if (typeof object.ttl !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Asset.ttl: object expected"); + message.ttl = $root.google.protobuf.Duration.fromObject(object.ttl, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.Asset + * @static + * @param {google.cloud.visionai.v1alpha1.Asset} message Asset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Asset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.ttl = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.ttl != null && message.hasOwnProperty("ttl")) + object.ttl = $root.google.protobuf.Duration.toObject(message.ttl, options); + return object; + }; + + /** + * Converts this Asset to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.Asset + * @instance + * @returns {Object.} JSON object + */ + Asset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Asset + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.Asset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Asset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.Asset"; + }; + + return Asset; + })(); + + v1alpha1.CreateCorpusRequest = (function() { + + /** + * Properties of a CreateCorpusRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface ICreateCorpusRequest + * @property {string|null} [parent] CreateCorpusRequest parent + * @property {google.cloud.visionai.v1alpha1.ICorpus|null} [corpus] CreateCorpusRequest corpus + */ + + /** + * Constructs a new CreateCorpusRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a CreateCorpusRequest. + * @implements ICreateCorpusRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.ICreateCorpusRequest=} [properties] Properties to set + */ + function CreateCorpusRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateCorpusRequest parent. + * @member {string} parent + * @memberof google.cloud.visionai.v1alpha1.CreateCorpusRequest + * @instance + */ + CreateCorpusRequest.prototype.parent = ""; + + /** + * CreateCorpusRequest corpus. + * @member {google.cloud.visionai.v1alpha1.ICorpus|null|undefined} corpus + * @memberof google.cloud.visionai.v1alpha1.CreateCorpusRequest + * @instance + */ + CreateCorpusRequest.prototype.corpus = null; + + /** + * Creates a new CreateCorpusRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.CreateCorpusRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ICreateCorpusRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.CreateCorpusRequest} CreateCorpusRequest instance + */ + CreateCorpusRequest.create = function create(properties) { + return new CreateCorpusRequest(properties); + }; + + /** + * Encodes the specified CreateCorpusRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateCorpusRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.CreateCorpusRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ICreateCorpusRequest} message CreateCorpusRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCorpusRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.corpus != null && Object.hasOwnProperty.call(message, "corpus")) + $root.google.cloud.visionai.v1alpha1.Corpus.encode(message.corpus, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateCorpusRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateCorpusRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.CreateCorpusRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ICreateCorpusRequest} message CreateCorpusRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCorpusRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateCorpusRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.CreateCorpusRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.CreateCorpusRequest} CreateCorpusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCorpusRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.CreateCorpusRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.corpus = $root.google.cloud.visionai.v1alpha1.Corpus.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreateCorpusRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.CreateCorpusRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.CreateCorpusRequest} CreateCorpusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCorpusRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateCorpusRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.CreateCorpusRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateCorpusRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.corpus != null && message.hasOwnProperty("corpus")) { + var error = $root.google.cloud.visionai.v1alpha1.Corpus.verify(message.corpus, long + 1); + if (error) + return "corpus." + error; + } + return null; + }; + + /** + * Creates a CreateCorpusRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.CreateCorpusRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.CreateCorpusRequest} CreateCorpusRequest + */ + CreateCorpusRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.CreateCorpusRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.CreateCorpusRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.corpus != null) { + if (typeof object.corpus !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.CreateCorpusRequest.corpus: object expected"); + message.corpus = $root.google.cloud.visionai.v1alpha1.Corpus.fromObject(object.corpus, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a CreateCorpusRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.CreateCorpusRequest + * @static + * @param {google.cloud.visionai.v1alpha1.CreateCorpusRequest} message CreateCorpusRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateCorpusRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.corpus = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.corpus != null && message.hasOwnProperty("corpus")) + object.corpus = $root.google.cloud.visionai.v1alpha1.Corpus.toObject(message.corpus, options); + return object; + }; + + /** + * Converts this CreateCorpusRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.CreateCorpusRequest + * @instance + * @returns {Object.} JSON object + */ + CreateCorpusRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateCorpusRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.CreateCorpusRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateCorpusRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.CreateCorpusRequest"; + }; + + return CreateCorpusRequest; + })(); + + v1alpha1.CreateCorpusMetadata = (function() { + + /** + * Properties of a CreateCorpusMetadata. + * @memberof google.cloud.visionai.v1alpha1 + * @interface ICreateCorpusMetadata + */ + + /** + * Constructs a new CreateCorpusMetadata. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a CreateCorpusMetadata. + * @implements ICreateCorpusMetadata + * @constructor + * @param {google.cloud.visionai.v1alpha1.ICreateCorpusMetadata=} [properties] Properties to set + */ + function CreateCorpusMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new CreateCorpusMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.CreateCorpusMetadata + * @static + * @param {google.cloud.visionai.v1alpha1.ICreateCorpusMetadata=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.CreateCorpusMetadata} CreateCorpusMetadata instance + */ + CreateCorpusMetadata.create = function create(properties) { + return new CreateCorpusMetadata(properties); + }; + + /** + * Encodes the specified CreateCorpusMetadata message. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateCorpusMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.CreateCorpusMetadata + * @static + * @param {google.cloud.visionai.v1alpha1.ICreateCorpusMetadata} message CreateCorpusMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCorpusMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified CreateCorpusMetadata message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateCorpusMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.CreateCorpusMetadata + * @static + * @param {google.cloud.visionai.v1alpha1.ICreateCorpusMetadata} message CreateCorpusMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCorpusMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateCorpusMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.CreateCorpusMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.CreateCorpusMetadata} CreateCorpusMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCorpusMetadata.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.CreateCorpusMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreateCorpusMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.CreateCorpusMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.CreateCorpusMetadata} CreateCorpusMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCorpusMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateCorpusMetadata message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.CreateCorpusMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateCorpusMetadata.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates a CreateCorpusMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.CreateCorpusMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.CreateCorpusMetadata} CreateCorpusMetadata + */ + CreateCorpusMetadata.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.CreateCorpusMetadata) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.google.cloud.visionai.v1alpha1.CreateCorpusMetadata(); + }; + + /** + * Creates a plain object from a CreateCorpusMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.CreateCorpusMetadata + * @static + * @param {google.cloud.visionai.v1alpha1.CreateCorpusMetadata} message CreateCorpusMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateCorpusMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this CreateCorpusMetadata to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.CreateCorpusMetadata + * @instance + * @returns {Object.} JSON object + */ + CreateCorpusMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateCorpusMetadata + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.CreateCorpusMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateCorpusMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.CreateCorpusMetadata"; + }; + + return CreateCorpusMetadata; + })(); + + v1alpha1.Corpus = (function() { + + /** + * Properties of a Corpus. + * @memberof google.cloud.visionai.v1alpha1 + * @interface ICorpus + * @property {string|null} [name] Corpus name + * @property {string|null} [displayName] Corpus displayName + * @property {string|null} [description] Corpus description + * @property {google.protobuf.IDuration|null} [defaultTtl] Corpus defaultTtl + */ + + /** + * Constructs a new Corpus. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a Corpus. + * @implements ICorpus + * @constructor + * @param {google.cloud.visionai.v1alpha1.ICorpus=} [properties] Properties to set + */ + function Corpus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Corpus name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.Corpus + * @instance + */ + Corpus.prototype.name = ""; + + /** + * Corpus displayName. + * @member {string} displayName + * @memberof google.cloud.visionai.v1alpha1.Corpus + * @instance + */ + Corpus.prototype.displayName = ""; + + /** + * Corpus description. + * @member {string} description + * @memberof google.cloud.visionai.v1alpha1.Corpus + * @instance + */ + Corpus.prototype.description = ""; + + /** + * Corpus defaultTtl. + * @member {google.protobuf.IDuration|null|undefined} defaultTtl + * @memberof google.cloud.visionai.v1alpha1.Corpus + * @instance + */ + Corpus.prototype.defaultTtl = null; + + /** + * Creates a new Corpus instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.Corpus + * @static + * @param {google.cloud.visionai.v1alpha1.ICorpus=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.Corpus} Corpus instance + */ + Corpus.create = function create(properties) { + return new Corpus(properties); + }; + + /** + * Encodes the specified Corpus message. Does not implicitly {@link google.cloud.visionai.v1alpha1.Corpus.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.Corpus + * @static + * @param {google.cloud.visionai.v1alpha1.ICorpus} message Corpus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Corpus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.defaultTtl != null && Object.hasOwnProperty.call(message, "defaultTtl")) + $root.google.protobuf.Duration.encode(message.defaultTtl, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Corpus message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.Corpus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.Corpus + * @static + * @param {google.cloud.visionai.v1alpha1.ICorpus} message Corpus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Corpus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Corpus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.Corpus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.Corpus} Corpus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Corpus.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.Corpus(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 5: { + message.defaultTtl = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Corpus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.Corpus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.Corpus} Corpus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Corpus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Corpus message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.Corpus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Corpus.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.defaultTtl != null && message.hasOwnProperty("defaultTtl")) { + var error = $root.google.protobuf.Duration.verify(message.defaultTtl, long + 1); + if (error) + return "defaultTtl." + error; + } + return null; + }; + + /** + * Creates a Corpus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.Corpus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.Corpus} Corpus + */ + Corpus.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.Corpus) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.Corpus(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.defaultTtl != null) { + if (typeof object.defaultTtl !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Corpus.defaultTtl: object expected"); + message.defaultTtl = $root.google.protobuf.Duration.fromObject(object.defaultTtl, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a Corpus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.Corpus + * @static + * @param {google.cloud.visionai.v1alpha1.Corpus} message Corpus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Corpus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.defaultTtl = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.defaultTtl != null && message.hasOwnProperty("defaultTtl")) + object.defaultTtl = $root.google.protobuf.Duration.toObject(message.defaultTtl, options); + return object; + }; + + /** + * Converts this Corpus to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.Corpus + * @instance + * @returns {Object.} JSON object + */ + Corpus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Corpus + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.Corpus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Corpus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.Corpus"; + }; + + return Corpus; + })(); + + v1alpha1.GetCorpusRequest = (function() { + + /** + * Properties of a GetCorpusRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IGetCorpusRequest + * @property {string|null} [name] GetCorpusRequest name + */ + + /** + * Constructs a new GetCorpusRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a GetCorpusRequest. + * @implements IGetCorpusRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IGetCorpusRequest=} [properties] Properties to set + */ + function GetCorpusRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetCorpusRequest name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.GetCorpusRequest + * @instance + */ + GetCorpusRequest.prototype.name = ""; + + /** + * Creates a new GetCorpusRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.GetCorpusRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IGetCorpusRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.GetCorpusRequest} GetCorpusRequest instance + */ + GetCorpusRequest.create = function create(properties) { + return new GetCorpusRequest(properties); + }; + + /** + * Encodes the specified GetCorpusRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetCorpusRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.GetCorpusRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IGetCorpusRequest} message GetCorpusRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCorpusRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetCorpusRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetCorpusRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.GetCorpusRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IGetCorpusRequest} message GetCorpusRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCorpusRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetCorpusRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.GetCorpusRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.GetCorpusRequest} GetCorpusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCorpusRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.GetCorpusRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetCorpusRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.GetCorpusRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.GetCorpusRequest} GetCorpusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCorpusRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetCorpusRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.GetCorpusRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCorpusRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetCorpusRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.GetCorpusRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.GetCorpusRequest} GetCorpusRequest + */ + GetCorpusRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.GetCorpusRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.GetCorpusRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetCorpusRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.GetCorpusRequest + * @static + * @param {google.cloud.visionai.v1alpha1.GetCorpusRequest} message GetCorpusRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCorpusRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetCorpusRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.GetCorpusRequest + * @instance + * @returns {Object.} JSON object + */ + GetCorpusRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetCorpusRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.GetCorpusRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetCorpusRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.GetCorpusRequest"; + }; + + return GetCorpusRequest; + })(); + + v1alpha1.UpdateCorpusRequest = (function() { + + /** + * Properties of an UpdateCorpusRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IUpdateCorpusRequest + * @property {google.cloud.visionai.v1alpha1.ICorpus|null} [corpus] UpdateCorpusRequest corpus + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCorpusRequest updateMask + */ + + /** + * Constructs a new UpdateCorpusRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents an UpdateCorpusRequest. + * @implements IUpdateCorpusRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IUpdateCorpusRequest=} [properties] Properties to set + */ + function UpdateCorpusRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateCorpusRequest corpus. + * @member {google.cloud.visionai.v1alpha1.ICorpus|null|undefined} corpus + * @memberof google.cloud.visionai.v1alpha1.UpdateCorpusRequest + * @instance + */ + UpdateCorpusRequest.prototype.corpus = null; + + /** + * UpdateCorpusRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.visionai.v1alpha1.UpdateCorpusRequest + * @instance + */ + UpdateCorpusRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateCorpusRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.UpdateCorpusRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IUpdateCorpusRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.UpdateCorpusRequest} UpdateCorpusRequest instance + */ + UpdateCorpusRequest.create = function create(properties) { + return new UpdateCorpusRequest(properties); + }; + + /** + * Encodes the specified UpdateCorpusRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateCorpusRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.UpdateCorpusRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IUpdateCorpusRequest} message UpdateCorpusRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCorpusRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.corpus != null && Object.hasOwnProperty.call(message, "corpus")) + $root.google.cloud.visionai.v1alpha1.Corpus.encode(message.corpus, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateCorpusRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateCorpusRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.UpdateCorpusRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IUpdateCorpusRequest} message UpdateCorpusRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCorpusRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateCorpusRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.UpdateCorpusRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.UpdateCorpusRequest} UpdateCorpusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCorpusRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.UpdateCorpusRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.corpus = $root.google.cloud.visionai.v1alpha1.Corpus.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateCorpusRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.UpdateCorpusRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.UpdateCorpusRequest} UpdateCorpusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCorpusRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateCorpusRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.UpdateCorpusRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateCorpusRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.corpus != null && message.hasOwnProperty("corpus")) { + var error = $root.google.cloud.visionai.v1alpha1.Corpus.verify(message.corpus, long + 1); + if (error) + return "corpus." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateCorpusRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.UpdateCorpusRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.UpdateCorpusRequest} UpdateCorpusRequest + */ + UpdateCorpusRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.UpdateCorpusRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.UpdateCorpusRequest(); + if (object.corpus != null) { + if (typeof object.corpus !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.UpdateCorpusRequest.corpus: object expected"); + message.corpus = $root.google.cloud.visionai.v1alpha1.Corpus.fromObject(object.corpus, long + 1); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.UpdateCorpusRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an UpdateCorpusRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.UpdateCorpusRequest + * @static + * @param {google.cloud.visionai.v1alpha1.UpdateCorpusRequest} message UpdateCorpusRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateCorpusRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.corpus = null; + object.updateMask = null; + } + if (message.corpus != null && message.hasOwnProperty("corpus")) + object.corpus = $root.google.cloud.visionai.v1alpha1.Corpus.toObject(message.corpus, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateCorpusRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.UpdateCorpusRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateCorpusRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateCorpusRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.UpdateCorpusRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateCorpusRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.UpdateCorpusRequest"; + }; + + return UpdateCorpusRequest; + })(); + + v1alpha1.ListCorporaRequest = (function() { + + /** + * Properties of a ListCorporaRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IListCorporaRequest + * @property {string|null} [parent] ListCorporaRequest parent + * @property {number|null} [pageSize] ListCorporaRequest pageSize + * @property {string|null} [pageToken] ListCorporaRequest pageToken + */ + + /** + * Constructs a new ListCorporaRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a ListCorporaRequest. + * @implements IListCorporaRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IListCorporaRequest=} [properties] Properties to set + */ + function ListCorporaRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCorporaRequest parent. + * @member {string} parent + * @memberof google.cloud.visionai.v1alpha1.ListCorporaRequest + * @instance + */ + ListCorporaRequest.prototype.parent = ""; + + /** + * ListCorporaRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.visionai.v1alpha1.ListCorporaRequest + * @instance + */ + ListCorporaRequest.prototype.pageSize = 0; + + /** + * ListCorporaRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.visionai.v1alpha1.ListCorporaRequest + * @instance + */ + ListCorporaRequest.prototype.pageToken = ""; + + /** + * Creates a new ListCorporaRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ListCorporaRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IListCorporaRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ListCorporaRequest} ListCorporaRequest instance + */ + ListCorporaRequest.create = function create(properties) { + return new ListCorporaRequest(properties); + }; + + /** + * Encodes the specified ListCorporaRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListCorporaRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ListCorporaRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IListCorporaRequest} message ListCorporaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCorporaRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListCorporaRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListCorporaRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListCorporaRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IListCorporaRequest} message ListCorporaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCorporaRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCorporaRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ListCorporaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ListCorporaRequest} ListCorporaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCorporaRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ListCorporaRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListCorporaRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListCorporaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ListCorporaRequest} ListCorporaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCorporaRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCorporaRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ListCorporaRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCorporaRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListCorporaRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ListCorporaRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ListCorporaRequest} ListCorporaRequest + */ + ListCorporaRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ListCorporaRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ListCorporaRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListCorporaRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ListCorporaRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ListCorporaRequest} message ListCorporaRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCorporaRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListCorporaRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ListCorporaRequest + * @instance + * @returns {Object.} JSON object + */ + ListCorporaRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCorporaRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ListCorporaRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCorporaRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ListCorporaRequest"; + }; + + return ListCorporaRequest; + })(); + + v1alpha1.ListCorporaResponse = (function() { + + /** + * Properties of a ListCorporaResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IListCorporaResponse + * @property {Array.|null} [corpora] ListCorporaResponse corpora + * @property {string|null} [nextPageToken] ListCorporaResponse nextPageToken + */ + + /** + * Constructs a new ListCorporaResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a ListCorporaResponse. + * @implements IListCorporaResponse + * @constructor + * @param {google.cloud.visionai.v1alpha1.IListCorporaResponse=} [properties] Properties to set + */ + function ListCorporaResponse(properties) { + this.corpora = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCorporaResponse corpora. + * @member {Array.} corpora + * @memberof google.cloud.visionai.v1alpha1.ListCorporaResponse + * @instance + */ + ListCorporaResponse.prototype.corpora = $util.emptyArray; + + /** + * ListCorporaResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.visionai.v1alpha1.ListCorporaResponse + * @instance + */ + ListCorporaResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListCorporaResponse instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ListCorporaResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IListCorporaResponse=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ListCorporaResponse} ListCorporaResponse instance + */ + ListCorporaResponse.create = function create(properties) { + return new ListCorporaResponse(properties); + }; + + /** + * Encodes the specified ListCorporaResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListCorporaResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ListCorporaResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IListCorporaResponse} message ListCorporaResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCorporaResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.corpora != null && message.corpora.length) + for (var i = 0; i < message.corpora.length; ++i) + $root.google.cloud.visionai.v1alpha1.Corpus.encode(message.corpora[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListCorporaResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListCorporaResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListCorporaResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IListCorporaResponse} message ListCorporaResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCorporaResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCorporaResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ListCorporaResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ListCorporaResponse} ListCorporaResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCorporaResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ListCorporaResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.corpora && message.corpora.length)) + message.corpora = []; + message.corpora.push($root.google.cloud.visionai.v1alpha1.Corpus.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListCorporaResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListCorporaResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ListCorporaResponse} ListCorporaResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCorporaResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCorporaResponse message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ListCorporaResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCorporaResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.corpora != null && message.hasOwnProperty("corpora")) { + if (!Array.isArray(message.corpora)) + return "corpora: array expected"; + for (var i = 0; i < message.corpora.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.Corpus.verify(message.corpora[i], long + 1); + if (error) + return "corpora." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListCorporaResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ListCorporaResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ListCorporaResponse} ListCorporaResponse + */ + ListCorporaResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ListCorporaResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ListCorporaResponse(); + if (object.corpora) { + if (!Array.isArray(object.corpora)) + throw TypeError(".google.cloud.visionai.v1alpha1.ListCorporaResponse.corpora: array expected"); + message.corpora = []; + for (var i = 0; i < object.corpora.length; ++i) { + if (typeof object.corpora[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ListCorporaResponse.corpora: object expected"); + message.corpora[i] = $root.google.cloud.visionai.v1alpha1.Corpus.fromObject(object.corpora[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListCorporaResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ListCorporaResponse + * @static + * @param {google.cloud.visionai.v1alpha1.ListCorporaResponse} message ListCorporaResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCorporaResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.corpora = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.corpora && message.corpora.length) { + object.corpora = []; + for (var j = 0; j < message.corpora.length; ++j) + object.corpora[j] = $root.google.cloud.visionai.v1alpha1.Corpus.toObject(message.corpora[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListCorporaResponse to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ListCorporaResponse + * @instance + * @returns {Object.} JSON object + */ + ListCorporaResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCorporaResponse + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ListCorporaResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCorporaResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ListCorporaResponse"; + }; + + return ListCorporaResponse; + })(); + + v1alpha1.DeleteCorpusRequest = (function() { + + /** + * Properties of a DeleteCorpusRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IDeleteCorpusRequest + * @property {string|null} [name] DeleteCorpusRequest name + */ + + /** + * Constructs a new DeleteCorpusRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a DeleteCorpusRequest. + * @implements IDeleteCorpusRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IDeleteCorpusRequest=} [properties] Properties to set + */ + function DeleteCorpusRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteCorpusRequest name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.DeleteCorpusRequest + * @instance + */ + DeleteCorpusRequest.prototype.name = ""; + + /** + * Creates a new DeleteCorpusRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.DeleteCorpusRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IDeleteCorpusRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.DeleteCorpusRequest} DeleteCorpusRequest instance + */ + DeleteCorpusRequest.create = function create(properties) { + return new DeleteCorpusRequest(properties); + }; + + /** + * Encodes the specified DeleteCorpusRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteCorpusRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.DeleteCorpusRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IDeleteCorpusRequest} message DeleteCorpusRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteCorpusRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteCorpusRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteCorpusRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.DeleteCorpusRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IDeleteCorpusRequest} message DeleteCorpusRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteCorpusRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteCorpusRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.DeleteCorpusRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.DeleteCorpusRequest} DeleteCorpusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteCorpusRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.DeleteCorpusRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteCorpusRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.DeleteCorpusRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.DeleteCorpusRequest} DeleteCorpusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteCorpusRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteCorpusRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.DeleteCorpusRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteCorpusRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteCorpusRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.DeleteCorpusRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.DeleteCorpusRequest} DeleteCorpusRequest + */ + DeleteCorpusRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.DeleteCorpusRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.DeleteCorpusRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteCorpusRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.DeleteCorpusRequest + * @static + * @param {google.cloud.visionai.v1alpha1.DeleteCorpusRequest} message DeleteCorpusRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteCorpusRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteCorpusRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.DeleteCorpusRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteCorpusRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteCorpusRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.DeleteCorpusRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteCorpusRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.DeleteCorpusRequest"; + }; + + return DeleteCorpusRequest; + })(); + + v1alpha1.CreateDataSchemaRequest = (function() { + + /** + * Properties of a CreateDataSchemaRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface ICreateDataSchemaRequest + * @property {string|null} [parent] CreateDataSchemaRequest parent + * @property {google.cloud.visionai.v1alpha1.IDataSchema|null} [dataSchema] CreateDataSchemaRequest dataSchema + */ + + /** + * Constructs a new CreateDataSchemaRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a CreateDataSchemaRequest. + * @implements ICreateDataSchemaRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.ICreateDataSchemaRequest=} [properties] Properties to set + */ + function CreateDataSchemaRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateDataSchemaRequest parent. + * @member {string} parent + * @memberof google.cloud.visionai.v1alpha1.CreateDataSchemaRequest + * @instance + */ + CreateDataSchemaRequest.prototype.parent = ""; + + /** + * CreateDataSchemaRequest dataSchema. + * @member {google.cloud.visionai.v1alpha1.IDataSchema|null|undefined} dataSchema + * @memberof google.cloud.visionai.v1alpha1.CreateDataSchemaRequest + * @instance + */ + CreateDataSchemaRequest.prototype.dataSchema = null; + + /** + * Creates a new CreateDataSchemaRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.CreateDataSchemaRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ICreateDataSchemaRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.CreateDataSchemaRequest} CreateDataSchemaRequest instance + */ + CreateDataSchemaRequest.create = function create(properties) { + return new CreateDataSchemaRequest(properties); + }; + + /** + * Encodes the specified CreateDataSchemaRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateDataSchemaRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.CreateDataSchemaRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ICreateDataSchemaRequest} message CreateDataSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDataSchemaRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.dataSchema != null && Object.hasOwnProperty.call(message, "dataSchema")) + $root.google.cloud.visionai.v1alpha1.DataSchema.encode(message.dataSchema, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateDataSchemaRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateDataSchemaRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.CreateDataSchemaRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ICreateDataSchemaRequest} message CreateDataSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDataSchemaRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateDataSchemaRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.CreateDataSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.CreateDataSchemaRequest} CreateDataSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDataSchemaRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.CreateDataSchemaRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.dataSchema = $root.google.cloud.visionai.v1alpha1.DataSchema.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreateDataSchemaRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.CreateDataSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.CreateDataSchemaRequest} CreateDataSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDataSchemaRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateDataSchemaRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.CreateDataSchemaRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateDataSchemaRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.dataSchema != null && message.hasOwnProperty("dataSchema")) { + var error = $root.google.cloud.visionai.v1alpha1.DataSchema.verify(message.dataSchema, long + 1); + if (error) + return "dataSchema." + error; + } + return null; + }; + + /** + * Creates a CreateDataSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.CreateDataSchemaRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.CreateDataSchemaRequest} CreateDataSchemaRequest + */ + CreateDataSchemaRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.CreateDataSchemaRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.CreateDataSchemaRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.dataSchema != null) { + if (typeof object.dataSchema !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.CreateDataSchemaRequest.dataSchema: object expected"); + message.dataSchema = $root.google.cloud.visionai.v1alpha1.DataSchema.fromObject(object.dataSchema, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a CreateDataSchemaRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.CreateDataSchemaRequest + * @static + * @param {google.cloud.visionai.v1alpha1.CreateDataSchemaRequest} message CreateDataSchemaRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateDataSchemaRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.dataSchema = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.dataSchema != null && message.hasOwnProperty("dataSchema")) + object.dataSchema = $root.google.cloud.visionai.v1alpha1.DataSchema.toObject(message.dataSchema, options); + return object; + }; + + /** + * Converts this CreateDataSchemaRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.CreateDataSchemaRequest + * @instance + * @returns {Object.} JSON object + */ + CreateDataSchemaRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateDataSchemaRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.CreateDataSchemaRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateDataSchemaRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.CreateDataSchemaRequest"; + }; + + return CreateDataSchemaRequest; + })(); + + v1alpha1.DataSchema = (function() { + + /** + * Properties of a DataSchema. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IDataSchema + * @property {string|null} [name] DataSchema name + * @property {string|null} [key] DataSchema key + * @property {google.cloud.visionai.v1alpha1.IDataSchemaDetails|null} [schemaDetails] DataSchema schemaDetails + */ + + /** + * Constructs a new DataSchema. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a DataSchema. + * @implements IDataSchema + * @constructor + * @param {google.cloud.visionai.v1alpha1.IDataSchema=} [properties] Properties to set + */ + function DataSchema(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataSchema name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.DataSchema + * @instance + */ + DataSchema.prototype.name = ""; + + /** + * DataSchema key. + * @member {string} key + * @memberof google.cloud.visionai.v1alpha1.DataSchema + * @instance + */ + DataSchema.prototype.key = ""; + + /** + * DataSchema schemaDetails. + * @member {google.cloud.visionai.v1alpha1.IDataSchemaDetails|null|undefined} schemaDetails + * @memberof google.cloud.visionai.v1alpha1.DataSchema + * @instance + */ + DataSchema.prototype.schemaDetails = null; + + /** + * Creates a new DataSchema instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.DataSchema + * @static + * @param {google.cloud.visionai.v1alpha1.IDataSchema=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.DataSchema} DataSchema instance + */ + DataSchema.create = function create(properties) { + return new DataSchema(properties); + }; + + /** + * Encodes the specified DataSchema message. Does not implicitly {@link google.cloud.visionai.v1alpha1.DataSchema.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.DataSchema + * @static + * @param {google.cloud.visionai.v1alpha1.IDataSchema} message DataSchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataSchema.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.key); + if (message.schemaDetails != null && Object.hasOwnProperty.call(message, "schemaDetails")) + $root.google.cloud.visionai.v1alpha1.DataSchemaDetails.encode(message.schemaDetails, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DataSchema message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.DataSchema.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.DataSchema + * @static + * @param {google.cloud.visionai.v1alpha1.IDataSchema} message DataSchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataSchema.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataSchema message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.DataSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.DataSchema} DataSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataSchema.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.DataSchema(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.key = reader.string(); + break; + } + case 3: { + message.schemaDetails = $root.google.cloud.visionai.v1alpha1.DataSchemaDetails.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DataSchema message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.DataSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.DataSchema} DataSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataSchema.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataSchema message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.DataSchema + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataSchema.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; + if (message.schemaDetails != null && message.hasOwnProperty("schemaDetails")) { + var error = $root.google.cloud.visionai.v1alpha1.DataSchemaDetails.verify(message.schemaDetails, long + 1); + if (error) + return "schemaDetails." + error; + } + return null; + }; + + /** + * Creates a DataSchema message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.DataSchema + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.DataSchema} DataSchema + */ + DataSchema.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.DataSchema) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.DataSchema(); + if (object.name != null) + message.name = String(object.name); + if (object.key != null) + message.key = String(object.key); + if (object.schemaDetails != null) { + if (typeof object.schemaDetails !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.DataSchema.schemaDetails: object expected"); + message.schemaDetails = $root.google.cloud.visionai.v1alpha1.DataSchemaDetails.fromObject(object.schemaDetails, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a DataSchema message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.DataSchema + * @static + * @param {google.cloud.visionai.v1alpha1.DataSchema} message DataSchema + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataSchema.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.key = ""; + object.schemaDetails = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + if (message.schemaDetails != null && message.hasOwnProperty("schemaDetails")) + object.schemaDetails = $root.google.cloud.visionai.v1alpha1.DataSchemaDetails.toObject(message.schemaDetails, options); + return object; + }; + + /** + * Converts this DataSchema to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.DataSchema + * @instance + * @returns {Object.} JSON object + */ + DataSchema.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataSchema + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.DataSchema + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataSchema.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.DataSchema"; + }; + + return DataSchema; + })(); + + v1alpha1.DataSchemaDetails = (function() { + + /** + * Properties of a DataSchemaDetails. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IDataSchemaDetails + * @property {google.cloud.visionai.v1alpha1.DataSchemaDetails.DataType|null} [type] DataSchemaDetails type + * @property {google.cloud.visionai.v1alpha1.DataSchemaDetails.IProtoAnyConfig|null} [protoAnyConfig] DataSchemaDetails protoAnyConfig + * @property {google.cloud.visionai.v1alpha1.DataSchemaDetails.Granularity|null} [granularity] DataSchemaDetails granularity + * @property {google.cloud.visionai.v1alpha1.DataSchemaDetails.ISearchStrategy|null} [searchStrategy] DataSchemaDetails searchStrategy + */ + + /** + * Constructs a new DataSchemaDetails. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a DataSchemaDetails. + * @implements IDataSchemaDetails + * @constructor + * @param {google.cloud.visionai.v1alpha1.IDataSchemaDetails=} [properties] Properties to set + */ + function DataSchemaDetails(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataSchemaDetails type. + * @member {google.cloud.visionai.v1alpha1.DataSchemaDetails.DataType} type + * @memberof google.cloud.visionai.v1alpha1.DataSchemaDetails + * @instance + */ + DataSchemaDetails.prototype.type = 0; + + /** + * DataSchemaDetails protoAnyConfig. + * @member {google.cloud.visionai.v1alpha1.DataSchemaDetails.IProtoAnyConfig|null|undefined} protoAnyConfig + * @memberof google.cloud.visionai.v1alpha1.DataSchemaDetails + * @instance + */ + DataSchemaDetails.prototype.protoAnyConfig = null; + + /** + * DataSchemaDetails granularity. + * @member {google.cloud.visionai.v1alpha1.DataSchemaDetails.Granularity} granularity + * @memberof google.cloud.visionai.v1alpha1.DataSchemaDetails + * @instance + */ + DataSchemaDetails.prototype.granularity = 0; + + /** + * DataSchemaDetails searchStrategy. + * @member {google.cloud.visionai.v1alpha1.DataSchemaDetails.ISearchStrategy|null|undefined} searchStrategy + * @memberof google.cloud.visionai.v1alpha1.DataSchemaDetails + * @instance + */ + DataSchemaDetails.prototype.searchStrategy = null; + + /** + * Creates a new DataSchemaDetails instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.DataSchemaDetails + * @static + * @param {google.cloud.visionai.v1alpha1.IDataSchemaDetails=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.DataSchemaDetails} DataSchemaDetails instance + */ + DataSchemaDetails.create = function create(properties) { + return new DataSchemaDetails(properties); + }; + + /** + * Encodes the specified DataSchemaDetails message. Does not implicitly {@link google.cloud.visionai.v1alpha1.DataSchemaDetails.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.DataSchemaDetails + * @static + * @param {google.cloud.visionai.v1alpha1.IDataSchemaDetails} message DataSchemaDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataSchemaDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.granularity != null && Object.hasOwnProperty.call(message, "granularity")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.granularity); + if (message.protoAnyConfig != null && Object.hasOwnProperty.call(message, "protoAnyConfig")) + $root.google.cloud.visionai.v1alpha1.DataSchemaDetails.ProtoAnyConfig.encode(message.protoAnyConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.searchStrategy != null && Object.hasOwnProperty.call(message, "searchStrategy")) + $root.google.cloud.visionai.v1alpha1.DataSchemaDetails.SearchStrategy.encode(message.searchStrategy, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DataSchemaDetails message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.DataSchemaDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.DataSchemaDetails + * @static + * @param {google.cloud.visionai.v1alpha1.IDataSchemaDetails} message DataSchemaDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataSchemaDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataSchemaDetails message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.DataSchemaDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.DataSchemaDetails} DataSchemaDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataSchemaDetails.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.DataSchemaDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 6: { + message.protoAnyConfig = $root.google.cloud.visionai.v1alpha1.DataSchemaDetails.ProtoAnyConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.granularity = reader.int32(); + break; + } + case 7: { + message.searchStrategy = $root.google.cloud.visionai.v1alpha1.DataSchemaDetails.SearchStrategy.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DataSchemaDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.DataSchemaDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.DataSchemaDetails} DataSchemaDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataSchemaDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataSchemaDetails message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.DataSchemaDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataSchemaDetails.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 5: + case 7: + case 8: + case 9: + break; + } + if (message.protoAnyConfig != null && message.hasOwnProperty("protoAnyConfig")) { + var error = $root.google.cloud.visionai.v1alpha1.DataSchemaDetails.ProtoAnyConfig.verify(message.protoAnyConfig, long + 1); + if (error) + return "protoAnyConfig." + error; + } + if (message.granularity != null && message.hasOwnProperty("granularity")) + switch (message.granularity) { + default: + return "granularity: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.searchStrategy != null && message.hasOwnProperty("searchStrategy")) { + var error = $root.google.cloud.visionai.v1alpha1.DataSchemaDetails.SearchStrategy.verify(message.searchStrategy, long + 1); + if (error) + return "searchStrategy." + error; + } + return null; + }; + + /** + * Creates a DataSchemaDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.DataSchemaDetails + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.DataSchemaDetails} DataSchemaDetails + */ + DataSchemaDetails.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.DataSchemaDetails) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.DataSchemaDetails(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "DATA_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "INTEGER": + case 1: + message.type = 1; + break; + case "FLOAT": + case 2: + message.type = 2; + break; + case "STRING": + case 3: + message.type = 3; + break; + case "DATETIME": + case 5: + message.type = 5; + break; + case "GEO_COORDINATE": + case 7: + message.type = 7; + break; + case "PROTO_ANY": + case 8: + message.type = 8; + break; + case "BOOLEAN": + case 9: + message.type = 9; + break; + } + if (object.protoAnyConfig != null) { + if (typeof object.protoAnyConfig !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.DataSchemaDetails.protoAnyConfig: object expected"); + message.protoAnyConfig = $root.google.cloud.visionai.v1alpha1.DataSchemaDetails.ProtoAnyConfig.fromObject(object.protoAnyConfig, long + 1); + } + switch (object.granularity) { + default: + if (typeof object.granularity === "number") { + message.granularity = object.granularity; + break; + } + break; + case "GRANULARITY_UNSPECIFIED": + case 0: + message.granularity = 0; + break; + case "GRANULARITY_ASSET_LEVEL": + case 1: + message.granularity = 1; + break; + case "GRANULARITY_PARTITION_LEVEL": + case 2: + message.granularity = 2; + break; + } + if (object.searchStrategy != null) { + if (typeof object.searchStrategy !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.DataSchemaDetails.searchStrategy: object expected"); + message.searchStrategy = $root.google.cloud.visionai.v1alpha1.DataSchemaDetails.SearchStrategy.fromObject(object.searchStrategy, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a DataSchemaDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.DataSchemaDetails + * @static + * @param {google.cloud.visionai.v1alpha1.DataSchemaDetails} message DataSchemaDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataSchemaDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "DATA_TYPE_UNSPECIFIED" : 0; + object.granularity = options.enums === String ? "GRANULARITY_UNSPECIFIED" : 0; + object.protoAnyConfig = null; + object.searchStrategy = null; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.visionai.v1alpha1.DataSchemaDetails.DataType[message.type] === undefined ? message.type : $root.google.cloud.visionai.v1alpha1.DataSchemaDetails.DataType[message.type] : message.type; + if (message.granularity != null && message.hasOwnProperty("granularity")) + object.granularity = options.enums === String ? $root.google.cloud.visionai.v1alpha1.DataSchemaDetails.Granularity[message.granularity] === undefined ? message.granularity : $root.google.cloud.visionai.v1alpha1.DataSchemaDetails.Granularity[message.granularity] : message.granularity; + if (message.protoAnyConfig != null && message.hasOwnProperty("protoAnyConfig")) + object.protoAnyConfig = $root.google.cloud.visionai.v1alpha1.DataSchemaDetails.ProtoAnyConfig.toObject(message.protoAnyConfig, options); + if (message.searchStrategy != null && message.hasOwnProperty("searchStrategy")) + object.searchStrategy = $root.google.cloud.visionai.v1alpha1.DataSchemaDetails.SearchStrategy.toObject(message.searchStrategy, options); + return object; + }; + + /** + * Converts this DataSchemaDetails to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.DataSchemaDetails + * @instance + * @returns {Object.} JSON object + */ + DataSchemaDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataSchemaDetails + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.DataSchemaDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataSchemaDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.DataSchemaDetails"; + }; + + DataSchemaDetails.ProtoAnyConfig = (function() { + + /** + * Properties of a ProtoAnyConfig. + * @memberof google.cloud.visionai.v1alpha1.DataSchemaDetails + * @interface IProtoAnyConfig + * @property {string|null} [typeUri] ProtoAnyConfig typeUri + */ + + /** + * Constructs a new ProtoAnyConfig. + * @memberof google.cloud.visionai.v1alpha1.DataSchemaDetails + * @classdesc Represents a ProtoAnyConfig. + * @implements IProtoAnyConfig + * @constructor + * @param {google.cloud.visionai.v1alpha1.DataSchemaDetails.IProtoAnyConfig=} [properties] Properties to set + */ + function ProtoAnyConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProtoAnyConfig typeUri. + * @member {string} typeUri + * @memberof google.cloud.visionai.v1alpha1.DataSchemaDetails.ProtoAnyConfig + * @instance + */ + ProtoAnyConfig.prototype.typeUri = ""; + + /** + * Creates a new ProtoAnyConfig instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.DataSchemaDetails.ProtoAnyConfig + * @static + * @param {google.cloud.visionai.v1alpha1.DataSchemaDetails.IProtoAnyConfig=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.DataSchemaDetails.ProtoAnyConfig} ProtoAnyConfig instance + */ + ProtoAnyConfig.create = function create(properties) { + return new ProtoAnyConfig(properties); + }; + + /** + * Encodes the specified ProtoAnyConfig message. Does not implicitly {@link google.cloud.visionai.v1alpha1.DataSchemaDetails.ProtoAnyConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.DataSchemaDetails.ProtoAnyConfig + * @static + * @param {google.cloud.visionai.v1alpha1.DataSchemaDetails.IProtoAnyConfig} message ProtoAnyConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProtoAnyConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.typeUri != null && Object.hasOwnProperty.call(message, "typeUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.typeUri); + return writer; + }; + + /** + * Encodes the specified ProtoAnyConfig message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.DataSchemaDetails.ProtoAnyConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.DataSchemaDetails.ProtoAnyConfig + * @static + * @param {google.cloud.visionai.v1alpha1.DataSchemaDetails.IProtoAnyConfig} message ProtoAnyConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProtoAnyConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProtoAnyConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.DataSchemaDetails.ProtoAnyConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.DataSchemaDetails.ProtoAnyConfig} ProtoAnyConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProtoAnyConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.DataSchemaDetails.ProtoAnyConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.typeUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ProtoAnyConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.DataSchemaDetails.ProtoAnyConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.DataSchemaDetails.ProtoAnyConfig} ProtoAnyConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProtoAnyConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProtoAnyConfig message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.DataSchemaDetails.ProtoAnyConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProtoAnyConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.typeUri != null && message.hasOwnProperty("typeUri")) + if (!$util.isString(message.typeUri)) + return "typeUri: string expected"; + return null; + }; + + /** + * Creates a ProtoAnyConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.DataSchemaDetails.ProtoAnyConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.DataSchemaDetails.ProtoAnyConfig} ProtoAnyConfig + */ + ProtoAnyConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.DataSchemaDetails.ProtoAnyConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.DataSchemaDetails.ProtoAnyConfig(); + if (object.typeUri != null) + message.typeUri = String(object.typeUri); + return message; + }; + + /** + * Creates a plain object from a ProtoAnyConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.DataSchemaDetails.ProtoAnyConfig + * @static + * @param {google.cloud.visionai.v1alpha1.DataSchemaDetails.ProtoAnyConfig} message ProtoAnyConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProtoAnyConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.typeUri = ""; + if (message.typeUri != null && message.hasOwnProperty("typeUri")) + object.typeUri = message.typeUri; + return object; + }; + + /** + * Converts this ProtoAnyConfig to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.DataSchemaDetails.ProtoAnyConfig + * @instance + * @returns {Object.} JSON object + */ + ProtoAnyConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ProtoAnyConfig + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.DataSchemaDetails.ProtoAnyConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ProtoAnyConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.DataSchemaDetails.ProtoAnyConfig"; + }; + + return ProtoAnyConfig; + })(); + + DataSchemaDetails.SearchStrategy = (function() { + + /** + * Properties of a SearchStrategy. + * @memberof google.cloud.visionai.v1alpha1.DataSchemaDetails + * @interface ISearchStrategy + * @property {google.cloud.visionai.v1alpha1.DataSchemaDetails.SearchStrategy.SearchStrategyType|null} [searchStrategyType] SearchStrategy searchStrategyType + */ + + /** + * Constructs a new SearchStrategy. + * @memberof google.cloud.visionai.v1alpha1.DataSchemaDetails + * @classdesc Represents a SearchStrategy. + * @implements ISearchStrategy + * @constructor + * @param {google.cloud.visionai.v1alpha1.DataSchemaDetails.ISearchStrategy=} [properties] Properties to set + */ + function SearchStrategy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchStrategy searchStrategyType. + * @member {google.cloud.visionai.v1alpha1.DataSchemaDetails.SearchStrategy.SearchStrategyType} searchStrategyType + * @memberof google.cloud.visionai.v1alpha1.DataSchemaDetails.SearchStrategy + * @instance + */ + SearchStrategy.prototype.searchStrategyType = 0; + + /** + * Creates a new SearchStrategy instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.DataSchemaDetails.SearchStrategy + * @static + * @param {google.cloud.visionai.v1alpha1.DataSchemaDetails.ISearchStrategy=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.DataSchemaDetails.SearchStrategy} SearchStrategy instance + */ + SearchStrategy.create = function create(properties) { + return new SearchStrategy(properties); + }; + + /** + * Encodes the specified SearchStrategy message. Does not implicitly {@link google.cloud.visionai.v1alpha1.DataSchemaDetails.SearchStrategy.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.DataSchemaDetails.SearchStrategy + * @static + * @param {google.cloud.visionai.v1alpha1.DataSchemaDetails.ISearchStrategy} message SearchStrategy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchStrategy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.searchStrategyType != null && Object.hasOwnProperty.call(message, "searchStrategyType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.searchStrategyType); + return writer; + }; + + /** + * Encodes the specified SearchStrategy message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.DataSchemaDetails.SearchStrategy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.DataSchemaDetails.SearchStrategy + * @static + * @param {google.cloud.visionai.v1alpha1.DataSchemaDetails.ISearchStrategy} message SearchStrategy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchStrategy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchStrategy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.DataSchemaDetails.SearchStrategy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.DataSchemaDetails.SearchStrategy} SearchStrategy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchStrategy.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.DataSchemaDetails.SearchStrategy(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.searchStrategyType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SearchStrategy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.DataSchemaDetails.SearchStrategy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.DataSchemaDetails.SearchStrategy} SearchStrategy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchStrategy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchStrategy message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.DataSchemaDetails.SearchStrategy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchStrategy.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.searchStrategyType != null && message.hasOwnProperty("searchStrategyType")) + switch (message.searchStrategyType) { + default: + return "searchStrategyType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a SearchStrategy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.DataSchemaDetails.SearchStrategy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.DataSchemaDetails.SearchStrategy} SearchStrategy + */ + SearchStrategy.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.DataSchemaDetails.SearchStrategy) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.DataSchemaDetails.SearchStrategy(); + switch (object.searchStrategyType) { + default: + if (typeof object.searchStrategyType === "number") { + message.searchStrategyType = object.searchStrategyType; + break; + } + break; + case "NO_SEARCH": + case 0: + message.searchStrategyType = 0; + break; + case "EXACT_SEARCH": + case 1: + message.searchStrategyType = 1; + break; + case "SMART_SEARCH": + case 2: + message.searchStrategyType = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a SearchStrategy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.DataSchemaDetails.SearchStrategy + * @static + * @param {google.cloud.visionai.v1alpha1.DataSchemaDetails.SearchStrategy} message SearchStrategy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchStrategy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.searchStrategyType = options.enums === String ? "NO_SEARCH" : 0; + if (message.searchStrategyType != null && message.hasOwnProperty("searchStrategyType")) + object.searchStrategyType = options.enums === String ? $root.google.cloud.visionai.v1alpha1.DataSchemaDetails.SearchStrategy.SearchStrategyType[message.searchStrategyType] === undefined ? message.searchStrategyType : $root.google.cloud.visionai.v1alpha1.DataSchemaDetails.SearchStrategy.SearchStrategyType[message.searchStrategyType] : message.searchStrategyType; + return object; + }; + + /** + * Converts this SearchStrategy to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.DataSchemaDetails.SearchStrategy + * @instance + * @returns {Object.} JSON object + */ + SearchStrategy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchStrategy + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.DataSchemaDetails.SearchStrategy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchStrategy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.DataSchemaDetails.SearchStrategy"; + }; + + /** + * SearchStrategyType enum. + * @name google.cloud.visionai.v1alpha1.DataSchemaDetails.SearchStrategy.SearchStrategyType + * @enum {number} + * @property {number} NO_SEARCH=0 NO_SEARCH value + * @property {number} EXACT_SEARCH=1 EXACT_SEARCH value + * @property {number} SMART_SEARCH=2 SMART_SEARCH value + */ + SearchStrategy.SearchStrategyType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NO_SEARCH"] = 0; + values[valuesById[1] = "EXACT_SEARCH"] = 1; + values[valuesById[2] = "SMART_SEARCH"] = 2; + return values; + })(); + + return SearchStrategy; + })(); + + /** + * DataType enum. + * @name google.cloud.visionai.v1alpha1.DataSchemaDetails.DataType + * @enum {number} + * @property {number} DATA_TYPE_UNSPECIFIED=0 DATA_TYPE_UNSPECIFIED value + * @property {number} INTEGER=1 INTEGER value + * @property {number} FLOAT=2 FLOAT value + * @property {number} STRING=3 STRING value + * @property {number} DATETIME=5 DATETIME value + * @property {number} GEO_COORDINATE=7 GEO_COORDINATE value + * @property {number} PROTO_ANY=8 PROTO_ANY value + * @property {number} BOOLEAN=9 BOOLEAN value + */ + DataSchemaDetails.DataType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATA_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INTEGER"] = 1; + values[valuesById[2] = "FLOAT"] = 2; + values[valuesById[3] = "STRING"] = 3; + values[valuesById[5] = "DATETIME"] = 5; + values[valuesById[7] = "GEO_COORDINATE"] = 7; + values[valuesById[8] = "PROTO_ANY"] = 8; + values[valuesById[9] = "BOOLEAN"] = 9; + return values; + })(); + + /** + * Granularity enum. + * @name google.cloud.visionai.v1alpha1.DataSchemaDetails.Granularity + * @enum {number} + * @property {number} GRANULARITY_UNSPECIFIED=0 GRANULARITY_UNSPECIFIED value + * @property {number} GRANULARITY_ASSET_LEVEL=1 GRANULARITY_ASSET_LEVEL value + * @property {number} GRANULARITY_PARTITION_LEVEL=2 GRANULARITY_PARTITION_LEVEL value + */ + DataSchemaDetails.Granularity = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "GRANULARITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "GRANULARITY_ASSET_LEVEL"] = 1; + values[valuesById[2] = "GRANULARITY_PARTITION_LEVEL"] = 2; + return values; + })(); + + return DataSchemaDetails; + })(); + + v1alpha1.UpdateDataSchemaRequest = (function() { + + /** + * Properties of an UpdateDataSchemaRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IUpdateDataSchemaRequest + * @property {google.cloud.visionai.v1alpha1.IDataSchema|null} [dataSchema] UpdateDataSchemaRequest dataSchema + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateDataSchemaRequest updateMask + */ + + /** + * Constructs a new UpdateDataSchemaRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents an UpdateDataSchemaRequest. + * @implements IUpdateDataSchemaRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IUpdateDataSchemaRequest=} [properties] Properties to set + */ + function UpdateDataSchemaRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateDataSchemaRequest dataSchema. + * @member {google.cloud.visionai.v1alpha1.IDataSchema|null|undefined} dataSchema + * @memberof google.cloud.visionai.v1alpha1.UpdateDataSchemaRequest + * @instance + */ + UpdateDataSchemaRequest.prototype.dataSchema = null; + + /** + * UpdateDataSchemaRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.visionai.v1alpha1.UpdateDataSchemaRequest + * @instance + */ + UpdateDataSchemaRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateDataSchemaRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.UpdateDataSchemaRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IUpdateDataSchemaRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.UpdateDataSchemaRequest} UpdateDataSchemaRequest instance + */ + UpdateDataSchemaRequest.create = function create(properties) { + return new UpdateDataSchemaRequest(properties); + }; + + /** + * Encodes the specified UpdateDataSchemaRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateDataSchemaRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.UpdateDataSchemaRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IUpdateDataSchemaRequest} message UpdateDataSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDataSchemaRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataSchema != null && Object.hasOwnProperty.call(message, "dataSchema")) + $root.google.cloud.visionai.v1alpha1.DataSchema.encode(message.dataSchema, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateDataSchemaRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateDataSchemaRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.UpdateDataSchemaRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IUpdateDataSchemaRequest} message UpdateDataSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDataSchemaRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateDataSchemaRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.UpdateDataSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.UpdateDataSchemaRequest} UpdateDataSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDataSchemaRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.UpdateDataSchemaRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.dataSchema = $root.google.cloud.visionai.v1alpha1.DataSchema.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateDataSchemaRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.UpdateDataSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.UpdateDataSchemaRequest} UpdateDataSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDataSchemaRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateDataSchemaRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.UpdateDataSchemaRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateDataSchemaRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.dataSchema != null && message.hasOwnProperty("dataSchema")) { + var error = $root.google.cloud.visionai.v1alpha1.DataSchema.verify(message.dataSchema, long + 1); + if (error) + return "dataSchema." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateDataSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.UpdateDataSchemaRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.UpdateDataSchemaRequest} UpdateDataSchemaRequest + */ + UpdateDataSchemaRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.UpdateDataSchemaRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.UpdateDataSchemaRequest(); + if (object.dataSchema != null) { + if (typeof object.dataSchema !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.UpdateDataSchemaRequest.dataSchema: object expected"); + message.dataSchema = $root.google.cloud.visionai.v1alpha1.DataSchema.fromObject(object.dataSchema, long + 1); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.UpdateDataSchemaRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an UpdateDataSchemaRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.UpdateDataSchemaRequest + * @static + * @param {google.cloud.visionai.v1alpha1.UpdateDataSchemaRequest} message UpdateDataSchemaRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateDataSchemaRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.dataSchema = null; + object.updateMask = null; + } + if (message.dataSchema != null && message.hasOwnProperty("dataSchema")) + object.dataSchema = $root.google.cloud.visionai.v1alpha1.DataSchema.toObject(message.dataSchema, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateDataSchemaRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.UpdateDataSchemaRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateDataSchemaRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateDataSchemaRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.UpdateDataSchemaRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateDataSchemaRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.UpdateDataSchemaRequest"; + }; + + return UpdateDataSchemaRequest; + })(); + + v1alpha1.GetDataSchemaRequest = (function() { + + /** + * Properties of a GetDataSchemaRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IGetDataSchemaRequest + * @property {string|null} [name] GetDataSchemaRequest name + */ + + /** + * Constructs a new GetDataSchemaRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a GetDataSchemaRequest. + * @implements IGetDataSchemaRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IGetDataSchemaRequest=} [properties] Properties to set + */ + function GetDataSchemaRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDataSchemaRequest name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.GetDataSchemaRequest + * @instance + */ + GetDataSchemaRequest.prototype.name = ""; + + /** + * Creates a new GetDataSchemaRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.GetDataSchemaRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IGetDataSchemaRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.GetDataSchemaRequest} GetDataSchemaRequest instance + */ + GetDataSchemaRequest.create = function create(properties) { + return new GetDataSchemaRequest(properties); + }; + + /** + * Encodes the specified GetDataSchemaRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetDataSchemaRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.GetDataSchemaRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IGetDataSchemaRequest} message GetDataSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataSchemaRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetDataSchemaRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetDataSchemaRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.GetDataSchemaRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IGetDataSchemaRequest} message GetDataSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataSchemaRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDataSchemaRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.GetDataSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.GetDataSchemaRequest} GetDataSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataSchemaRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.GetDataSchemaRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetDataSchemaRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.GetDataSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.GetDataSchemaRequest} GetDataSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataSchemaRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDataSchemaRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.GetDataSchemaRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDataSchemaRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetDataSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.GetDataSchemaRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.GetDataSchemaRequest} GetDataSchemaRequest + */ + GetDataSchemaRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.GetDataSchemaRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.GetDataSchemaRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetDataSchemaRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.GetDataSchemaRequest + * @static + * @param {google.cloud.visionai.v1alpha1.GetDataSchemaRequest} message GetDataSchemaRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDataSchemaRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetDataSchemaRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.GetDataSchemaRequest + * @instance + * @returns {Object.} JSON object + */ + GetDataSchemaRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetDataSchemaRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.GetDataSchemaRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetDataSchemaRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.GetDataSchemaRequest"; + }; + + return GetDataSchemaRequest; + })(); + + v1alpha1.DeleteDataSchemaRequest = (function() { + + /** + * Properties of a DeleteDataSchemaRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IDeleteDataSchemaRequest + * @property {string|null} [name] DeleteDataSchemaRequest name + */ + + /** + * Constructs a new DeleteDataSchemaRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a DeleteDataSchemaRequest. + * @implements IDeleteDataSchemaRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IDeleteDataSchemaRequest=} [properties] Properties to set + */ + function DeleteDataSchemaRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteDataSchemaRequest name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.DeleteDataSchemaRequest + * @instance + */ + DeleteDataSchemaRequest.prototype.name = ""; + + /** + * Creates a new DeleteDataSchemaRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.DeleteDataSchemaRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IDeleteDataSchemaRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.DeleteDataSchemaRequest} DeleteDataSchemaRequest instance + */ + DeleteDataSchemaRequest.create = function create(properties) { + return new DeleteDataSchemaRequest(properties); + }; + + /** + * Encodes the specified DeleteDataSchemaRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteDataSchemaRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.DeleteDataSchemaRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IDeleteDataSchemaRequest} message DeleteDataSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDataSchemaRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteDataSchemaRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteDataSchemaRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.DeleteDataSchemaRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IDeleteDataSchemaRequest} message DeleteDataSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDataSchemaRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteDataSchemaRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.DeleteDataSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.DeleteDataSchemaRequest} DeleteDataSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDataSchemaRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.DeleteDataSchemaRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteDataSchemaRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.DeleteDataSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.DeleteDataSchemaRequest} DeleteDataSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDataSchemaRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteDataSchemaRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.DeleteDataSchemaRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteDataSchemaRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteDataSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.DeleteDataSchemaRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.DeleteDataSchemaRequest} DeleteDataSchemaRequest + */ + DeleteDataSchemaRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.DeleteDataSchemaRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.DeleteDataSchemaRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteDataSchemaRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.DeleteDataSchemaRequest + * @static + * @param {google.cloud.visionai.v1alpha1.DeleteDataSchemaRequest} message DeleteDataSchemaRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteDataSchemaRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteDataSchemaRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.DeleteDataSchemaRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteDataSchemaRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteDataSchemaRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.DeleteDataSchemaRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteDataSchemaRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.DeleteDataSchemaRequest"; + }; + + return DeleteDataSchemaRequest; + })(); + + v1alpha1.ListDataSchemasRequest = (function() { + + /** + * Properties of a ListDataSchemasRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IListDataSchemasRequest + * @property {string|null} [parent] ListDataSchemasRequest parent + * @property {number|null} [pageSize] ListDataSchemasRequest pageSize + * @property {string|null} [pageToken] ListDataSchemasRequest pageToken + */ + + /** + * Constructs a new ListDataSchemasRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a ListDataSchemasRequest. + * @implements IListDataSchemasRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IListDataSchemasRequest=} [properties] Properties to set + */ + function ListDataSchemasRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDataSchemasRequest parent. + * @member {string} parent + * @memberof google.cloud.visionai.v1alpha1.ListDataSchemasRequest + * @instance + */ + ListDataSchemasRequest.prototype.parent = ""; + + /** + * ListDataSchemasRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.visionai.v1alpha1.ListDataSchemasRequest + * @instance + */ + ListDataSchemasRequest.prototype.pageSize = 0; + + /** + * ListDataSchemasRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.visionai.v1alpha1.ListDataSchemasRequest + * @instance + */ + ListDataSchemasRequest.prototype.pageToken = ""; + + /** + * Creates a new ListDataSchemasRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ListDataSchemasRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IListDataSchemasRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ListDataSchemasRequest} ListDataSchemasRequest instance + */ + ListDataSchemasRequest.create = function create(properties) { + return new ListDataSchemasRequest(properties); + }; + + /** + * Encodes the specified ListDataSchemasRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListDataSchemasRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ListDataSchemasRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IListDataSchemasRequest} message ListDataSchemasRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDataSchemasRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListDataSchemasRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListDataSchemasRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListDataSchemasRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IListDataSchemasRequest} message ListDataSchemasRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDataSchemasRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDataSchemasRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ListDataSchemasRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ListDataSchemasRequest} ListDataSchemasRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDataSchemasRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ListDataSchemasRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListDataSchemasRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListDataSchemasRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ListDataSchemasRequest} ListDataSchemasRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDataSchemasRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDataSchemasRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ListDataSchemasRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDataSchemasRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListDataSchemasRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ListDataSchemasRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ListDataSchemasRequest} ListDataSchemasRequest + */ + ListDataSchemasRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ListDataSchemasRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ListDataSchemasRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListDataSchemasRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ListDataSchemasRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ListDataSchemasRequest} message ListDataSchemasRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDataSchemasRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListDataSchemasRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ListDataSchemasRequest + * @instance + * @returns {Object.} JSON object + */ + ListDataSchemasRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDataSchemasRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ListDataSchemasRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDataSchemasRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ListDataSchemasRequest"; + }; + + return ListDataSchemasRequest; + })(); + + v1alpha1.ListDataSchemasResponse = (function() { + + /** + * Properties of a ListDataSchemasResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IListDataSchemasResponse + * @property {Array.|null} [dataSchemas] ListDataSchemasResponse dataSchemas + * @property {string|null} [nextPageToken] ListDataSchemasResponse nextPageToken + */ + + /** + * Constructs a new ListDataSchemasResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a ListDataSchemasResponse. + * @implements IListDataSchemasResponse + * @constructor + * @param {google.cloud.visionai.v1alpha1.IListDataSchemasResponse=} [properties] Properties to set + */ + function ListDataSchemasResponse(properties) { + this.dataSchemas = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDataSchemasResponse dataSchemas. + * @member {Array.} dataSchemas + * @memberof google.cloud.visionai.v1alpha1.ListDataSchemasResponse + * @instance + */ + ListDataSchemasResponse.prototype.dataSchemas = $util.emptyArray; + + /** + * ListDataSchemasResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.visionai.v1alpha1.ListDataSchemasResponse + * @instance + */ + ListDataSchemasResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListDataSchemasResponse instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ListDataSchemasResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IListDataSchemasResponse=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ListDataSchemasResponse} ListDataSchemasResponse instance + */ + ListDataSchemasResponse.create = function create(properties) { + return new ListDataSchemasResponse(properties); + }; + + /** + * Encodes the specified ListDataSchemasResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListDataSchemasResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ListDataSchemasResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IListDataSchemasResponse} message ListDataSchemasResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDataSchemasResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataSchemas != null && message.dataSchemas.length) + for (var i = 0; i < message.dataSchemas.length; ++i) + $root.google.cloud.visionai.v1alpha1.DataSchema.encode(message.dataSchemas[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListDataSchemasResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListDataSchemasResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListDataSchemasResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IListDataSchemasResponse} message ListDataSchemasResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDataSchemasResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDataSchemasResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ListDataSchemasResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ListDataSchemasResponse} ListDataSchemasResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDataSchemasResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ListDataSchemasResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.dataSchemas && message.dataSchemas.length)) + message.dataSchemas = []; + message.dataSchemas.push($root.google.cloud.visionai.v1alpha1.DataSchema.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListDataSchemasResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListDataSchemasResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ListDataSchemasResponse} ListDataSchemasResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDataSchemasResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDataSchemasResponse message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ListDataSchemasResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDataSchemasResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.dataSchemas != null && message.hasOwnProperty("dataSchemas")) { + if (!Array.isArray(message.dataSchemas)) + return "dataSchemas: array expected"; + for (var i = 0; i < message.dataSchemas.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.DataSchema.verify(message.dataSchemas[i], long + 1); + if (error) + return "dataSchemas." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListDataSchemasResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ListDataSchemasResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ListDataSchemasResponse} ListDataSchemasResponse + */ + ListDataSchemasResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ListDataSchemasResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ListDataSchemasResponse(); + if (object.dataSchemas) { + if (!Array.isArray(object.dataSchemas)) + throw TypeError(".google.cloud.visionai.v1alpha1.ListDataSchemasResponse.dataSchemas: array expected"); + message.dataSchemas = []; + for (var i = 0; i < object.dataSchemas.length; ++i) { + if (typeof object.dataSchemas[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ListDataSchemasResponse.dataSchemas: object expected"); + message.dataSchemas[i] = $root.google.cloud.visionai.v1alpha1.DataSchema.fromObject(object.dataSchemas[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListDataSchemasResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ListDataSchemasResponse + * @static + * @param {google.cloud.visionai.v1alpha1.ListDataSchemasResponse} message ListDataSchemasResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDataSchemasResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dataSchemas = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.dataSchemas && message.dataSchemas.length) { + object.dataSchemas = []; + for (var j = 0; j < message.dataSchemas.length; ++j) + object.dataSchemas[j] = $root.google.cloud.visionai.v1alpha1.DataSchema.toObject(message.dataSchemas[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListDataSchemasResponse to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ListDataSchemasResponse + * @instance + * @returns {Object.} JSON object + */ + ListDataSchemasResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDataSchemasResponse + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ListDataSchemasResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDataSchemasResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ListDataSchemasResponse"; + }; + + return ListDataSchemasResponse; + })(); + + v1alpha1.CreateAnnotationRequest = (function() { + + /** + * Properties of a CreateAnnotationRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface ICreateAnnotationRequest + * @property {string|null} [parent] CreateAnnotationRequest parent + * @property {google.cloud.visionai.v1alpha1.IAnnotation|null} [annotation] CreateAnnotationRequest annotation + * @property {string|null} [annotationId] CreateAnnotationRequest annotationId + */ + + /** + * Constructs a new CreateAnnotationRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a CreateAnnotationRequest. + * @implements ICreateAnnotationRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.ICreateAnnotationRequest=} [properties] Properties to set + */ + function CreateAnnotationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateAnnotationRequest parent. + * @member {string} parent + * @memberof google.cloud.visionai.v1alpha1.CreateAnnotationRequest + * @instance + */ + CreateAnnotationRequest.prototype.parent = ""; + + /** + * CreateAnnotationRequest annotation. + * @member {google.cloud.visionai.v1alpha1.IAnnotation|null|undefined} annotation + * @memberof google.cloud.visionai.v1alpha1.CreateAnnotationRequest + * @instance + */ + CreateAnnotationRequest.prototype.annotation = null; + + /** + * CreateAnnotationRequest annotationId. + * @member {string|null|undefined} annotationId + * @memberof google.cloud.visionai.v1alpha1.CreateAnnotationRequest + * @instance + */ + CreateAnnotationRequest.prototype.annotationId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CreateAnnotationRequest.prototype, "_annotationId", { + get: $util.oneOfGetter($oneOfFields = ["annotationId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CreateAnnotationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.CreateAnnotationRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ICreateAnnotationRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.CreateAnnotationRequest} CreateAnnotationRequest instance + */ + CreateAnnotationRequest.create = function create(properties) { + return new CreateAnnotationRequest(properties); + }; + + /** + * Encodes the specified CreateAnnotationRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateAnnotationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.CreateAnnotationRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ICreateAnnotationRequest} message CreateAnnotationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAnnotationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.annotation != null && Object.hasOwnProperty.call(message, "annotation")) + $root.google.cloud.visionai.v1alpha1.Annotation.encode(message.annotation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.annotationId != null && Object.hasOwnProperty.call(message, "annotationId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.annotationId); + return writer; + }; + + /** + * Encodes the specified CreateAnnotationRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateAnnotationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.CreateAnnotationRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ICreateAnnotationRequest} message CreateAnnotationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAnnotationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateAnnotationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.CreateAnnotationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.CreateAnnotationRequest} CreateAnnotationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAnnotationRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.CreateAnnotationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.annotation = $root.google.cloud.visionai.v1alpha1.Annotation.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.annotationId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreateAnnotationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.CreateAnnotationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.CreateAnnotationRequest} CreateAnnotationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAnnotationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateAnnotationRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.CreateAnnotationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateAnnotationRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + var error = $root.google.cloud.visionai.v1alpha1.Annotation.verify(message.annotation, long + 1); + if (error) + return "annotation." + error; + } + if (message.annotationId != null && message.hasOwnProperty("annotationId")) { + properties._annotationId = 1; + if (!$util.isString(message.annotationId)) + return "annotationId: string expected"; + } + return null; + }; + + /** + * Creates a CreateAnnotationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.CreateAnnotationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.CreateAnnotationRequest} CreateAnnotationRequest + */ + CreateAnnotationRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.CreateAnnotationRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.CreateAnnotationRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.annotation != null) { + if (typeof object.annotation !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.CreateAnnotationRequest.annotation: object expected"); + message.annotation = $root.google.cloud.visionai.v1alpha1.Annotation.fromObject(object.annotation, long + 1); + } + if (object.annotationId != null) + message.annotationId = String(object.annotationId); + return message; + }; + + /** + * Creates a plain object from a CreateAnnotationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.CreateAnnotationRequest + * @static + * @param {google.cloud.visionai.v1alpha1.CreateAnnotationRequest} message CreateAnnotationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateAnnotationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.annotation = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.annotation != null && message.hasOwnProperty("annotation")) + object.annotation = $root.google.cloud.visionai.v1alpha1.Annotation.toObject(message.annotation, options); + if (message.annotationId != null && message.hasOwnProperty("annotationId")) { + object.annotationId = message.annotationId; + if (options.oneofs) + object._annotationId = "annotationId"; + } + return object; + }; + + /** + * Converts this CreateAnnotationRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.CreateAnnotationRequest + * @instance + * @returns {Object.} JSON object + */ + CreateAnnotationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateAnnotationRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.CreateAnnotationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateAnnotationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.CreateAnnotationRequest"; + }; + + return CreateAnnotationRequest; + })(); + + v1alpha1.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IAnnotation + * @property {string|null} [name] Annotation name + * @property {google.cloud.visionai.v1alpha1.IUserSpecifiedAnnotation|null} [userSpecifiedAnnotation] Annotation userSpecifiedAnnotation + */ + + /** + * Constructs a new Annotation. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.cloud.visionai.v1alpha1.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Annotation name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.Annotation + * @instance + */ + Annotation.prototype.name = ""; + + /** + * Annotation userSpecifiedAnnotation. + * @member {google.cloud.visionai.v1alpha1.IUserSpecifiedAnnotation|null|undefined} userSpecifiedAnnotation + * @memberof google.cloud.visionai.v1alpha1.Annotation + * @instance + */ + Annotation.prototype.userSpecifiedAnnotation = null; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.Annotation + * @static + * @param {google.cloud.visionai.v1alpha1.IAnnotation=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.cloud.visionai.v1alpha1.Annotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.Annotation + * @static + * @param {google.cloud.visionai.v1alpha1.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.userSpecifiedAnnotation != null && Object.hasOwnProperty.call(message, "userSpecifiedAnnotation")) + $root.google.cloud.visionai.v1alpha1.UserSpecifiedAnnotation.encode(message.userSpecifiedAnnotation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.Annotation + * @static + * @param {google.cloud.visionai.v1alpha1.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.userSpecifiedAnnotation = $root.google.cloud.visionai.v1alpha1.UserSpecifiedAnnotation.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.userSpecifiedAnnotation != null && message.hasOwnProperty("userSpecifiedAnnotation")) { + var error = $root.google.cloud.visionai.v1alpha1.UserSpecifiedAnnotation.verify(message.userSpecifiedAnnotation, long + 1); + if (error) + return "userSpecifiedAnnotation." + error; + } + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.Annotation) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.Annotation(); + if (object.name != null) + message.name = String(object.name); + if (object.userSpecifiedAnnotation != null) { + if (typeof object.userSpecifiedAnnotation !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Annotation.userSpecifiedAnnotation: object expected"); + message.userSpecifiedAnnotation = $root.google.cloud.visionai.v1alpha1.UserSpecifiedAnnotation.fromObject(object.userSpecifiedAnnotation, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.Annotation + * @static + * @param {google.cloud.visionai.v1alpha1.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.userSpecifiedAnnotation = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.userSpecifiedAnnotation != null && message.hasOwnProperty("userSpecifiedAnnotation")) + object.userSpecifiedAnnotation = $root.google.cloud.visionai.v1alpha1.UserSpecifiedAnnotation.toObject(message.userSpecifiedAnnotation, options); + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.Annotation"; + }; + + return Annotation; + })(); + + v1alpha1.UserSpecifiedAnnotation = (function() { + + /** + * Properties of a UserSpecifiedAnnotation. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IUserSpecifiedAnnotation + * @property {string|null} [key] UserSpecifiedAnnotation key + * @property {google.cloud.visionai.v1alpha1.IAnnotationValue|null} [value] UserSpecifiedAnnotation value + * @property {google.cloud.visionai.v1alpha1.IPartition|null} [partition] UserSpecifiedAnnotation partition + */ + + /** + * Constructs a new UserSpecifiedAnnotation. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a UserSpecifiedAnnotation. + * @implements IUserSpecifiedAnnotation + * @constructor + * @param {google.cloud.visionai.v1alpha1.IUserSpecifiedAnnotation=} [properties] Properties to set + */ + function UserSpecifiedAnnotation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UserSpecifiedAnnotation key. + * @member {string} key + * @memberof google.cloud.visionai.v1alpha1.UserSpecifiedAnnotation + * @instance + */ + UserSpecifiedAnnotation.prototype.key = ""; + + /** + * UserSpecifiedAnnotation value. + * @member {google.cloud.visionai.v1alpha1.IAnnotationValue|null|undefined} value + * @memberof google.cloud.visionai.v1alpha1.UserSpecifiedAnnotation + * @instance + */ + UserSpecifiedAnnotation.prototype.value = null; + + /** + * UserSpecifiedAnnotation partition. + * @member {google.cloud.visionai.v1alpha1.IPartition|null|undefined} partition + * @memberof google.cloud.visionai.v1alpha1.UserSpecifiedAnnotation + * @instance + */ + UserSpecifiedAnnotation.prototype.partition = null; + + /** + * Creates a new UserSpecifiedAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.UserSpecifiedAnnotation + * @static + * @param {google.cloud.visionai.v1alpha1.IUserSpecifiedAnnotation=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.UserSpecifiedAnnotation} UserSpecifiedAnnotation instance + */ + UserSpecifiedAnnotation.create = function create(properties) { + return new UserSpecifiedAnnotation(properties); + }; + + /** + * Encodes the specified UserSpecifiedAnnotation message. Does not implicitly {@link google.cloud.visionai.v1alpha1.UserSpecifiedAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.UserSpecifiedAnnotation + * @static + * @param {google.cloud.visionai.v1alpha1.IUserSpecifiedAnnotation} message UserSpecifiedAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserSpecifiedAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + $root.google.cloud.visionai.v1alpha1.AnnotationValue.encode(message.value, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.partition != null && Object.hasOwnProperty.call(message, "partition")) + $root.google.cloud.visionai.v1alpha1.Partition.encode(message.partition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UserSpecifiedAnnotation message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.UserSpecifiedAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.UserSpecifiedAnnotation + * @static + * @param {google.cloud.visionai.v1alpha1.IUserSpecifiedAnnotation} message UserSpecifiedAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserSpecifiedAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UserSpecifiedAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.UserSpecifiedAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.UserSpecifiedAnnotation} UserSpecifiedAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserSpecifiedAnnotation.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.UserSpecifiedAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.key = reader.string(); + break; + } + case 2: { + message.value = $root.google.cloud.visionai.v1alpha1.AnnotationValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.partition = $root.google.cloud.visionai.v1alpha1.Partition.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a UserSpecifiedAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.UserSpecifiedAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.UserSpecifiedAnnotation} UserSpecifiedAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserSpecifiedAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UserSpecifiedAnnotation message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.UserSpecifiedAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UserSpecifiedAnnotation.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; + if (message.value != null && message.hasOwnProperty("value")) { + var error = $root.google.cloud.visionai.v1alpha1.AnnotationValue.verify(message.value, long + 1); + if (error) + return "value." + error; + } + if (message.partition != null && message.hasOwnProperty("partition")) { + var error = $root.google.cloud.visionai.v1alpha1.Partition.verify(message.partition, long + 1); + if (error) + return "partition." + error; + } + return null; + }; + + /** + * Creates a UserSpecifiedAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.UserSpecifiedAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.UserSpecifiedAnnotation} UserSpecifiedAnnotation + */ + UserSpecifiedAnnotation.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.UserSpecifiedAnnotation) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.UserSpecifiedAnnotation(); + if (object.key != null) + message.key = String(object.key); + if (object.value != null) { + if (typeof object.value !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.UserSpecifiedAnnotation.value: object expected"); + message.value = $root.google.cloud.visionai.v1alpha1.AnnotationValue.fromObject(object.value, long + 1); + } + if (object.partition != null) { + if (typeof object.partition !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.UserSpecifiedAnnotation.partition: object expected"); + message.partition = $root.google.cloud.visionai.v1alpha1.Partition.fromObject(object.partition, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a UserSpecifiedAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.UserSpecifiedAnnotation + * @static + * @param {google.cloud.visionai.v1alpha1.UserSpecifiedAnnotation} message UserSpecifiedAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UserSpecifiedAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.key = ""; + object.value = null; + object.partition = null; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + if (message.value != null && message.hasOwnProperty("value")) + object.value = $root.google.cloud.visionai.v1alpha1.AnnotationValue.toObject(message.value, options); + if (message.partition != null && message.hasOwnProperty("partition")) + object.partition = $root.google.cloud.visionai.v1alpha1.Partition.toObject(message.partition, options); + return object; + }; + + /** + * Converts this UserSpecifiedAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.UserSpecifiedAnnotation + * @instance + * @returns {Object.} JSON object + */ + UserSpecifiedAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UserSpecifiedAnnotation + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.UserSpecifiedAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UserSpecifiedAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.UserSpecifiedAnnotation"; + }; + + return UserSpecifiedAnnotation; + })(); + + v1alpha1.GeoCoordinate = (function() { + + /** + * Properties of a GeoCoordinate. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IGeoCoordinate + * @property {number|null} [latitude] GeoCoordinate latitude + * @property {number|null} [longitude] GeoCoordinate longitude + */ + + /** + * Constructs a new GeoCoordinate. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a GeoCoordinate. + * @implements IGeoCoordinate + * @constructor + * @param {google.cloud.visionai.v1alpha1.IGeoCoordinate=} [properties] Properties to set + */ + function GeoCoordinate(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeoCoordinate latitude. + * @member {number} latitude + * @memberof google.cloud.visionai.v1alpha1.GeoCoordinate + * @instance + */ + GeoCoordinate.prototype.latitude = 0; + + /** + * GeoCoordinate longitude. + * @member {number} longitude + * @memberof google.cloud.visionai.v1alpha1.GeoCoordinate + * @instance + */ + GeoCoordinate.prototype.longitude = 0; + + /** + * Creates a new GeoCoordinate instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.GeoCoordinate + * @static + * @param {google.cloud.visionai.v1alpha1.IGeoCoordinate=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.GeoCoordinate} GeoCoordinate instance + */ + GeoCoordinate.create = function create(properties) { + return new GeoCoordinate(properties); + }; + + /** + * Encodes the specified GeoCoordinate message. Does not implicitly {@link google.cloud.visionai.v1alpha1.GeoCoordinate.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.GeoCoordinate + * @static + * @param {google.cloud.visionai.v1alpha1.IGeoCoordinate} message GeoCoordinate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeoCoordinate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.latitude != null && Object.hasOwnProperty.call(message, "latitude")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.latitude); + if (message.longitude != null && Object.hasOwnProperty.call(message, "longitude")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.longitude); + return writer; + }; + + /** + * Encodes the specified GeoCoordinate message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.GeoCoordinate.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.GeoCoordinate + * @static + * @param {google.cloud.visionai.v1alpha1.IGeoCoordinate} message GeoCoordinate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeoCoordinate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeoCoordinate message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.GeoCoordinate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.GeoCoordinate} GeoCoordinate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeoCoordinate.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.GeoCoordinate(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.latitude = reader.double(); + break; + } + case 2: { + message.longitude = reader.double(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GeoCoordinate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.GeoCoordinate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.GeoCoordinate} GeoCoordinate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeoCoordinate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeoCoordinate message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.GeoCoordinate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeoCoordinate.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.latitude != null && message.hasOwnProperty("latitude")) + if (typeof message.latitude !== "number") + return "latitude: number expected"; + if (message.longitude != null && message.hasOwnProperty("longitude")) + if (typeof message.longitude !== "number") + return "longitude: number expected"; + return null; + }; + + /** + * Creates a GeoCoordinate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.GeoCoordinate + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.GeoCoordinate} GeoCoordinate + */ + GeoCoordinate.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.GeoCoordinate) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.GeoCoordinate(); + if (object.latitude != null) + message.latitude = Number(object.latitude); + if (object.longitude != null) + message.longitude = Number(object.longitude); + return message; + }; + + /** + * Creates a plain object from a GeoCoordinate message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.GeoCoordinate + * @static + * @param {google.cloud.visionai.v1alpha1.GeoCoordinate} message GeoCoordinate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeoCoordinate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.latitude = 0; + object.longitude = 0; + } + if (message.latitude != null && message.hasOwnProperty("latitude")) + object.latitude = options.json && !isFinite(message.latitude) ? String(message.latitude) : message.latitude; + if (message.longitude != null && message.hasOwnProperty("longitude")) + object.longitude = options.json && !isFinite(message.longitude) ? String(message.longitude) : message.longitude; + return object; + }; + + /** + * Converts this GeoCoordinate to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.GeoCoordinate + * @instance + * @returns {Object.} JSON object + */ + GeoCoordinate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeoCoordinate + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.GeoCoordinate + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeoCoordinate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.GeoCoordinate"; + }; + + return GeoCoordinate; + })(); + + v1alpha1.AnnotationValue = (function() { + + /** + * Properties of an AnnotationValue. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IAnnotationValue + * @property {number|Long|null} [intValue] AnnotationValue intValue + * @property {number|null} [floatValue] AnnotationValue floatValue + * @property {string|null} [strValue] AnnotationValue strValue + * @property {string|null} [datetimeValue] AnnotationValue datetimeValue + * @property {google.cloud.visionai.v1alpha1.IGeoCoordinate|null} [geoCoordinate] AnnotationValue geoCoordinate + * @property {google.protobuf.IAny|null} [protoAnyValue] AnnotationValue protoAnyValue + * @property {boolean|null} [boolValue] AnnotationValue boolValue + * @property {google.protobuf.IStruct|null} [customizedStructDataValue] AnnotationValue customizedStructDataValue + */ + + /** + * Constructs a new AnnotationValue. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents an AnnotationValue. + * @implements IAnnotationValue + * @constructor + * @param {google.cloud.visionai.v1alpha1.IAnnotationValue=} [properties] Properties to set + */ + function AnnotationValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnnotationValue intValue. + * @member {number|Long|null|undefined} intValue + * @memberof google.cloud.visionai.v1alpha1.AnnotationValue + * @instance + */ + AnnotationValue.prototype.intValue = null; + + /** + * AnnotationValue floatValue. + * @member {number|null|undefined} floatValue + * @memberof google.cloud.visionai.v1alpha1.AnnotationValue + * @instance + */ + AnnotationValue.prototype.floatValue = null; + + /** + * AnnotationValue strValue. + * @member {string|null|undefined} strValue + * @memberof google.cloud.visionai.v1alpha1.AnnotationValue + * @instance + */ + AnnotationValue.prototype.strValue = null; + + /** + * AnnotationValue datetimeValue. + * @member {string|null|undefined} datetimeValue + * @memberof google.cloud.visionai.v1alpha1.AnnotationValue + * @instance + */ + AnnotationValue.prototype.datetimeValue = null; + + /** + * AnnotationValue geoCoordinate. + * @member {google.cloud.visionai.v1alpha1.IGeoCoordinate|null|undefined} geoCoordinate + * @memberof google.cloud.visionai.v1alpha1.AnnotationValue + * @instance + */ + AnnotationValue.prototype.geoCoordinate = null; + + /** + * AnnotationValue protoAnyValue. + * @member {google.protobuf.IAny|null|undefined} protoAnyValue + * @memberof google.cloud.visionai.v1alpha1.AnnotationValue + * @instance + */ + AnnotationValue.prototype.protoAnyValue = null; + + /** + * AnnotationValue boolValue. + * @member {boolean|null|undefined} boolValue + * @memberof google.cloud.visionai.v1alpha1.AnnotationValue + * @instance + */ + AnnotationValue.prototype.boolValue = null; + + /** + * AnnotationValue customizedStructDataValue. + * @member {google.protobuf.IStruct|null|undefined} customizedStructDataValue + * @memberof google.cloud.visionai.v1alpha1.AnnotationValue + * @instance + */ + AnnotationValue.prototype.customizedStructDataValue = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AnnotationValue value. + * @member {"intValue"|"floatValue"|"strValue"|"datetimeValue"|"geoCoordinate"|"protoAnyValue"|"boolValue"|"customizedStructDataValue"|undefined} value + * @memberof google.cloud.visionai.v1alpha1.AnnotationValue + * @instance + */ + Object.defineProperty(AnnotationValue.prototype, "value", { + get: $util.oneOfGetter($oneOfFields = ["intValue", "floatValue", "strValue", "datetimeValue", "geoCoordinate", "protoAnyValue", "boolValue", "customizedStructDataValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AnnotationValue instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.AnnotationValue + * @static + * @param {google.cloud.visionai.v1alpha1.IAnnotationValue=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.AnnotationValue} AnnotationValue instance + */ + AnnotationValue.create = function create(properties) { + return new AnnotationValue(properties); + }; + + /** + * Encodes the specified AnnotationValue message. Does not implicitly {@link google.cloud.visionai.v1alpha1.AnnotationValue.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.AnnotationValue + * @static + * @param {google.cloud.visionai.v1alpha1.IAnnotationValue} message AnnotationValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotationValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.intValue != null && Object.hasOwnProperty.call(message, "intValue")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.intValue); + if (message.floatValue != null && Object.hasOwnProperty.call(message, "floatValue")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.floatValue); + if (message.strValue != null && Object.hasOwnProperty.call(message, "strValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.strValue); + if (message.datetimeValue != null && Object.hasOwnProperty.call(message, "datetimeValue")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.datetimeValue); + if (message.geoCoordinate != null && Object.hasOwnProperty.call(message, "geoCoordinate")) + $root.google.cloud.visionai.v1alpha1.GeoCoordinate.encode(message.geoCoordinate, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.protoAnyValue != null && Object.hasOwnProperty.call(message, "protoAnyValue")) + $root.google.protobuf.Any.encode(message.protoAnyValue, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.boolValue); + if (message.customizedStructDataValue != null && Object.hasOwnProperty.call(message, "customizedStructDataValue")) + $root.google.protobuf.Struct.encode(message.customizedStructDataValue, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnnotationValue message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.AnnotationValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.AnnotationValue + * @static + * @param {google.cloud.visionai.v1alpha1.IAnnotationValue} message AnnotationValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotationValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotationValue message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.AnnotationValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.AnnotationValue} AnnotationValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotationValue.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.AnnotationValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.intValue = reader.int64(); + break; + } + case 2: { + message.floatValue = reader.float(); + break; + } + case 3: { + message.strValue = reader.string(); + break; + } + case 5: { + message.datetimeValue = reader.string(); + break; + } + case 7: { + message.geoCoordinate = $root.google.cloud.visionai.v1alpha1.GeoCoordinate.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 8: { + message.protoAnyValue = $root.google.protobuf.Any.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 9: { + message.boolValue = reader.bool(); + break; + } + case 10: { + message.customizedStructDataValue = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotationValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.AnnotationValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.AnnotationValue} AnnotationValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotationValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotationValue message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.AnnotationValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotationValue.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.intValue != null && message.hasOwnProperty("intValue")) { + properties.value = 1; + if (!$util.isInteger(message.intValue) && !(message.intValue && $util.isInteger(message.intValue.low) && $util.isInteger(message.intValue.high))) + return "intValue: integer|Long expected"; + } + if (message.floatValue != null && message.hasOwnProperty("floatValue")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + if (typeof message.floatValue !== "number") + return "floatValue: number expected"; + } + if (message.strValue != null && message.hasOwnProperty("strValue")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + if (!$util.isString(message.strValue)) + return "strValue: string expected"; + } + if (message.datetimeValue != null && message.hasOwnProperty("datetimeValue")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + if (!$util.isString(message.datetimeValue)) + return "datetimeValue: string expected"; + } + if (message.geoCoordinate != null && message.hasOwnProperty("geoCoordinate")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.cloud.visionai.v1alpha1.GeoCoordinate.verify(message.geoCoordinate, long + 1); + if (error) + return "geoCoordinate." + error; + } + } + if (message.protoAnyValue != null && message.hasOwnProperty("protoAnyValue")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.protobuf.Any.verify(message.protoAnyValue, long + 1); + if (error) + return "protoAnyValue." + error; + } + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + if (typeof message.boolValue !== "boolean") + return "boolValue: boolean expected"; + } + if (message.customizedStructDataValue != null && message.hasOwnProperty("customizedStructDataValue")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.protobuf.Struct.verify(message.customizedStructDataValue, long + 1); + if (error) + return "customizedStructDataValue." + error; + } + } + return null; + }; + + /** + * Creates an AnnotationValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.AnnotationValue + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.AnnotationValue} AnnotationValue + */ + AnnotationValue.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.AnnotationValue) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.AnnotationValue(); + if (object.intValue != null) + if ($util.Long) + (message.intValue = $util.Long.fromValue(object.intValue)).unsigned = false; + else if (typeof object.intValue === "string") + message.intValue = parseInt(object.intValue, 10); + else if (typeof object.intValue === "number") + message.intValue = object.intValue; + else if (typeof object.intValue === "object") + message.intValue = new $util.LongBits(object.intValue.low >>> 0, object.intValue.high >>> 0).toNumber(); + if (object.floatValue != null) + message.floatValue = Number(object.floatValue); + if (object.strValue != null) + message.strValue = String(object.strValue); + if (object.datetimeValue != null) + message.datetimeValue = String(object.datetimeValue); + if (object.geoCoordinate != null) { + if (typeof object.geoCoordinate !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.AnnotationValue.geoCoordinate: object expected"); + message.geoCoordinate = $root.google.cloud.visionai.v1alpha1.GeoCoordinate.fromObject(object.geoCoordinate, long + 1); + } + if (object.protoAnyValue != null) { + if (typeof object.protoAnyValue !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.AnnotationValue.protoAnyValue: object expected"); + message.protoAnyValue = $root.google.protobuf.Any.fromObject(object.protoAnyValue, long + 1); + } + if (object.boolValue != null) + message.boolValue = Boolean(object.boolValue); + if (object.customizedStructDataValue != null) { + if (typeof object.customizedStructDataValue !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.AnnotationValue.customizedStructDataValue: object expected"); + message.customizedStructDataValue = $root.google.protobuf.Struct.fromObject(object.customizedStructDataValue, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an AnnotationValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.AnnotationValue + * @static + * @param {google.cloud.visionai.v1alpha1.AnnotationValue} message AnnotationValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotationValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.intValue != null && message.hasOwnProperty("intValue")) { + if (typeof message.intValue === "number") + object.intValue = options.longs === String ? String(message.intValue) : message.intValue; + else + object.intValue = options.longs === String ? $util.Long.prototype.toString.call(message.intValue) : options.longs === Number ? new $util.LongBits(message.intValue.low >>> 0, message.intValue.high >>> 0).toNumber() : message.intValue; + if (options.oneofs) + object.value = "intValue"; + } + if (message.floatValue != null && message.hasOwnProperty("floatValue")) { + object.floatValue = options.json && !isFinite(message.floatValue) ? String(message.floatValue) : message.floatValue; + if (options.oneofs) + object.value = "floatValue"; + } + if (message.strValue != null && message.hasOwnProperty("strValue")) { + object.strValue = message.strValue; + if (options.oneofs) + object.value = "strValue"; + } + if (message.datetimeValue != null && message.hasOwnProperty("datetimeValue")) { + object.datetimeValue = message.datetimeValue; + if (options.oneofs) + object.value = "datetimeValue"; + } + if (message.geoCoordinate != null && message.hasOwnProperty("geoCoordinate")) { + object.geoCoordinate = $root.google.cloud.visionai.v1alpha1.GeoCoordinate.toObject(message.geoCoordinate, options); + if (options.oneofs) + object.value = "geoCoordinate"; + } + if (message.protoAnyValue != null && message.hasOwnProperty("protoAnyValue")) { + object.protoAnyValue = $root.google.protobuf.Any.toObject(message.protoAnyValue, options); + if (options.oneofs) + object.value = "protoAnyValue"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + object.boolValue = message.boolValue; + if (options.oneofs) + object.value = "boolValue"; + } + if (message.customizedStructDataValue != null && message.hasOwnProperty("customizedStructDataValue")) { + object.customizedStructDataValue = $root.google.protobuf.Struct.toObject(message.customizedStructDataValue, options); + if (options.oneofs) + object.value = "customizedStructDataValue"; + } + return object; + }; + + /** + * Converts this AnnotationValue to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.AnnotationValue + * @instance + * @returns {Object.} JSON object + */ + AnnotationValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnnotationValue + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.AnnotationValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnnotationValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.AnnotationValue"; + }; + + return AnnotationValue; + })(); + + v1alpha1.ListAnnotationsRequest = (function() { + + /** + * Properties of a ListAnnotationsRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IListAnnotationsRequest + * @property {string|null} [parent] ListAnnotationsRequest parent + * @property {number|null} [pageSize] ListAnnotationsRequest pageSize + * @property {string|null} [pageToken] ListAnnotationsRequest pageToken + * @property {string|null} [filter] ListAnnotationsRequest filter + */ + + /** + * Constructs a new ListAnnotationsRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a ListAnnotationsRequest. + * @implements IListAnnotationsRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IListAnnotationsRequest=} [properties] Properties to set + */ + function ListAnnotationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAnnotationsRequest parent. + * @member {string} parent + * @memberof google.cloud.visionai.v1alpha1.ListAnnotationsRequest + * @instance + */ + ListAnnotationsRequest.prototype.parent = ""; + + /** + * ListAnnotationsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.visionai.v1alpha1.ListAnnotationsRequest + * @instance + */ + ListAnnotationsRequest.prototype.pageSize = 0; + + /** + * ListAnnotationsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.visionai.v1alpha1.ListAnnotationsRequest + * @instance + */ + ListAnnotationsRequest.prototype.pageToken = ""; + + /** + * ListAnnotationsRequest filter. + * @member {string} filter + * @memberof google.cloud.visionai.v1alpha1.ListAnnotationsRequest + * @instance + */ + ListAnnotationsRequest.prototype.filter = ""; + + /** + * Creates a new ListAnnotationsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ListAnnotationsRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IListAnnotationsRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ListAnnotationsRequest} ListAnnotationsRequest instance + */ + ListAnnotationsRequest.create = function create(properties) { + return new ListAnnotationsRequest(properties); + }; + + /** + * Encodes the specified ListAnnotationsRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListAnnotationsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ListAnnotationsRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IListAnnotationsRequest} message ListAnnotationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAnnotationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListAnnotationsRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListAnnotationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListAnnotationsRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IListAnnotationsRequest} message ListAnnotationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAnnotationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAnnotationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ListAnnotationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ListAnnotationsRequest} ListAnnotationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAnnotationsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ListAnnotationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListAnnotationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListAnnotationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ListAnnotationsRequest} ListAnnotationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAnnotationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAnnotationsRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ListAnnotationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAnnotationsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListAnnotationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ListAnnotationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ListAnnotationsRequest} ListAnnotationsRequest + */ + ListAnnotationsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ListAnnotationsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ListAnnotationsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListAnnotationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ListAnnotationsRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ListAnnotationsRequest} message ListAnnotationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAnnotationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListAnnotationsRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ListAnnotationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListAnnotationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAnnotationsRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ListAnnotationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAnnotationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ListAnnotationsRequest"; + }; + + return ListAnnotationsRequest; + })(); + + v1alpha1.ListAnnotationsResponse = (function() { + + /** + * Properties of a ListAnnotationsResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IListAnnotationsResponse + * @property {Array.|null} [annotations] ListAnnotationsResponse annotations + * @property {string|null} [nextPageToken] ListAnnotationsResponse nextPageToken + */ + + /** + * Constructs a new ListAnnotationsResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a ListAnnotationsResponse. + * @implements IListAnnotationsResponse + * @constructor + * @param {google.cloud.visionai.v1alpha1.IListAnnotationsResponse=} [properties] Properties to set + */ + function ListAnnotationsResponse(properties) { + this.annotations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAnnotationsResponse annotations. + * @member {Array.} annotations + * @memberof google.cloud.visionai.v1alpha1.ListAnnotationsResponse + * @instance + */ + ListAnnotationsResponse.prototype.annotations = $util.emptyArray; + + /** + * ListAnnotationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.visionai.v1alpha1.ListAnnotationsResponse + * @instance + */ + ListAnnotationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListAnnotationsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ListAnnotationsResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IListAnnotationsResponse=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ListAnnotationsResponse} ListAnnotationsResponse instance + */ + ListAnnotationsResponse.create = function create(properties) { + return new ListAnnotationsResponse(properties); + }; + + /** + * Encodes the specified ListAnnotationsResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListAnnotationsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ListAnnotationsResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IListAnnotationsResponse} message ListAnnotationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAnnotationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotations != null && message.annotations.length) + for (var i = 0; i < message.annotations.length; ++i) + $root.google.cloud.visionai.v1alpha1.Annotation.encode(message.annotations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListAnnotationsResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListAnnotationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListAnnotationsResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IListAnnotationsResponse} message ListAnnotationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAnnotationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAnnotationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ListAnnotationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ListAnnotationsResponse} ListAnnotationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAnnotationsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ListAnnotationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.annotations && message.annotations.length)) + message.annotations = []; + message.annotations.push($root.google.cloud.visionai.v1alpha1.Annotation.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListAnnotationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListAnnotationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ListAnnotationsResponse} ListAnnotationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAnnotationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAnnotationsResponse message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ListAnnotationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAnnotationsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!Array.isArray(message.annotations)) + return "annotations: array expected"; + for (var i = 0; i < message.annotations.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.Annotation.verify(message.annotations[i], long + 1); + if (error) + return "annotations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListAnnotationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ListAnnotationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ListAnnotationsResponse} ListAnnotationsResponse + */ + ListAnnotationsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ListAnnotationsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ListAnnotationsResponse(); + if (object.annotations) { + if (!Array.isArray(object.annotations)) + throw TypeError(".google.cloud.visionai.v1alpha1.ListAnnotationsResponse.annotations: array expected"); + message.annotations = []; + for (var i = 0; i < object.annotations.length; ++i) { + if (typeof object.annotations[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ListAnnotationsResponse.annotations: object expected"); + message.annotations[i] = $root.google.cloud.visionai.v1alpha1.Annotation.fromObject(object.annotations[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListAnnotationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ListAnnotationsResponse + * @static + * @param {google.cloud.visionai.v1alpha1.ListAnnotationsResponse} message ListAnnotationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAnnotationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.annotations && message.annotations.length) { + object.annotations = []; + for (var j = 0; j < message.annotations.length; ++j) + object.annotations[j] = $root.google.cloud.visionai.v1alpha1.Annotation.toObject(message.annotations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListAnnotationsResponse to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ListAnnotationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListAnnotationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAnnotationsResponse + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ListAnnotationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAnnotationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ListAnnotationsResponse"; + }; + + return ListAnnotationsResponse; + })(); + + v1alpha1.GetAnnotationRequest = (function() { + + /** + * Properties of a GetAnnotationRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IGetAnnotationRequest + * @property {string|null} [name] GetAnnotationRequest name + */ + + /** + * Constructs a new GetAnnotationRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a GetAnnotationRequest. + * @implements IGetAnnotationRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IGetAnnotationRequest=} [properties] Properties to set + */ + function GetAnnotationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetAnnotationRequest name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.GetAnnotationRequest + * @instance + */ + GetAnnotationRequest.prototype.name = ""; + + /** + * Creates a new GetAnnotationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.GetAnnotationRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IGetAnnotationRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.GetAnnotationRequest} GetAnnotationRequest instance + */ + GetAnnotationRequest.create = function create(properties) { + return new GetAnnotationRequest(properties); + }; + + /** + * Encodes the specified GetAnnotationRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetAnnotationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.GetAnnotationRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IGetAnnotationRequest} message GetAnnotationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAnnotationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetAnnotationRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetAnnotationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.GetAnnotationRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IGetAnnotationRequest} message GetAnnotationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAnnotationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetAnnotationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.GetAnnotationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.GetAnnotationRequest} GetAnnotationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAnnotationRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.GetAnnotationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetAnnotationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.GetAnnotationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.GetAnnotationRequest} GetAnnotationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAnnotationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetAnnotationRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.GetAnnotationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetAnnotationRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetAnnotationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.GetAnnotationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.GetAnnotationRequest} GetAnnotationRequest + */ + GetAnnotationRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.GetAnnotationRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.GetAnnotationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetAnnotationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.GetAnnotationRequest + * @static + * @param {google.cloud.visionai.v1alpha1.GetAnnotationRequest} message GetAnnotationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetAnnotationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetAnnotationRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.GetAnnotationRequest + * @instance + * @returns {Object.} JSON object + */ + GetAnnotationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetAnnotationRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.GetAnnotationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetAnnotationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.GetAnnotationRequest"; + }; + + return GetAnnotationRequest; + })(); + + v1alpha1.UpdateAnnotationRequest = (function() { + + /** + * Properties of an UpdateAnnotationRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IUpdateAnnotationRequest + * @property {google.cloud.visionai.v1alpha1.IAnnotation|null} [annotation] UpdateAnnotationRequest annotation + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateAnnotationRequest updateMask + */ + + /** + * Constructs a new UpdateAnnotationRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents an UpdateAnnotationRequest. + * @implements IUpdateAnnotationRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IUpdateAnnotationRequest=} [properties] Properties to set + */ + function UpdateAnnotationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateAnnotationRequest annotation. + * @member {google.cloud.visionai.v1alpha1.IAnnotation|null|undefined} annotation + * @memberof google.cloud.visionai.v1alpha1.UpdateAnnotationRequest + * @instance + */ + UpdateAnnotationRequest.prototype.annotation = null; + + /** + * UpdateAnnotationRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.visionai.v1alpha1.UpdateAnnotationRequest + * @instance + */ + UpdateAnnotationRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateAnnotationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.UpdateAnnotationRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IUpdateAnnotationRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.UpdateAnnotationRequest} UpdateAnnotationRequest instance + */ + UpdateAnnotationRequest.create = function create(properties) { + return new UpdateAnnotationRequest(properties); + }; + + /** + * Encodes the specified UpdateAnnotationRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateAnnotationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.UpdateAnnotationRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IUpdateAnnotationRequest} message UpdateAnnotationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAnnotationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && Object.hasOwnProperty.call(message, "annotation")) + $root.google.cloud.visionai.v1alpha1.Annotation.encode(message.annotation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateAnnotationRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateAnnotationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.UpdateAnnotationRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IUpdateAnnotationRequest} message UpdateAnnotationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAnnotationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateAnnotationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.UpdateAnnotationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.UpdateAnnotationRequest} UpdateAnnotationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAnnotationRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.UpdateAnnotationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.annotation = $root.google.cloud.visionai.v1alpha1.Annotation.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateAnnotationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.UpdateAnnotationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.UpdateAnnotationRequest} UpdateAnnotationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAnnotationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateAnnotationRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.UpdateAnnotationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateAnnotationRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + var error = $root.google.cloud.visionai.v1alpha1.Annotation.verify(message.annotation, long + 1); + if (error) + return "annotation." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateAnnotationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.UpdateAnnotationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.UpdateAnnotationRequest} UpdateAnnotationRequest + */ + UpdateAnnotationRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.UpdateAnnotationRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.UpdateAnnotationRequest(); + if (object.annotation != null) { + if (typeof object.annotation !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.UpdateAnnotationRequest.annotation: object expected"); + message.annotation = $root.google.cloud.visionai.v1alpha1.Annotation.fromObject(object.annotation, long + 1); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.UpdateAnnotationRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an UpdateAnnotationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.UpdateAnnotationRequest + * @static + * @param {google.cloud.visionai.v1alpha1.UpdateAnnotationRequest} message UpdateAnnotationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateAnnotationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.annotation = null; + object.updateMask = null; + } + if (message.annotation != null && message.hasOwnProperty("annotation")) + object.annotation = $root.google.cloud.visionai.v1alpha1.Annotation.toObject(message.annotation, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateAnnotationRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.UpdateAnnotationRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateAnnotationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateAnnotationRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.UpdateAnnotationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateAnnotationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.UpdateAnnotationRequest"; + }; + + return UpdateAnnotationRequest; + })(); + + v1alpha1.DeleteAnnotationRequest = (function() { + + /** + * Properties of a DeleteAnnotationRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IDeleteAnnotationRequest + * @property {string|null} [name] DeleteAnnotationRequest name + */ + + /** + * Constructs a new DeleteAnnotationRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a DeleteAnnotationRequest. + * @implements IDeleteAnnotationRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IDeleteAnnotationRequest=} [properties] Properties to set + */ + function DeleteAnnotationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteAnnotationRequest name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.DeleteAnnotationRequest + * @instance + */ + DeleteAnnotationRequest.prototype.name = ""; + + /** + * Creates a new DeleteAnnotationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.DeleteAnnotationRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IDeleteAnnotationRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.DeleteAnnotationRequest} DeleteAnnotationRequest instance + */ + DeleteAnnotationRequest.create = function create(properties) { + return new DeleteAnnotationRequest(properties); + }; + + /** + * Encodes the specified DeleteAnnotationRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteAnnotationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.DeleteAnnotationRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IDeleteAnnotationRequest} message DeleteAnnotationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAnnotationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteAnnotationRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteAnnotationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.DeleteAnnotationRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IDeleteAnnotationRequest} message DeleteAnnotationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAnnotationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteAnnotationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.DeleteAnnotationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.DeleteAnnotationRequest} DeleteAnnotationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAnnotationRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.DeleteAnnotationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteAnnotationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.DeleteAnnotationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.DeleteAnnotationRequest} DeleteAnnotationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAnnotationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteAnnotationRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.DeleteAnnotationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteAnnotationRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteAnnotationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.DeleteAnnotationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.DeleteAnnotationRequest} DeleteAnnotationRequest + */ + DeleteAnnotationRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.DeleteAnnotationRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.DeleteAnnotationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteAnnotationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.DeleteAnnotationRequest + * @static + * @param {google.cloud.visionai.v1alpha1.DeleteAnnotationRequest} message DeleteAnnotationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteAnnotationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteAnnotationRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.DeleteAnnotationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteAnnotationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteAnnotationRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.DeleteAnnotationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteAnnotationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.DeleteAnnotationRequest"; + }; + + return DeleteAnnotationRequest; + })(); + + v1alpha1.CreateSearchConfigRequest = (function() { + + /** + * Properties of a CreateSearchConfigRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface ICreateSearchConfigRequest + * @property {string|null} [parent] CreateSearchConfigRequest parent + * @property {google.cloud.visionai.v1alpha1.ISearchConfig|null} [searchConfig] CreateSearchConfigRequest searchConfig + * @property {string|null} [searchConfigId] CreateSearchConfigRequest searchConfigId + */ + + /** + * Constructs a new CreateSearchConfigRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a CreateSearchConfigRequest. + * @implements ICreateSearchConfigRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.ICreateSearchConfigRequest=} [properties] Properties to set + */ + function CreateSearchConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateSearchConfigRequest parent. + * @member {string} parent + * @memberof google.cloud.visionai.v1alpha1.CreateSearchConfigRequest + * @instance + */ + CreateSearchConfigRequest.prototype.parent = ""; + + /** + * CreateSearchConfigRequest searchConfig. + * @member {google.cloud.visionai.v1alpha1.ISearchConfig|null|undefined} searchConfig + * @memberof google.cloud.visionai.v1alpha1.CreateSearchConfigRequest + * @instance + */ + CreateSearchConfigRequest.prototype.searchConfig = null; + + /** + * CreateSearchConfigRequest searchConfigId. + * @member {string} searchConfigId + * @memberof google.cloud.visionai.v1alpha1.CreateSearchConfigRequest + * @instance + */ + CreateSearchConfigRequest.prototype.searchConfigId = ""; + + /** + * Creates a new CreateSearchConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.CreateSearchConfigRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ICreateSearchConfigRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.CreateSearchConfigRequest} CreateSearchConfigRequest instance + */ + CreateSearchConfigRequest.create = function create(properties) { + return new CreateSearchConfigRequest(properties); + }; + + /** + * Encodes the specified CreateSearchConfigRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateSearchConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.CreateSearchConfigRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ICreateSearchConfigRequest} message CreateSearchConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSearchConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.searchConfig != null && Object.hasOwnProperty.call(message, "searchConfig")) + $root.google.cloud.visionai.v1alpha1.SearchConfig.encode(message.searchConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.searchConfigId != null && Object.hasOwnProperty.call(message, "searchConfigId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.searchConfigId); + return writer; + }; + + /** + * Encodes the specified CreateSearchConfigRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.CreateSearchConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.CreateSearchConfigRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ICreateSearchConfigRequest} message CreateSearchConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSearchConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateSearchConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.CreateSearchConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.CreateSearchConfigRequest} CreateSearchConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSearchConfigRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.CreateSearchConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.searchConfig = $root.google.cloud.visionai.v1alpha1.SearchConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.searchConfigId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreateSearchConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.CreateSearchConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.CreateSearchConfigRequest} CreateSearchConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSearchConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateSearchConfigRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.CreateSearchConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateSearchConfigRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.searchConfig != null && message.hasOwnProperty("searchConfig")) { + var error = $root.google.cloud.visionai.v1alpha1.SearchConfig.verify(message.searchConfig, long + 1); + if (error) + return "searchConfig." + error; + } + if (message.searchConfigId != null && message.hasOwnProperty("searchConfigId")) + if (!$util.isString(message.searchConfigId)) + return "searchConfigId: string expected"; + return null; + }; + + /** + * Creates a CreateSearchConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.CreateSearchConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.CreateSearchConfigRequest} CreateSearchConfigRequest + */ + CreateSearchConfigRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.CreateSearchConfigRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.CreateSearchConfigRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.searchConfig != null) { + if (typeof object.searchConfig !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.CreateSearchConfigRequest.searchConfig: object expected"); + message.searchConfig = $root.google.cloud.visionai.v1alpha1.SearchConfig.fromObject(object.searchConfig, long + 1); + } + if (object.searchConfigId != null) + message.searchConfigId = String(object.searchConfigId); + return message; + }; + + /** + * Creates a plain object from a CreateSearchConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.CreateSearchConfigRequest + * @static + * @param {google.cloud.visionai.v1alpha1.CreateSearchConfigRequest} message CreateSearchConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateSearchConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.searchConfig = null; + object.searchConfigId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.searchConfig != null && message.hasOwnProperty("searchConfig")) + object.searchConfig = $root.google.cloud.visionai.v1alpha1.SearchConfig.toObject(message.searchConfig, options); + if (message.searchConfigId != null && message.hasOwnProperty("searchConfigId")) + object.searchConfigId = message.searchConfigId; + return object; + }; + + /** + * Converts this CreateSearchConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.CreateSearchConfigRequest + * @instance + * @returns {Object.} JSON object + */ + CreateSearchConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateSearchConfigRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.CreateSearchConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateSearchConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.CreateSearchConfigRequest"; + }; + + return CreateSearchConfigRequest; + })(); + + v1alpha1.UpdateSearchConfigRequest = (function() { + + /** + * Properties of an UpdateSearchConfigRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IUpdateSearchConfigRequest + * @property {google.cloud.visionai.v1alpha1.ISearchConfig|null} [searchConfig] UpdateSearchConfigRequest searchConfig + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSearchConfigRequest updateMask + */ + + /** + * Constructs a new UpdateSearchConfigRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents an UpdateSearchConfigRequest. + * @implements IUpdateSearchConfigRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IUpdateSearchConfigRequest=} [properties] Properties to set + */ + function UpdateSearchConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateSearchConfigRequest searchConfig. + * @member {google.cloud.visionai.v1alpha1.ISearchConfig|null|undefined} searchConfig + * @memberof google.cloud.visionai.v1alpha1.UpdateSearchConfigRequest + * @instance + */ + UpdateSearchConfigRequest.prototype.searchConfig = null; + + /** + * UpdateSearchConfigRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.visionai.v1alpha1.UpdateSearchConfigRequest + * @instance + */ + UpdateSearchConfigRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateSearchConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.UpdateSearchConfigRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IUpdateSearchConfigRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.UpdateSearchConfigRequest} UpdateSearchConfigRequest instance + */ + UpdateSearchConfigRequest.create = function create(properties) { + return new UpdateSearchConfigRequest(properties); + }; + + /** + * Encodes the specified UpdateSearchConfigRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateSearchConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.UpdateSearchConfigRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IUpdateSearchConfigRequest} message UpdateSearchConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSearchConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.searchConfig != null && Object.hasOwnProperty.call(message, "searchConfig")) + $root.google.cloud.visionai.v1alpha1.SearchConfig.encode(message.searchConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateSearchConfigRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.UpdateSearchConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.UpdateSearchConfigRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IUpdateSearchConfigRequest} message UpdateSearchConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSearchConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateSearchConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.UpdateSearchConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.UpdateSearchConfigRequest} UpdateSearchConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSearchConfigRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.UpdateSearchConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.searchConfig = $root.google.cloud.visionai.v1alpha1.SearchConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateSearchConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.UpdateSearchConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.UpdateSearchConfigRequest} UpdateSearchConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSearchConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateSearchConfigRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.UpdateSearchConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateSearchConfigRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.searchConfig != null && message.hasOwnProperty("searchConfig")) { + var error = $root.google.cloud.visionai.v1alpha1.SearchConfig.verify(message.searchConfig, long + 1); + if (error) + return "searchConfig." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateSearchConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.UpdateSearchConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.UpdateSearchConfigRequest} UpdateSearchConfigRequest + */ + UpdateSearchConfigRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.UpdateSearchConfigRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.UpdateSearchConfigRequest(); + if (object.searchConfig != null) { + if (typeof object.searchConfig !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.UpdateSearchConfigRequest.searchConfig: object expected"); + message.searchConfig = $root.google.cloud.visionai.v1alpha1.SearchConfig.fromObject(object.searchConfig, long + 1); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.UpdateSearchConfigRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an UpdateSearchConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.UpdateSearchConfigRequest + * @static + * @param {google.cloud.visionai.v1alpha1.UpdateSearchConfigRequest} message UpdateSearchConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateSearchConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.searchConfig = null; + object.updateMask = null; + } + if (message.searchConfig != null && message.hasOwnProperty("searchConfig")) + object.searchConfig = $root.google.cloud.visionai.v1alpha1.SearchConfig.toObject(message.searchConfig, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateSearchConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.UpdateSearchConfigRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateSearchConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateSearchConfigRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.UpdateSearchConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateSearchConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.UpdateSearchConfigRequest"; + }; + + return UpdateSearchConfigRequest; + })(); + + v1alpha1.GetSearchConfigRequest = (function() { + + /** + * Properties of a GetSearchConfigRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IGetSearchConfigRequest + * @property {string|null} [name] GetSearchConfigRequest name + */ + + /** + * Constructs a new GetSearchConfigRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a GetSearchConfigRequest. + * @implements IGetSearchConfigRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IGetSearchConfigRequest=} [properties] Properties to set + */ + function GetSearchConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetSearchConfigRequest name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.GetSearchConfigRequest + * @instance + */ + GetSearchConfigRequest.prototype.name = ""; + + /** + * Creates a new GetSearchConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.GetSearchConfigRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IGetSearchConfigRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.GetSearchConfigRequest} GetSearchConfigRequest instance + */ + GetSearchConfigRequest.create = function create(properties) { + return new GetSearchConfigRequest(properties); + }; + + /** + * Encodes the specified GetSearchConfigRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetSearchConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.GetSearchConfigRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IGetSearchConfigRequest} message GetSearchConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSearchConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetSearchConfigRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.GetSearchConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.GetSearchConfigRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IGetSearchConfigRequest} message GetSearchConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSearchConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSearchConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.GetSearchConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.GetSearchConfigRequest} GetSearchConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSearchConfigRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.GetSearchConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetSearchConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.GetSearchConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.GetSearchConfigRequest} GetSearchConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSearchConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSearchConfigRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.GetSearchConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSearchConfigRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetSearchConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.GetSearchConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.GetSearchConfigRequest} GetSearchConfigRequest + */ + GetSearchConfigRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.GetSearchConfigRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.GetSearchConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetSearchConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.GetSearchConfigRequest + * @static + * @param {google.cloud.visionai.v1alpha1.GetSearchConfigRequest} message GetSearchConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSearchConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetSearchConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.GetSearchConfigRequest + * @instance + * @returns {Object.} JSON object + */ + GetSearchConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetSearchConfigRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.GetSearchConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetSearchConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.GetSearchConfigRequest"; + }; + + return GetSearchConfigRequest; + })(); + + v1alpha1.DeleteSearchConfigRequest = (function() { + + /** + * Properties of a DeleteSearchConfigRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IDeleteSearchConfigRequest + * @property {string|null} [name] DeleteSearchConfigRequest name + */ + + /** + * Constructs a new DeleteSearchConfigRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a DeleteSearchConfigRequest. + * @implements IDeleteSearchConfigRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IDeleteSearchConfigRequest=} [properties] Properties to set + */ + function DeleteSearchConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteSearchConfigRequest name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.DeleteSearchConfigRequest + * @instance + */ + DeleteSearchConfigRequest.prototype.name = ""; + + /** + * Creates a new DeleteSearchConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.DeleteSearchConfigRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IDeleteSearchConfigRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.DeleteSearchConfigRequest} DeleteSearchConfigRequest instance + */ + DeleteSearchConfigRequest.create = function create(properties) { + return new DeleteSearchConfigRequest(properties); + }; + + /** + * Encodes the specified DeleteSearchConfigRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteSearchConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.DeleteSearchConfigRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IDeleteSearchConfigRequest} message DeleteSearchConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSearchConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteSearchConfigRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteSearchConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.DeleteSearchConfigRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IDeleteSearchConfigRequest} message DeleteSearchConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSearchConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteSearchConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.DeleteSearchConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.DeleteSearchConfigRequest} DeleteSearchConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSearchConfigRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.DeleteSearchConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteSearchConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.DeleteSearchConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.DeleteSearchConfigRequest} DeleteSearchConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSearchConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteSearchConfigRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.DeleteSearchConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteSearchConfigRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteSearchConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.DeleteSearchConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.DeleteSearchConfigRequest} DeleteSearchConfigRequest + */ + DeleteSearchConfigRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.DeleteSearchConfigRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.DeleteSearchConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteSearchConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.DeleteSearchConfigRequest + * @static + * @param {google.cloud.visionai.v1alpha1.DeleteSearchConfigRequest} message DeleteSearchConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteSearchConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteSearchConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.DeleteSearchConfigRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteSearchConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteSearchConfigRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.DeleteSearchConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteSearchConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.DeleteSearchConfigRequest"; + }; + + return DeleteSearchConfigRequest; + })(); + + v1alpha1.ListSearchConfigsRequest = (function() { + + /** + * Properties of a ListSearchConfigsRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IListSearchConfigsRequest + * @property {string|null} [parent] ListSearchConfigsRequest parent + * @property {number|null} [pageSize] ListSearchConfigsRequest pageSize + * @property {string|null} [pageToken] ListSearchConfigsRequest pageToken + */ + + /** + * Constructs a new ListSearchConfigsRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a ListSearchConfigsRequest. + * @implements IListSearchConfigsRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IListSearchConfigsRequest=} [properties] Properties to set + */ + function ListSearchConfigsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSearchConfigsRequest parent. + * @member {string} parent + * @memberof google.cloud.visionai.v1alpha1.ListSearchConfigsRequest + * @instance + */ + ListSearchConfigsRequest.prototype.parent = ""; + + /** + * ListSearchConfigsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.visionai.v1alpha1.ListSearchConfigsRequest + * @instance + */ + ListSearchConfigsRequest.prototype.pageSize = 0; + + /** + * ListSearchConfigsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.visionai.v1alpha1.ListSearchConfigsRequest + * @instance + */ + ListSearchConfigsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListSearchConfigsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ListSearchConfigsRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IListSearchConfigsRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ListSearchConfigsRequest} ListSearchConfigsRequest instance + */ + ListSearchConfigsRequest.create = function create(properties) { + return new ListSearchConfigsRequest(properties); + }; + + /** + * Encodes the specified ListSearchConfigsRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListSearchConfigsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ListSearchConfigsRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IListSearchConfigsRequest} message ListSearchConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSearchConfigsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListSearchConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListSearchConfigsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListSearchConfigsRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IListSearchConfigsRequest} message ListSearchConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSearchConfigsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSearchConfigsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ListSearchConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ListSearchConfigsRequest} ListSearchConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSearchConfigsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ListSearchConfigsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListSearchConfigsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListSearchConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ListSearchConfigsRequest} ListSearchConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSearchConfigsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSearchConfigsRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ListSearchConfigsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSearchConfigsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListSearchConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ListSearchConfigsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ListSearchConfigsRequest} ListSearchConfigsRequest + */ + ListSearchConfigsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ListSearchConfigsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ListSearchConfigsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListSearchConfigsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ListSearchConfigsRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ListSearchConfigsRequest} message ListSearchConfigsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSearchConfigsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListSearchConfigsRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ListSearchConfigsRequest + * @instance + * @returns {Object.} JSON object + */ + ListSearchConfigsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSearchConfigsRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ListSearchConfigsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSearchConfigsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ListSearchConfigsRequest"; + }; + + return ListSearchConfigsRequest; + })(); + + v1alpha1.ListSearchConfigsResponse = (function() { + + /** + * Properties of a ListSearchConfigsResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IListSearchConfigsResponse + * @property {Array.|null} [searchConfigs] ListSearchConfigsResponse searchConfigs + * @property {string|null} [nextPageToken] ListSearchConfigsResponse nextPageToken + */ + + /** + * Constructs a new ListSearchConfigsResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a ListSearchConfigsResponse. + * @implements IListSearchConfigsResponse + * @constructor + * @param {google.cloud.visionai.v1alpha1.IListSearchConfigsResponse=} [properties] Properties to set + */ + function ListSearchConfigsResponse(properties) { + this.searchConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSearchConfigsResponse searchConfigs. + * @member {Array.} searchConfigs + * @memberof google.cloud.visionai.v1alpha1.ListSearchConfigsResponse + * @instance + */ + ListSearchConfigsResponse.prototype.searchConfigs = $util.emptyArray; + + /** + * ListSearchConfigsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.visionai.v1alpha1.ListSearchConfigsResponse + * @instance + */ + ListSearchConfigsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListSearchConfigsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ListSearchConfigsResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IListSearchConfigsResponse=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ListSearchConfigsResponse} ListSearchConfigsResponse instance + */ + ListSearchConfigsResponse.create = function create(properties) { + return new ListSearchConfigsResponse(properties); + }; + + /** + * Encodes the specified ListSearchConfigsResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListSearchConfigsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ListSearchConfigsResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IListSearchConfigsResponse} message ListSearchConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSearchConfigsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.searchConfigs != null && message.searchConfigs.length) + for (var i = 0; i < message.searchConfigs.length; ++i) + $root.google.cloud.visionai.v1alpha1.SearchConfig.encode(message.searchConfigs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListSearchConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ListSearchConfigsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListSearchConfigsResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IListSearchConfigsResponse} message ListSearchConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSearchConfigsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSearchConfigsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ListSearchConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ListSearchConfigsResponse} ListSearchConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSearchConfigsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ListSearchConfigsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.searchConfigs && message.searchConfigs.length)) + message.searchConfigs = []; + message.searchConfigs.push($root.google.cloud.visionai.v1alpha1.SearchConfig.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListSearchConfigsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ListSearchConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ListSearchConfigsResponse} ListSearchConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSearchConfigsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSearchConfigsResponse message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ListSearchConfigsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSearchConfigsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.searchConfigs != null && message.hasOwnProperty("searchConfigs")) { + if (!Array.isArray(message.searchConfigs)) + return "searchConfigs: array expected"; + for (var i = 0; i < message.searchConfigs.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.SearchConfig.verify(message.searchConfigs[i], long + 1); + if (error) + return "searchConfigs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListSearchConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ListSearchConfigsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ListSearchConfigsResponse} ListSearchConfigsResponse + */ + ListSearchConfigsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ListSearchConfigsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ListSearchConfigsResponse(); + if (object.searchConfigs) { + if (!Array.isArray(object.searchConfigs)) + throw TypeError(".google.cloud.visionai.v1alpha1.ListSearchConfigsResponse.searchConfigs: array expected"); + message.searchConfigs = []; + for (var i = 0; i < object.searchConfigs.length; ++i) { + if (typeof object.searchConfigs[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ListSearchConfigsResponse.searchConfigs: object expected"); + message.searchConfigs[i] = $root.google.cloud.visionai.v1alpha1.SearchConfig.fromObject(object.searchConfigs[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListSearchConfigsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ListSearchConfigsResponse + * @static + * @param {google.cloud.visionai.v1alpha1.ListSearchConfigsResponse} message ListSearchConfigsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSearchConfigsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.searchConfigs = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.searchConfigs && message.searchConfigs.length) { + object.searchConfigs = []; + for (var j = 0; j < message.searchConfigs.length; ++j) + object.searchConfigs[j] = $root.google.cloud.visionai.v1alpha1.SearchConfig.toObject(message.searchConfigs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListSearchConfigsResponse to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ListSearchConfigsResponse + * @instance + * @returns {Object.} JSON object + */ + ListSearchConfigsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSearchConfigsResponse + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ListSearchConfigsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSearchConfigsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ListSearchConfigsResponse"; + }; + + return ListSearchConfigsResponse; + })(); + + v1alpha1.SearchConfig = (function() { + + /** + * Properties of a SearchConfig. + * @memberof google.cloud.visionai.v1alpha1 + * @interface ISearchConfig + * @property {string|null} [name] SearchConfig name + * @property {google.cloud.visionai.v1alpha1.IFacetProperty|null} [facetProperty] SearchConfig facetProperty + * @property {google.cloud.visionai.v1alpha1.ISearchCriteriaProperty|null} [searchCriteriaProperty] SearchConfig searchCriteriaProperty + */ + + /** + * Constructs a new SearchConfig. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a SearchConfig. + * @implements ISearchConfig + * @constructor + * @param {google.cloud.visionai.v1alpha1.ISearchConfig=} [properties] Properties to set + */ + function SearchConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchConfig name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.SearchConfig + * @instance + */ + SearchConfig.prototype.name = ""; + + /** + * SearchConfig facetProperty. + * @member {google.cloud.visionai.v1alpha1.IFacetProperty|null|undefined} facetProperty + * @memberof google.cloud.visionai.v1alpha1.SearchConfig + * @instance + */ + SearchConfig.prototype.facetProperty = null; + + /** + * SearchConfig searchCriteriaProperty. + * @member {google.cloud.visionai.v1alpha1.ISearchCriteriaProperty|null|undefined} searchCriteriaProperty + * @memberof google.cloud.visionai.v1alpha1.SearchConfig + * @instance + */ + SearchConfig.prototype.searchCriteriaProperty = null; + + /** + * Creates a new SearchConfig instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.SearchConfig + * @static + * @param {google.cloud.visionai.v1alpha1.ISearchConfig=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.SearchConfig} SearchConfig instance + */ + SearchConfig.create = function create(properties) { + return new SearchConfig(properties); + }; + + /** + * Encodes the specified SearchConfig message. Does not implicitly {@link google.cloud.visionai.v1alpha1.SearchConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.SearchConfig + * @static + * @param {google.cloud.visionai.v1alpha1.ISearchConfig} message SearchConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.facetProperty != null && Object.hasOwnProperty.call(message, "facetProperty")) + $root.google.cloud.visionai.v1alpha1.FacetProperty.encode(message.facetProperty, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.searchCriteriaProperty != null && Object.hasOwnProperty.call(message, "searchCriteriaProperty")) + $root.google.cloud.visionai.v1alpha1.SearchCriteriaProperty.encode(message.searchCriteriaProperty, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SearchConfig message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.SearchConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.SearchConfig + * @static + * @param {google.cloud.visionai.v1alpha1.ISearchConfig} message SearchConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.SearchConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.SearchConfig} SearchConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.SearchConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.facetProperty = $root.google.cloud.visionai.v1alpha1.FacetProperty.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.searchCriteriaProperty = $root.google.cloud.visionai.v1alpha1.SearchCriteriaProperty.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SearchConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.SearchConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.SearchConfig} SearchConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchConfig message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.SearchConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.facetProperty != null && message.hasOwnProperty("facetProperty")) { + var error = $root.google.cloud.visionai.v1alpha1.FacetProperty.verify(message.facetProperty, long + 1); + if (error) + return "facetProperty." + error; + } + if (message.searchCriteriaProperty != null && message.hasOwnProperty("searchCriteriaProperty")) { + var error = $root.google.cloud.visionai.v1alpha1.SearchCriteriaProperty.verify(message.searchCriteriaProperty, long + 1); + if (error) + return "searchCriteriaProperty." + error; + } + return null; + }; + + /** + * Creates a SearchConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.SearchConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.SearchConfig} SearchConfig + */ + SearchConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.SearchConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.SearchConfig(); + if (object.name != null) + message.name = String(object.name); + if (object.facetProperty != null) { + if (typeof object.facetProperty !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.SearchConfig.facetProperty: object expected"); + message.facetProperty = $root.google.cloud.visionai.v1alpha1.FacetProperty.fromObject(object.facetProperty, long + 1); + } + if (object.searchCriteriaProperty != null) { + if (typeof object.searchCriteriaProperty !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.SearchConfig.searchCriteriaProperty: object expected"); + message.searchCriteriaProperty = $root.google.cloud.visionai.v1alpha1.SearchCriteriaProperty.fromObject(object.searchCriteriaProperty, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a SearchConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.SearchConfig + * @static + * @param {google.cloud.visionai.v1alpha1.SearchConfig} message SearchConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.facetProperty = null; + object.searchCriteriaProperty = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.facetProperty != null && message.hasOwnProperty("facetProperty")) + object.facetProperty = $root.google.cloud.visionai.v1alpha1.FacetProperty.toObject(message.facetProperty, options); + if (message.searchCriteriaProperty != null && message.hasOwnProperty("searchCriteriaProperty")) + object.searchCriteriaProperty = $root.google.cloud.visionai.v1alpha1.SearchCriteriaProperty.toObject(message.searchCriteriaProperty, options); + return object; + }; + + /** + * Converts this SearchConfig to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.SearchConfig + * @instance + * @returns {Object.} JSON object + */ + SearchConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchConfig + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.SearchConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.SearchConfig"; + }; + + return SearchConfig; + })(); + + v1alpha1.FacetProperty = (function() { + + /** + * Properties of a FacetProperty. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IFacetProperty + * @property {google.cloud.visionai.v1alpha1.FacetProperty.IFixedRangeBucketSpec|null} [fixedRangeBucketSpec] FacetProperty fixedRangeBucketSpec + * @property {google.cloud.visionai.v1alpha1.FacetProperty.ICustomRangeBucketSpec|null} [customRangeBucketSpec] FacetProperty customRangeBucketSpec + * @property {google.cloud.visionai.v1alpha1.FacetProperty.IDateTimeBucketSpec|null} [datetimeBucketSpec] FacetProperty datetimeBucketSpec + * @property {Array.|null} [mappedFields] FacetProperty mappedFields + * @property {string|null} [displayName] FacetProperty displayName + * @property {number|Long|null} [resultSize] FacetProperty resultSize + * @property {google.cloud.visionai.v1alpha1.FacetBucketType|null} [bucketType] FacetProperty bucketType + */ + + /** + * Constructs a new FacetProperty. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a FacetProperty. + * @implements IFacetProperty + * @constructor + * @param {google.cloud.visionai.v1alpha1.IFacetProperty=} [properties] Properties to set + */ + function FacetProperty(properties) { + this.mappedFields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FacetProperty fixedRangeBucketSpec. + * @member {google.cloud.visionai.v1alpha1.FacetProperty.IFixedRangeBucketSpec|null|undefined} fixedRangeBucketSpec + * @memberof google.cloud.visionai.v1alpha1.FacetProperty + * @instance + */ + FacetProperty.prototype.fixedRangeBucketSpec = null; + + /** + * FacetProperty customRangeBucketSpec. + * @member {google.cloud.visionai.v1alpha1.FacetProperty.ICustomRangeBucketSpec|null|undefined} customRangeBucketSpec + * @memberof google.cloud.visionai.v1alpha1.FacetProperty + * @instance + */ + FacetProperty.prototype.customRangeBucketSpec = null; + + /** + * FacetProperty datetimeBucketSpec. + * @member {google.cloud.visionai.v1alpha1.FacetProperty.IDateTimeBucketSpec|null|undefined} datetimeBucketSpec + * @memberof google.cloud.visionai.v1alpha1.FacetProperty + * @instance + */ + FacetProperty.prototype.datetimeBucketSpec = null; + + /** + * FacetProperty mappedFields. + * @member {Array.} mappedFields + * @memberof google.cloud.visionai.v1alpha1.FacetProperty + * @instance + */ + FacetProperty.prototype.mappedFields = $util.emptyArray; + + /** + * FacetProperty displayName. + * @member {string} displayName + * @memberof google.cloud.visionai.v1alpha1.FacetProperty + * @instance + */ + FacetProperty.prototype.displayName = ""; + + /** + * FacetProperty resultSize. + * @member {number|Long} resultSize + * @memberof google.cloud.visionai.v1alpha1.FacetProperty + * @instance + */ + FacetProperty.prototype.resultSize = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * FacetProperty bucketType. + * @member {google.cloud.visionai.v1alpha1.FacetBucketType} bucketType + * @memberof google.cloud.visionai.v1alpha1.FacetProperty + * @instance + */ + FacetProperty.prototype.bucketType = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * FacetProperty rangeFacetConfig. + * @member {"fixedRangeBucketSpec"|"customRangeBucketSpec"|"datetimeBucketSpec"|undefined} rangeFacetConfig + * @memberof google.cloud.visionai.v1alpha1.FacetProperty + * @instance + */ + Object.defineProperty(FacetProperty.prototype, "rangeFacetConfig", { + get: $util.oneOfGetter($oneOfFields = ["fixedRangeBucketSpec", "customRangeBucketSpec", "datetimeBucketSpec"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new FacetProperty instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.FacetProperty + * @static + * @param {google.cloud.visionai.v1alpha1.IFacetProperty=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.FacetProperty} FacetProperty instance + */ + FacetProperty.create = function create(properties) { + return new FacetProperty(properties); + }; + + /** + * Encodes the specified FacetProperty message. Does not implicitly {@link google.cloud.visionai.v1alpha1.FacetProperty.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.FacetProperty + * @static + * @param {google.cloud.visionai.v1alpha1.IFacetProperty} message FacetProperty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FacetProperty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mappedFields != null && message.mappedFields.length) + for (var i = 0; i < message.mappedFields.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.mappedFields[i]); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.resultSize != null && Object.hasOwnProperty.call(message, "resultSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.resultSize); + if (message.bucketType != null && Object.hasOwnProperty.call(message, "bucketType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.bucketType); + if (message.fixedRangeBucketSpec != null && Object.hasOwnProperty.call(message, "fixedRangeBucketSpec")) + $root.google.cloud.visionai.v1alpha1.FacetProperty.FixedRangeBucketSpec.encode(message.fixedRangeBucketSpec, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.customRangeBucketSpec != null && Object.hasOwnProperty.call(message, "customRangeBucketSpec")) + $root.google.cloud.visionai.v1alpha1.FacetProperty.CustomRangeBucketSpec.encode(message.customRangeBucketSpec, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.datetimeBucketSpec != null && Object.hasOwnProperty.call(message, "datetimeBucketSpec")) + $root.google.cloud.visionai.v1alpha1.FacetProperty.DateTimeBucketSpec.encode(message.datetimeBucketSpec, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FacetProperty message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.FacetProperty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.FacetProperty + * @static + * @param {google.cloud.visionai.v1alpha1.IFacetProperty} message FacetProperty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FacetProperty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FacetProperty message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.FacetProperty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.FacetProperty} FacetProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FacetProperty.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.FacetProperty(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 5: { + message.fixedRangeBucketSpec = $root.google.cloud.visionai.v1alpha1.FacetProperty.FixedRangeBucketSpec.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.customRangeBucketSpec = $root.google.cloud.visionai.v1alpha1.FacetProperty.CustomRangeBucketSpec.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + message.datetimeBucketSpec = $root.google.cloud.visionai.v1alpha1.FacetProperty.DateTimeBucketSpec.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 1: { + if (!(message.mappedFields && message.mappedFields.length)) + message.mappedFields = []; + message.mappedFields.push(reader.string()); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.resultSize = reader.int64(); + break; + } + case 4: { + message.bucketType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FacetProperty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.FacetProperty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.FacetProperty} FacetProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FacetProperty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FacetProperty message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.FacetProperty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FacetProperty.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.fixedRangeBucketSpec != null && message.hasOwnProperty("fixedRangeBucketSpec")) { + properties.rangeFacetConfig = 1; + { + var error = $root.google.cloud.visionai.v1alpha1.FacetProperty.FixedRangeBucketSpec.verify(message.fixedRangeBucketSpec, long + 1); + if (error) + return "fixedRangeBucketSpec." + error; + } + } + if (message.customRangeBucketSpec != null && message.hasOwnProperty("customRangeBucketSpec")) { + if (properties.rangeFacetConfig === 1) + return "rangeFacetConfig: multiple values"; + properties.rangeFacetConfig = 1; + { + var error = $root.google.cloud.visionai.v1alpha1.FacetProperty.CustomRangeBucketSpec.verify(message.customRangeBucketSpec, long + 1); + if (error) + return "customRangeBucketSpec." + error; + } + } + if (message.datetimeBucketSpec != null && message.hasOwnProperty("datetimeBucketSpec")) { + if (properties.rangeFacetConfig === 1) + return "rangeFacetConfig: multiple values"; + properties.rangeFacetConfig = 1; + { + var error = $root.google.cloud.visionai.v1alpha1.FacetProperty.DateTimeBucketSpec.verify(message.datetimeBucketSpec, long + 1); + if (error) + return "datetimeBucketSpec." + error; + } + } + if (message.mappedFields != null && message.hasOwnProperty("mappedFields")) { + if (!Array.isArray(message.mappedFields)) + return "mappedFields: array expected"; + for (var i = 0; i < message.mappedFields.length; ++i) + if (!$util.isString(message.mappedFields[i])) + return "mappedFields: string[] expected"; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.resultSize != null && message.hasOwnProperty("resultSize")) + if (!$util.isInteger(message.resultSize) && !(message.resultSize && $util.isInteger(message.resultSize.low) && $util.isInteger(message.resultSize.high))) + return "resultSize: integer|Long expected"; + if (message.bucketType != null && message.hasOwnProperty("bucketType")) + switch (message.bucketType) { + default: + return "bucketType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a FacetProperty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.FacetProperty + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.FacetProperty} FacetProperty + */ + FacetProperty.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.FacetProperty) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.FacetProperty(); + if (object.fixedRangeBucketSpec != null) { + if (typeof object.fixedRangeBucketSpec !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.FacetProperty.fixedRangeBucketSpec: object expected"); + message.fixedRangeBucketSpec = $root.google.cloud.visionai.v1alpha1.FacetProperty.FixedRangeBucketSpec.fromObject(object.fixedRangeBucketSpec, long + 1); + } + if (object.customRangeBucketSpec != null) { + if (typeof object.customRangeBucketSpec !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.FacetProperty.customRangeBucketSpec: object expected"); + message.customRangeBucketSpec = $root.google.cloud.visionai.v1alpha1.FacetProperty.CustomRangeBucketSpec.fromObject(object.customRangeBucketSpec, long + 1); + } + if (object.datetimeBucketSpec != null) { + if (typeof object.datetimeBucketSpec !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.FacetProperty.datetimeBucketSpec: object expected"); + message.datetimeBucketSpec = $root.google.cloud.visionai.v1alpha1.FacetProperty.DateTimeBucketSpec.fromObject(object.datetimeBucketSpec, long + 1); + } + if (object.mappedFields) { + if (!Array.isArray(object.mappedFields)) + throw TypeError(".google.cloud.visionai.v1alpha1.FacetProperty.mappedFields: array expected"); + message.mappedFields = []; + for (var i = 0; i < object.mappedFields.length; ++i) + message.mappedFields[i] = String(object.mappedFields[i]); + } + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.resultSize != null) + if ($util.Long) + (message.resultSize = $util.Long.fromValue(object.resultSize)).unsigned = false; + else if (typeof object.resultSize === "string") + message.resultSize = parseInt(object.resultSize, 10); + else if (typeof object.resultSize === "number") + message.resultSize = object.resultSize; + else if (typeof object.resultSize === "object") + message.resultSize = new $util.LongBits(object.resultSize.low >>> 0, object.resultSize.high >>> 0).toNumber(); + switch (object.bucketType) { + default: + if (typeof object.bucketType === "number") { + message.bucketType = object.bucketType; + break; + } + break; + case "FACET_BUCKET_TYPE_UNSPECIFIED": + case 0: + message.bucketType = 0; + break; + case "FACET_BUCKET_TYPE_VALUE": + case 1: + message.bucketType = 1; + break; + case "FACET_BUCKET_TYPE_DATETIME": + case 2: + message.bucketType = 2; + break; + case "FACET_BUCKET_TYPE_FIXED_RANGE": + case 3: + message.bucketType = 3; + break; + case "FACET_BUCKET_TYPE_CUSTOM_RANGE": + case 4: + message.bucketType = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a FacetProperty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.FacetProperty + * @static + * @param {google.cloud.visionai.v1alpha1.FacetProperty} message FacetProperty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FacetProperty.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.mappedFields = []; + if (options.defaults) { + object.displayName = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.resultSize = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.resultSize = options.longs === String ? "0" : 0; + object.bucketType = options.enums === String ? "FACET_BUCKET_TYPE_UNSPECIFIED" : 0; + } + if (message.mappedFields && message.mappedFields.length) { + object.mappedFields = []; + for (var j = 0; j < message.mappedFields.length; ++j) + object.mappedFields[j] = message.mappedFields[j]; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.resultSize != null && message.hasOwnProperty("resultSize")) + if (typeof message.resultSize === "number") + object.resultSize = options.longs === String ? String(message.resultSize) : message.resultSize; + else + object.resultSize = options.longs === String ? $util.Long.prototype.toString.call(message.resultSize) : options.longs === Number ? new $util.LongBits(message.resultSize.low >>> 0, message.resultSize.high >>> 0).toNumber() : message.resultSize; + if (message.bucketType != null && message.hasOwnProperty("bucketType")) + object.bucketType = options.enums === String ? $root.google.cloud.visionai.v1alpha1.FacetBucketType[message.bucketType] === undefined ? message.bucketType : $root.google.cloud.visionai.v1alpha1.FacetBucketType[message.bucketType] : message.bucketType; + if (message.fixedRangeBucketSpec != null && message.hasOwnProperty("fixedRangeBucketSpec")) { + object.fixedRangeBucketSpec = $root.google.cloud.visionai.v1alpha1.FacetProperty.FixedRangeBucketSpec.toObject(message.fixedRangeBucketSpec, options); + if (options.oneofs) + object.rangeFacetConfig = "fixedRangeBucketSpec"; + } + if (message.customRangeBucketSpec != null && message.hasOwnProperty("customRangeBucketSpec")) { + object.customRangeBucketSpec = $root.google.cloud.visionai.v1alpha1.FacetProperty.CustomRangeBucketSpec.toObject(message.customRangeBucketSpec, options); + if (options.oneofs) + object.rangeFacetConfig = "customRangeBucketSpec"; + } + if (message.datetimeBucketSpec != null && message.hasOwnProperty("datetimeBucketSpec")) { + object.datetimeBucketSpec = $root.google.cloud.visionai.v1alpha1.FacetProperty.DateTimeBucketSpec.toObject(message.datetimeBucketSpec, options); + if (options.oneofs) + object.rangeFacetConfig = "datetimeBucketSpec"; + } + return object; + }; + + /** + * Converts this FacetProperty to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.FacetProperty + * @instance + * @returns {Object.} JSON object + */ + FacetProperty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FacetProperty + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.FacetProperty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FacetProperty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.FacetProperty"; + }; + + FacetProperty.FixedRangeBucketSpec = (function() { + + /** + * Properties of a FixedRangeBucketSpec. + * @memberof google.cloud.visionai.v1alpha1.FacetProperty + * @interface IFixedRangeBucketSpec + * @property {google.cloud.visionai.v1alpha1.IFacetValue|null} [bucketStart] FixedRangeBucketSpec bucketStart + * @property {google.cloud.visionai.v1alpha1.IFacetValue|null} [bucketGranularity] FixedRangeBucketSpec bucketGranularity + * @property {number|null} [bucketCount] FixedRangeBucketSpec bucketCount + */ + + /** + * Constructs a new FixedRangeBucketSpec. + * @memberof google.cloud.visionai.v1alpha1.FacetProperty + * @classdesc Represents a FixedRangeBucketSpec. + * @implements IFixedRangeBucketSpec + * @constructor + * @param {google.cloud.visionai.v1alpha1.FacetProperty.IFixedRangeBucketSpec=} [properties] Properties to set + */ + function FixedRangeBucketSpec(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FixedRangeBucketSpec bucketStart. + * @member {google.cloud.visionai.v1alpha1.IFacetValue|null|undefined} bucketStart + * @memberof google.cloud.visionai.v1alpha1.FacetProperty.FixedRangeBucketSpec + * @instance + */ + FixedRangeBucketSpec.prototype.bucketStart = null; + + /** + * FixedRangeBucketSpec bucketGranularity. + * @member {google.cloud.visionai.v1alpha1.IFacetValue|null|undefined} bucketGranularity + * @memberof google.cloud.visionai.v1alpha1.FacetProperty.FixedRangeBucketSpec + * @instance + */ + FixedRangeBucketSpec.prototype.bucketGranularity = null; + + /** + * FixedRangeBucketSpec bucketCount. + * @member {number} bucketCount + * @memberof google.cloud.visionai.v1alpha1.FacetProperty.FixedRangeBucketSpec + * @instance + */ + FixedRangeBucketSpec.prototype.bucketCount = 0; + + /** + * Creates a new FixedRangeBucketSpec instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.FacetProperty.FixedRangeBucketSpec + * @static + * @param {google.cloud.visionai.v1alpha1.FacetProperty.IFixedRangeBucketSpec=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.FacetProperty.FixedRangeBucketSpec} FixedRangeBucketSpec instance + */ + FixedRangeBucketSpec.create = function create(properties) { + return new FixedRangeBucketSpec(properties); + }; + + /** + * Encodes the specified FixedRangeBucketSpec message. Does not implicitly {@link google.cloud.visionai.v1alpha1.FacetProperty.FixedRangeBucketSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.FacetProperty.FixedRangeBucketSpec + * @static + * @param {google.cloud.visionai.v1alpha1.FacetProperty.IFixedRangeBucketSpec} message FixedRangeBucketSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedRangeBucketSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bucketStart != null && Object.hasOwnProperty.call(message, "bucketStart")) + $root.google.cloud.visionai.v1alpha1.FacetValue.encode(message.bucketStart, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.bucketGranularity != null && Object.hasOwnProperty.call(message, "bucketGranularity")) + $root.google.cloud.visionai.v1alpha1.FacetValue.encode(message.bucketGranularity, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.bucketCount != null && Object.hasOwnProperty.call(message, "bucketCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.bucketCount); + return writer; + }; + + /** + * Encodes the specified FixedRangeBucketSpec message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.FacetProperty.FixedRangeBucketSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.FacetProperty.FixedRangeBucketSpec + * @static + * @param {google.cloud.visionai.v1alpha1.FacetProperty.IFixedRangeBucketSpec} message FixedRangeBucketSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedRangeBucketSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FixedRangeBucketSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.FacetProperty.FixedRangeBucketSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.FacetProperty.FixedRangeBucketSpec} FixedRangeBucketSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedRangeBucketSpec.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.FacetProperty.FixedRangeBucketSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.bucketStart = $root.google.cloud.visionai.v1alpha1.FacetValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.bucketGranularity = $root.google.cloud.visionai.v1alpha1.FacetValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.bucketCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FixedRangeBucketSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.FacetProperty.FixedRangeBucketSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.FacetProperty.FixedRangeBucketSpec} FixedRangeBucketSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedRangeBucketSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FixedRangeBucketSpec message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.FacetProperty.FixedRangeBucketSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FixedRangeBucketSpec.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.bucketStart != null && message.hasOwnProperty("bucketStart")) { + var error = $root.google.cloud.visionai.v1alpha1.FacetValue.verify(message.bucketStart, long + 1); + if (error) + return "bucketStart." + error; + } + if (message.bucketGranularity != null && message.hasOwnProperty("bucketGranularity")) { + var error = $root.google.cloud.visionai.v1alpha1.FacetValue.verify(message.bucketGranularity, long + 1); + if (error) + return "bucketGranularity." + error; + } + if (message.bucketCount != null && message.hasOwnProperty("bucketCount")) + if (!$util.isInteger(message.bucketCount)) + return "bucketCount: integer expected"; + return null; + }; + + /** + * Creates a FixedRangeBucketSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.FacetProperty.FixedRangeBucketSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.FacetProperty.FixedRangeBucketSpec} FixedRangeBucketSpec + */ + FixedRangeBucketSpec.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.FacetProperty.FixedRangeBucketSpec) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.FacetProperty.FixedRangeBucketSpec(); + if (object.bucketStart != null) { + if (typeof object.bucketStart !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.FacetProperty.FixedRangeBucketSpec.bucketStart: object expected"); + message.bucketStart = $root.google.cloud.visionai.v1alpha1.FacetValue.fromObject(object.bucketStart, long + 1); + } + if (object.bucketGranularity != null) { + if (typeof object.bucketGranularity !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.FacetProperty.FixedRangeBucketSpec.bucketGranularity: object expected"); + message.bucketGranularity = $root.google.cloud.visionai.v1alpha1.FacetValue.fromObject(object.bucketGranularity, long + 1); + } + if (object.bucketCount != null) + message.bucketCount = object.bucketCount | 0; + return message; + }; + + /** + * Creates a plain object from a FixedRangeBucketSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.FacetProperty.FixedRangeBucketSpec + * @static + * @param {google.cloud.visionai.v1alpha1.FacetProperty.FixedRangeBucketSpec} message FixedRangeBucketSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FixedRangeBucketSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.bucketStart = null; + object.bucketGranularity = null; + object.bucketCount = 0; + } + if (message.bucketStart != null && message.hasOwnProperty("bucketStart")) + object.bucketStart = $root.google.cloud.visionai.v1alpha1.FacetValue.toObject(message.bucketStart, options); + if (message.bucketGranularity != null && message.hasOwnProperty("bucketGranularity")) + object.bucketGranularity = $root.google.cloud.visionai.v1alpha1.FacetValue.toObject(message.bucketGranularity, options); + if (message.bucketCount != null && message.hasOwnProperty("bucketCount")) + object.bucketCount = message.bucketCount; + return object; + }; + + /** + * Converts this FixedRangeBucketSpec to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.FacetProperty.FixedRangeBucketSpec + * @instance + * @returns {Object.} JSON object + */ + FixedRangeBucketSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FixedRangeBucketSpec + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.FacetProperty.FixedRangeBucketSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedRangeBucketSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.FacetProperty.FixedRangeBucketSpec"; + }; + + return FixedRangeBucketSpec; + })(); + + FacetProperty.CustomRangeBucketSpec = (function() { + + /** + * Properties of a CustomRangeBucketSpec. + * @memberof google.cloud.visionai.v1alpha1.FacetProperty + * @interface ICustomRangeBucketSpec + * @property {Array.|null} [endpoints] CustomRangeBucketSpec endpoints + */ + + /** + * Constructs a new CustomRangeBucketSpec. + * @memberof google.cloud.visionai.v1alpha1.FacetProperty + * @classdesc Represents a CustomRangeBucketSpec. + * @implements ICustomRangeBucketSpec + * @constructor + * @param {google.cloud.visionai.v1alpha1.FacetProperty.ICustomRangeBucketSpec=} [properties] Properties to set + */ + function CustomRangeBucketSpec(properties) { + this.endpoints = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomRangeBucketSpec endpoints. + * @member {Array.} endpoints + * @memberof google.cloud.visionai.v1alpha1.FacetProperty.CustomRangeBucketSpec + * @instance + */ + CustomRangeBucketSpec.prototype.endpoints = $util.emptyArray; + + /** + * Creates a new CustomRangeBucketSpec instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.FacetProperty.CustomRangeBucketSpec + * @static + * @param {google.cloud.visionai.v1alpha1.FacetProperty.ICustomRangeBucketSpec=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.FacetProperty.CustomRangeBucketSpec} CustomRangeBucketSpec instance + */ + CustomRangeBucketSpec.create = function create(properties) { + return new CustomRangeBucketSpec(properties); + }; + + /** + * Encodes the specified CustomRangeBucketSpec message. Does not implicitly {@link google.cloud.visionai.v1alpha1.FacetProperty.CustomRangeBucketSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.FacetProperty.CustomRangeBucketSpec + * @static + * @param {google.cloud.visionai.v1alpha1.FacetProperty.ICustomRangeBucketSpec} message CustomRangeBucketSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomRangeBucketSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.endpoints != null && message.endpoints.length) + for (var i = 0; i < message.endpoints.length; ++i) + $root.google.cloud.visionai.v1alpha1.FacetValue.encode(message.endpoints[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CustomRangeBucketSpec message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.FacetProperty.CustomRangeBucketSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.FacetProperty.CustomRangeBucketSpec + * @static + * @param {google.cloud.visionai.v1alpha1.FacetProperty.ICustomRangeBucketSpec} message CustomRangeBucketSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomRangeBucketSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomRangeBucketSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.FacetProperty.CustomRangeBucketSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.FacetProperty.CustomRangeBucketSpec} CustomRangeBucketSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomRangeBucketSpec.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.FacetProperty.CustomRangeBucketSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.endpoints && message.endpoints.length)) + message.endpoints = []; + message.endpoints.push($root.google.cloud.visionai.v1alpha1.FacetValue.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CustomRangeBucketSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.FacetProperty.CustomRangeBucketSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.FacetProperty.CustomRangeBucketSpec} CustomRangeBucketSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomRangeBucketSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomRangeBucketSpec message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.FacetProperty.CustomRangeBucketSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomRangeBucketSpec.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.endpoints != null && message.hasOwnProperty("endpoints")) { + if (!Array.isArray(message.endpoints)) + return "endpoints: array expected"; + for (var i = 0; i < message.endpoints.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.FacetValue.verify(message.endpoints[i], long + 1); + if (error) + return "endpoints." + error; + } + } + return null; + }; + + /** + * Creates a CustomRangeBucketSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.FacetProperty.CustomRangeBucketSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.FacetProperty.CustomRangeBucketSpec} CustomRangeBucketSpec + */ + CustomRangeBucketSpec.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.FacetProperty.CustomRangeBucketSpec) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.FacetProperty.CustomRangeBucketSpec(); + if (object.endpoints) { + if (!Array.isArray(object.endpoints)) + throw TypeError(".google.cloud.visionai.v1alpha1.FacetProperty.CustomRangeBucketSpec.endpoints: array expected"); + message.endpoints = []; + for (var i = 0; i < object.endpoints.length; ++i) { + if (typeof object.endpoints[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.FacetProperty.CustomRangeBucketSpec.endpoints: object expected"); + message.endpoints[i] = $root.google.cloud.visionai.v1alpha1.FacetValue.fromObject(object.endpoints[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a CustomRangeBucketSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.FacetProperty.CustomRangeBucketSpec + * @static + * @param {google.cloud.visionai.v1alpha1.FacetProperty.CustomRangeBucketSpec} message CustomRangeBucketSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomRangeBucketSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.endpoints = []; + if (message.endpoints && message.endpoints.length) { + object.endpoints = []; + for (var j = 0; j < message.endpoints.length; ++j) + object.endpoints[j] = $root.google.cloud.visionai.v1alpha1.FacetValue.toObject(message.endpoints[j], options); + } + return object; + }; + + /** + * Converts this CustomRangeBucketSpec to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.FacetProperty.CustomRangeBucketSpec + * @instance + * @returns {Object.} JSON object + */ + CustomRangeBucketSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomRangeBucketSpec + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.FacetProperty.CustomRangeBucketSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomRangeBucketSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.FacetProperty.CustomRangeBucketSpec"; + }; + + return CustomRangeBucketSpec; + })(); + + FacetProperty.DateTimeBucketSpec = (function() { + + /** + * Properties of a DateTimeBucketSpec. + * @memberof google.cloud.visionai.v1alpha1.FacetProperty + * @interface IDateTimeBucketSpec + * @property {google.cloud.visionai.v1alpha1.FacetProperty.DateTimeBucketSpec.Granularity|null} [granularity] DateTimeBucketSpec granularity + */ + + /** + * Constructs a new DateTimeBucketSpec. + * @memberof google.cloud.visionai.v1alpha1.FacetProperty + * @classdesc Represents a DateTimeBucketSpec. + * @implements IDateTimeBucketSpec + * @constructor + * @param {google.cloud.visionai.v1alpha1.FacetProperty.IDateTimeBucketSpec=} [properties] Properties to set + */ + function DateTimeBucketSpec(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DateTimeBucketSpec granularity. + * @member {google.cloud.visionai.v1alpha1.FacetProperty.DateTimeBucketSpec.Granularity} granularity + * @memberof google.cloud.visionai.v1alpha1.FacetProperty.DateTimeBucketSpec + * @instance + */ + DateTimeBucketSpec.prototype.granularity = 0; + + /** + * Creates a new DateTimeBucketSpec instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.FacetProperty.DateTimeBucketSpec + * @static + * @param {google.cloud.visionai.v1alpha1.FacetProperty.IDateTimeBucketSpec=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.FacetProperty.DateTimeBucketSpec} DateTimeBucketSpec instance + */ + DateTimeBucketSpec.create = function create(properties) { + return new DateTimeBucketSpec(properties); + }; + + /** + * Encodes the specified DateTimeBucketSpec message. Does not implicitly {@link google.cloud.visionai.v1alpha1.FacetProperty.DateTimeBucketSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.FacetProperty.DateTimeBucketSpec + * @static + * @param {google.cloud.visionai.v1alpha1.FacetProperty.IDateTimeBucketSpec} message DateTimeBucketSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DateTimeBucketSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.granularity != null && Object.hasOwnProperty.call(message, "granularity")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.granularity); + return writer; + }; + + /** + * Encodes the specified DateTimeBucketSpec message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.FacetProperty.DateTimeBucketSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.FacetProperty.DateTimeBucketSpec + * @static + * @param {google.cloud.visionai.v1alpha1.FacetProperty.IDateTimeBucketSpec} message DateTimeBucketSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DateTimeBucketSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DateTimeBucketSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.FacetProperty.DateTimeBucketSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.FacetProperty.DateTimeBucketSpec} DateTimeBucketSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DateTimeBucketSpec.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.FacetProperty.DateTimeBucketSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.granularity = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DateTimeBucketSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.FacetProperty.DateTimeBucketSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.FacetProperty.DateTimeBucketSpec} DateTimeBucketSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DateTimeBucketSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DateTimeBucketSpec message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.FacetProperty.DateTimeBucketSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DateTimeBucketSpec.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.granularity != null && message.hasOwnProperty("granularity")) + switch (message.granularity) { + default: + return "granularity: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a DateTimeBucketSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.FacetProperty.DateTimeBucketSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.FacetProperty.DateTimeBucketSpec} DateTimeBucketSpec + */ + DateTimeBucketSpec.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.FacetProperty.DateTimeBucketSpec) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.FacetProperty.DateTimeBucketSpec(); + switch (object.granularity) { + default: + if (typeof object.granularity === "number") { + message.granularity = object.granularity; + break; + } + break; + case "GRANULARITY_UNSPECIFIED": + case 0: + message.granularity = 0; + break; + case "YEAR": + case 1: + message.granularity = 1; + break; + case "MONTH": + case 2: + message.granularity = 2; + break; + case "DAY": + case 3: + message.granularity = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a DateTimeBucketSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.FacetProperty.DateTimeBucketSpec + * @static + * @param {google.cloud.visionai.v1alpha1.FacetProperty.DateTimeBucketSpec} message DateTimeBucketSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DateTimeBucketSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.granularity = options.enums === String ? "GRANULARITY_UNSPECIFIED" : 0; + if (message.granularity != null && message.hasOwnProperty("granularity")) + object.granularity = options.enums === String ? $root.google.cloud.visionai.v1alpha1.FacetProperty.DateTimeBucketSpec.Granularity[message.granularity] === undefined ? message.granularity : $root.google.cloud.visionai.v1alpha1.FacetProperty.DateTimeBucketSpec.Granularity[message.granularity] : message.granularity; + return object; + }; + + /** + * Converts this DateTimeBucketSpec to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.FacetProperty.DateTimeBucketSpec + * @instance + * @returns {Object.} JSON object + */ + DateTimeBucketSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DateTimeBucketSpec + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.FacetProperty.DateTimeBucketSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DateTimeBucketSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.FacetProperty.DateTimeBucketSpec"; + }; + + /** + * Granularity enum. + * @name google.cloud.visionai.v1alpha1.FacetProperty.DateTimeBucketSpec.Granularity + * @enum {number} + * @property {number} GRANULARITY_UNSPECIFIED=0 GRANULARITY_UNSPECIFIED value + * @property {number} YEAR=1 YEAR value + * @property {number} MONTH=2 MONTH value + * @property {number} DAY=3 DAY value + */ + DateTimeBucketSpec.Granularity = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "GRANULARITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "YEAR"] = 1; + values[valuesById[2] = "MONTH"] = 2; + values[valuesById[3] = "DAY"] = 3; + return values; + })(); + + return DateTimeBucketSpec; + })(); + + return FacetProperty; + })(); + + v1alpha1.SearchCriteriaProperty = (function() { + + /** + * Properties of a SearchCriteriaProperty. + * @memberof google.cloud.visionai.v1alpha1 + * @interface ISearchCriteriaProperty + * @property {Array.|null} [mappedFields] SearchCriteriaProperty mappedFields + */ + + /** + * Constructs a new SearchCriteriaProperty. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a SearchCriteriaProperty. + * @implements ISearchCriteriaProperty + * @constructor + * @param {google.cloud.visionai.v1alpha1.ISearchCriteriaProperty=} [properties] Properties to set + */ + function SearchCriteriaProperty(properties) { + this.mappedFields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchCriteriaProperty mappedFields. + * @member {Array.} mappedFields + * @memberof google.cloud.visionai.v1alpha1.SearchCriteriaProperty + * @instance + */ + SearchCriteriaProperty.prototype.mappedFields = $util.emptyArray; + + /** + * Creates a new SearchCriteriaProperty instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.SearchCriteriaProperty + * @static + * @param {google.cloud.visionai.v1alpha1.ISearchCriteriaProperty=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.SearchCriteriaProperty} SearchCriteriaProperty instance + */ + SearchCriteriaProperty.create = function create(properties) { + return new SearchCriteriaProperty(properties); + }; + + /** + * Encodes the specified SearchCriteriaProperty message. Does not implicitly {@link google.cloud.visionai.v1alpha1.SearchCriteriaProperty.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.SearchCriteriaProperty + * @static + * @param {google.cloud.visionai.v1alpha1.ISearchCriteriaProperty} message SearchCriteriaProperty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchCriteriaProperty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mappedFields != null && message.mappedFields.length) + for (var i = 0; i < message.mappedFields.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.mappedFields[i]); + return writer; + }; + + /** + * Encodes the specified SearchCriteriaProperty message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.SearchCriteriaProperty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.SearchCriteriaProperty + * @static + * @param {google.cloud.visionai.v1alpha1.ISearchCriteriaProperty} message SearchCriteriaProperty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchCriteriaProperty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchCriteriaProperty message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.SearchCriteriaProperty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.SearchCriteriaProperty} SearchCriteriaProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchCriteriaProperty.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.SearchCriteriaProperty(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.mappedFields && message.mappedFields.length)) + message.mappedFields = []; + message.mappedFields.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SearchCriteriaProperty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.SearchCriteriaProperty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.SearchCriteriaProperty} SearchCriteriaProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchCriteriaProperty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchCriteriaProperty message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.SearchCriteriaProperty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchCriteriaProperty.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.mappedFields != null && message.hasOwnProperty("mappedFields")) { + if (!Array.isArray(message.mappedFields)) + return "mappedFields: array expected"; + for (var i = 0; i < message.mappedFields.length; ++i) + if (!$util.isString(message.mappedFields[i])) + return "mappedFields: string[] expected"; + } + return null; + }; + + /** + * Creates a SearchCriteriaProperty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.SearchCriteriaProperty + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.SearchCriteriaProperty} SearchCriteriaProperty + */ + SearchCriteriaProperty.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.SearchCriteriaProperty) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.SearchCriteriaProperty(); + if (object.mappedFields) { + if (!Array.isArray(object.mappedFields)) + throw TypeError(".google.cloud.visionai.v1alpha1.SearchCriteriaProperty.mappedFields: array expected"); + message.mappedFields = []; + for (var i = 0; i < object.mappedFields.length; ++i) + message.mappedFields[i] = String(object.mappedFields[i]); + } + return message; + }; + + /** + * Creates a plain object from a SearchCriteriaProperty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.SearchCriteriaProperty + * @static + * @param {google.cloud.visionai.v1alpha1.SearchCriteriaProperty} message SearchCriteriaProperty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchCriteriaProperty.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.mappedFields = []; + if (message.mappedFields && message.mappedFields.length) { + object.mappedFields = []; + for (var j = 0; j < message.mappedFields.length; ++j) + object.mappedFields[j] = message.mappedFields[j]; + } + return object; + }; + + /** + * Converts this SearchCriteriaProperty to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.SearchCriteriaProperty + * @instance + * @returns {Object.} JSON object + */ + SearchCriteriaProperty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchCriteriaProperty + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.SearchCriteriaProperty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchCriteriaProperty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.SearchCriteriaProperty"; + }; + + return SearchCriteriaProperty; + })(); + + v1alpha1.FacetValue = (function() { + + /** + * Properties of a FacetValue. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IFacetValue + * @property {string|null} [stringValue] FacetValue stringValue + * @property {number|Long|null} [integerValue] FacetValue integerValue + * @property {google.type.IDateTime|null} [datetimeValue] FacetValue datetimeValue + */ + + /** + * Constructs a new FacetValue. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a FacetValue. + * @implements IFacetValue + * @constructor + * @param {google.cloud.visionai.v1alpha1.IFacetValue=} [properties] Properties to set + */ + function FacetValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FacetValue stringValue. + * @member {string|null|undefined} stringValue + * @memberof google.cloud.visionai.v1alpha1.FacetValue + * @instance + */ + FacetValue.prototype.stringValue = null; + + /** + * FacetValue integerValue. + * @member {number|Long|null|undefined} integerValue + * @memberof google.cloud.visionai.v1alpha1.FacetValue + * @instance + */ + FacetValue.prototype.integerValue = null; + + /** + * FacetValue datetimeValue. + * @member {google.type.IDateTime|null|undefined} datetimeValue + * @memberof google.cloud.visionai.v1alpha1.FacetValue + * @instance + */ + FacetValue.prototype.datetimeValue = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * FacetValue value. + * @member {"stringValue"|"integerValue"|"datetimeValue"|undefined} value + * @memberof google.cloud.visionai.v1alpha1.FacetValue + * @instance + */ + Object.defineProperty(FacetValue.prototype, "value", { + get: $util.oneOfGetter($oneOfFields = ["stringValue", "integerValue", "datetimeValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new FacetValue instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.FacetValue + * @static + * @param {google.cloud.visionai.v1alpha1.IFacetValue=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.FacetValue} FacetValue instance + */ + FacetValue.create = function create(properties) { + return new FacetValue(properties); + }; + + /** + * Encodes the specified FacetValue message. Does not implicitly {@link google.cloud.visionai.v1alpha1.FacetValue.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.FacetValue + * @static + * @param {google.cloud.visionai.v1alpha1.IFacetValue} message FacetValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FacetValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.stringValue); + if (message.integerValue != null && Object.hasOwnProperty.call(message, "integerValue")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.integerValue); + if (message.datetimeValue != null && Object.hasOwnProperty.call(message, "datetimeValue")) + $root.google.type.DateTime.encode(message.datetimeValue, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FacetValue message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.FacetValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.FacetValue + * @static + * @param {google.cloud.visionai.v1alpha1.IFacetValue} message FacetValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FacetValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FacetValue message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.FacetValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.FacetValue} FacetValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FacetValue.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.FacetValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.stringValue = reader.string(); + break; + } + case 2: { + message.integerValue = reader.int64(); + break; + } + case 3: { + message.datetimeValue = $root.google.type.DateTime.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FacetValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.FacetValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.FacetValue} FacetValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FacetValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FacetValue message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.FacetValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FacetValue.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + properties.value = 1; + if (!$util.isString(message.stringValue)) + return "stringValue: string expected"; + } + if (message.integerValue != null && message.hasOwnProperty("integerValue")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + if (!$util.isInteger(message.integerValue) && !(message.integerValue && $util.isInteger(message.integerValue.low) && $util.isInteger(message.integerValue.high))) + return "integerValue: integer|Long expected"; + } + if (message.datetimeValue != null && message.hasOwnProperty("datetimeValue")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.type.DateTime.verify(message.datetimeValue, long + 1); + if (error) + return "datetimeValue." + error; + } + } + return null; + }; + + /** + * Creates a FacetValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.FacetValue + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.FacetValue} FacetValue + */ + FacetValue.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.FacetValue) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.FacetValue(); + if (object.stringValue != null) + message.stringValue = String(object.stringValue); + if (object.integerValue != null) + if ($util.Long) + (message.integerValue = $util.Long.fromValue(object.integerValue)).unsigned = false; + else if (typeof object.integerValue === "string") + message.integerValue = parseInt(object.integerValue, 10); + else if (typeof object.integerValue === "number") + message.integerValue = object.integerValue; + else if (typeof object.integerValue === "object") + message.integerValue = new $util.LongBits(object.integerValue.low >>> 0, object.integerValue.high >>> 0).toNumber(); + if (object.datetimeValue != null) { + if (typeof object.datetimeValue !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.FacetValue.datetimeValue: object expected"); + message.datetimeValue = $root.google.type.DateTime.fromObject(object.datetimeValue, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a FacetValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.FacetValue + * @static + * @param {google.cloud.visionai.v1alpha1.FacetValue} message FacetValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FacetValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + object.stringValue = message.stringValue; + if (options.oneofs) + object.value = "stringValue"; + } + if (message.integerValue != null && message.hasOwnProperty("integerValue")) { + if (typeof message.integerValue === "number") + object.integerValue = options.longs === String ? String(message.integerValue) : message.integerValue; + else + object.integerValue = options.longs === String ? $util.Long.prototype.toString.call(message.integerValue) : options.longs === Number ? new $util.LongBits(message.integerValue.low >>> 0, message.integerValue.high >>> 0).toNumber() : message.integerValue; + if (options.oneofs) + object.value = "integerValue"; + } + if (message.datetimeValue != null && message.hasOwnProperty("datetimeValue")) { + object.datetimeValue = $root.google.type.DateTime.toObject(message.datetimeValue, options); + if (options.oneofs) + object.value = "datetimeValue"; + } + return object; + }; + + /** + * Converts this FacetValue to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.FacetValue + * @instance + * @returns {Object.} JSON object + */ + FacetValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FacetValue + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.FacetValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FacetValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.FacetValue"; + }; + + return FacetValue; + })(); + + v1alpha1.FacetBucket = (function() { + + /** + * Properties of a FacetBucket. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IFacetBucket + * @property {google.cloud.visionai.v1alpha1.IFacetValue|null} [value] FacetBucket value + * @property {google.cloud.visionai.v1alpha1.FacetBucket.IRange|null} [range] FacetBucket range + * @property {boolean|null} [selected] FacetBucket selected + */ + + /** + * Constructs a new FacetBucket. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a FacetBucket. + * @implements IFacetBucket + * @constructor + * @param {google.cloud.visionai.v1alpha1.IFacetBucket=} [properties] Properties to set + */ + function FacetBucket(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FacetBucket value. + * @member {google.cloud.visionai.v1alpha1.IFacetValue|null|undefined} value + * @memberof google.cloud.visionai.v1alpha1.FacetBucket + * @instance + */ + FacetBucket.prototype.value = null; + + /** + * FacetBucket range. + * @member {google.cloud.visionai.v1alpha1.FacetBucket.IRange|null|undefined} range + * @memberof google.cloud.visionai.v1alpha1.FacetBucket + * @instance + */ + FacetBucket.prototype.range = null; + + /** + * FacetBucket selected. + * @member {boolean} selected + * @memberof google.cloud.visionai.v1alpha1.FacetBucket + * @instance + */ + FacetBucket.prototype.selected = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * FacetBucket bucketValue. + * @member {"value"|"range"|undefined} bucketValue + * @memberof google.cloud.visionai.v1alpha1.FacetBucket + * @instance + */ + Object.defineProperty(FacetBucket.prototype, "bucketValue", { + get: $util.oneOfGetter($oneOfFields = ["value", "range"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new FacetBucket instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.FacetBucket + * @static + * @param {google.cloud.visionai.v1alpha1.IFacetBucket=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.FacetBucket} FacetBucket instance + */ + FacetBucket.create = function create(properties) { + return new FacetBucket(properties); + }; + + /** + * Encodes the specified FacetBucket message. Does not implicitly {@link google.cloud.visionai.v1alpha1.FacetBucket.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.FacetBucket + * @static + * @param {google.cloud.visionai.v1alpha1.IFacetBucket} message FacetBucket message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FacetBucket.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + $root.google.cloud.visionai.v1alpha1.FacetValue.encode(message.value, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.selected != null && Object.hasOwnProperty.call(message, "selected")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.selected); + if (message.range != null && Object.hasOwnProperty.call(message, "range")) + $root.google.cloud.visionai.v1alpha1.FacetBucket.Range.encode(message.range, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FacetBucket message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.FacetBucket.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.FacetBucket + * @static + * @param {google.cloud.visionai.v1alpha1.IFacetBucket} message FacetBucket message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FacetBucket.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FacetBucket message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.FacetBucket + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.FacetBucket} FacetBucket + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FacetBucket.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.FacetBucket(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.value = $root.google.cloud.visionai.v1alpha1.FacetValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.range = $root.google.cloud.visionai.v1alpha1.FacetBucket.Range.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.selected = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FacetBucket message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.FacetBucket + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.FacetBucket} FacetBucket + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FacetBucket.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FacetBucket message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.FacetBucket + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FacetBucket.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.value != null && message.hasOwnProperty("value")) { + properties.bucketValue = 1; + { + var error = $root.google.cloud.visionai.v1alpha1.FacetValue.verify(message.value, long + 1); + if (error) + return "value." + error; + } + } + if (message.range != null && message.hasOwnProperty("range")) { + if (properties.bucketValue === 1) + return "bucketValue: multiple values"; + properties.bucketValue = 1; + { + var error = $root.google.cloud.visionai.v1alpha1.FacetBucket.Range.verify(message.range, long + 1); + if (error) + return "range." + error; + } + } + if (message.selected != null && message.hasOwnProperty("selected")) + if (typeof message.selected !== "boolean") + return "selected: boolean expected"; + return null; + }; + + /** + * Creates a FacetBucket message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.FacetBucket + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.FacetBucket} FacetBucket + */ + FacetBucket.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.FacetBucket) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.FacetBucket(); + if (object.value != null) { + if (typeof object.value !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.FacetBucket.value: object expected"); + message.value = $root.google.cloud.visionai.v1alpha1.FacetValue.fromObject(object.value, long + 1); + } + if (object.range != null) { + if (typeof object.range !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.FacetBucket.range: object expected"); + message.range = $root.google.cloud.visionai.v1alpha1.FacetBucket.Range.fromObject(object.range, long + 1); + } + if (object.selected != null) + message.selected = Boolean(object.selected); + return message; + }; + + /** + * Creates a plain object from a FacetBucket message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.FacetBucket + * @static + * @param {google.cloud.visionai.v1alpha1.FacetBucket} message FacetBucket + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FacetBucket.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.selected = false; + if (message.value != null && message.hasOwnProperty("value")) { + object.value = $root.google.cloud.visionai.v1alpha1.FacetValue.toObject(message.value, options); + if (options.oneofs) + object.bucketValue = "value"; + } + if (message.selected != null && message.hasOwnProperty("selected")) + object.selected = message.selected; + if (message.range != null && message.hasOwnProperty("range")) { + object.range = $root.google.cloud.visionai.v1alpha1.FacetBucket.Range.toObject(message.range, options); + if (options.oneofs) + object.bucketValue = "range"; + } + return object; + }; + + /** + * Converts this FacetBucket to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.FacetBucket + * @instance + * @returns {Object.} JSON object + */ + FacetBucket.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FacetBucket + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.FacetBucket + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FacetBucket.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.FacetBucket"; + }; + + FacetBucket.Range = (function() { + + /** + * Properties of a Range. + * @memberof google.cloud.visionai.v1alpha1.FacetBucket + * @interface IRange + * @property {google.cloud.visionai.v1alpha1.IFacetValue|null} [start] Range start + * @property {google.cloud.visionai.v1alpha1.IFacetValue|null} [end] Range end + */ + + /** + * Constructs a new Range. + * @memberof google.cloud.visionai.v1alpha1.FacetBucket + * @classdesc Represents a Range. + * @implements IRange + * @constructor + * @param {google.cloud.visionai.v1alpha1.FacetBucket.IRange=} [properties] Properties to set + */ + function Range(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Range start. + * @member {google.cloud.visionai.v1alpha1.IFacetValue|null|undefined} start + * @memberof google.cloud.visionai.v1alpha1.FacetBucket.Range + * @instance + */ + Range.prototype.start = null; + + /** + * Range end. + * @member {google.cloud.visionai.v1alpha1.IFacetValue|null|undefined} end + * @memberof google.cloud.visionai.v1alpha1.FacetBucket.Range + * @instance + */ + Range.prototype.end = null; + + /** + * Creates a new Range instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.FacetBucket.Range + * @static + * @param {google.cloud.visionai.v1alpha1.FacetBucket.IRange=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.FacetBucket.Range} Range instance + */ + Range.create = function create(properties) { + return new Range(properties); + }; + + /** + * Encodes the specified Range message. Does not implicitly {@link google.cloud.visionai.v1alpha1.FacetBucket.Range.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.FacetBucket.Range + * @static + * @param {google.cloud.visionai.v1alpha1.FacetBucket.IRange} message Range message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Range.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + $root.google.cloud.visionai.v1alpha1.FacetValue.encode(message.start, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + $root.google.cloud.visionai.v1alpha1.FacetValue.encode(message.end, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Range message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.FacetBucket.Range.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.FacetBucket.Range + * @static + * @param {google.cloud.visionai.v1alpha1.FacetBucket.IRange} message Range message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Range.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Range message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.FacetBucket.Range + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.FacetBucket.Range} Range + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Range.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.FacetBucket.Range(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = $root.google.cloud.visionai.v1alpha1.FacetValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.end = $root.google.cloud.visionai.v1alpha1.FacetValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Range message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.FacetBucket.Range + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.FacetBucket.Range} Range + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Range.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Range message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.FacetBucket.Range + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Range.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.start != null && message.hasOwnProperty("start")) { + var error = $root.google.cloud.visionai.v1alpha1.FacetValue.verify(message.start, long + 1); + if (error) + return "start." + error; + } + if (message.end != null && message.hasOwnProperty("end")) { + var error = $root.google.cloud.visionai.v1alpha1.FacetValue.verify(message.end, long + 1); + if (error) + return "end." + error; + } + return null; + }; + + /** + * Creates a Range message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.FacetBucket.Range + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.FacetBucket.Range} Range + */ + Range.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.FacetBucket.Range) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.FacetBucket.Range(); + if (object.start != null) { + if (typeof object.start !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.FacetBucket.Range.start: object expected"); + message.start = $root.google.cloud.visionai.v1alpha1.FacetValue.fromObject(object.start, long + 1); + } + if (object.end != null) { + if (typeof object.end !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.FacetBucket.Range.end: object expected"); + message.end = $root.google.cloud.visionai.v1alpha1.FacetValue.fromObject(object.end, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a Range message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.FacetBucket.Range + * @static + * @param {google.cloud.visionai.v1alpha1.FacetBucket.Range} message Range + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Range.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = null; + object.end = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = $root.google.cloud.visionai.v1alpha1.FacetValue.toObject(message.start, options); + if (message.end != null && message.hasOwnProperty("end")) + object.end = $root.google.cloud.visionai.v1alpha1.FacetValue.toObject(message.end, options); + return object; + }; + + /** + * Converts this Range to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.FacetBucket.Range + * @instance + * @returns {Object.} JSON object + */ + Range.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Range + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.FacetBucket.Range + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Range.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.FacetBucket.Range"; + }; + + return Range; + })(); + + return FacetBucket; + })(); + + v1alpha1.FacetGroup = (function() { + + /** + * Properties of a FacetGroup. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IFacetGroup + * @property {string|null} [facetId] FacetGroup facetId + * @property {string|null} [displayName] FacetGroup displayName + * @property {Array.|null} [buckets] FacetGroup buckets + * @property {google.cloud.visionai.v1alpha1.FacetBucketType|null} [bucketType] FacetGroup bucketType + * @property {boolean|null} [fetchMatchedAnnotations] FacetGroup fetchMatchedAnnotations + */ + + /** + * Constructs a new FacetGroup. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a FacetGroup. + * @implements IFacetGroup + * @constructor + * @param {google.cloud.visionai.v1alpha1.IFacetGroup=} [properties] Properties to set + */ + function FacetGroup(properties) { + this.buckets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FacetGroup facetId. + * @member {string} facetId + * @memberof google.cloud.visionai.v1alpha1.FacetGroup + * @instance + */ + FacetGroup.prototype.facetId = ""; + + /** + * FacetGroup displayName. + * @member {string} displayName + * @memberof google.cloud.visionai.v1alpha1.FacetGroup + * @instance + */ + FacetGroup.prototype.displayName = ""; + + /** + * FacetGroup buckets. + * @member {Array.} buckets + * @memberof google.cloud.visionai.v1alpha1.FacetGroup + * @instance + */ + FacetGroup.prototype.buckets = $util.emptyArray; + + /** + * FacetGroup bucketType. + * @member {google.cloud.visionai.v1alpha1.FacetBucketType} bucketType + * @memberof google.cloud.visionai.v1alpha1.FacetGroup + * @instance + */ + FacetGroup.prototype.bucketType = 0; + + /** + * FacetGroup fetchMatchedAnnotations. + * @member {boolean} fetchMatchedAnnotations + * @memberof google.cloud.visionai.v1alpha1.FacetGroup + * @instance + */ + FacetGroup.prototype.fetchMatchedAnnotations = false; + + /** + * Creates a new FacetGroup instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.FacetGroup + * @static + * @param {google.cloud.visionai.v1alpha1.IFacetGroup=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.FacetGroup} FacetGroup instance + */ + FacetGroup.create = function create(properties) { + return new FacetGroup(properties); + }; + + /** + * Encodes the specified FacetGroup message. Does not implicitly {@link google.cloud.visionai.v1alpha1.FacetGroup.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.FacetGroup + * @static + * @param {google.cloud.visionai.v1alpha1.IFacetGroup} message FacetGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FacetGroup.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.facetId != null && Object.hasOwnProperty.call(message, "facetId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.facetId); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.buckets != null && message.buckets.length) + for (var i = 0; i < message.buckets.length; ++i) + $root.google.cloud.visionai.v1alpha1.FacetBucket.encode(message.buckets[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.bucketType != null && Object.hasOwnProperty.call(message, "bucketType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.bucketType); + if (message.fetchMatchedAnnotations != null && Object.hasOwnProperty.call(message, "fetchMatchedAnnotations")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.fetchMatchedAnnotations); + return writer; + }; + + /** + * Encodes the specified FacetGroup message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.FacetGroup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.FacetGroup + * @static + * @param {google.cloud.visionai.v1alpha1.IFacetGroup} message FacetGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FacetGroup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FacetGroup message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.FacetGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.FacetGroup} FacetGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FacetGroup.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.FacetGroup(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.facetId = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + if (!(message.buckets && message.buckets.length)) + message.buckets = []; + message.buckets.push($root.google.cloud.visionai.v1alpha1.FacetBucket.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 4: { + message.bucketType = reader.int32(); + break; + } + case 5: { + message.fetchMatchedAnnotations = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FacetGroup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.FacetGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.FacetGroup} FacetGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FacetGroup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FacetGroup message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.FacetGroup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FacetGroup.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.facetId != null && message.hasOwnProperty("facetId")) + if (!$util.isString(message.facetId)) + return "facetId: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.buckets != null && message.hasOwnProperty("buckets")) { + if (!Array.isArray(message.buckets)) + return "buckets: array expected"; + for (var i = 0; i < message.buckets.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.FacetBucket.verify(message.buckets[i], long + 1); + if (error) + return "buckets." + error; + } + } + if (message.bucketType != null && message.hasOwnProperty("bucketType")) + switch (message.bucketType) { + default: + return "bucketType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.fetchMatchedAnnotations != null && message.hasOwnProperty("fetchMatchedAnnotations")) + if (typeof message.fetchMatchedAnnotations !== "boolean") + return "fetchMatchedAnnotations: boolean expected"; + return null; + }; + + /** + * Creates a FacetGroup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.FacetGroup + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.FacetGroup} FacetGroup + */ + FacetGroup.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.FacetGroup) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.FacetGroup(); + if (object.facetId != null) + message.facetId = String(object.facetId); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.buckets) { + if (!Array.isArray(object.buckets)) + throw TypeError(".google.cloud.visionai.v1alpha1.FacetGroup.buckets: array expected"); + message.buckets = []; + for (var i = 0; i < object.buckets.length; ++i) { + if (typeof object.buckets[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.FacetGroup.buckets: object expected"); + message.buckets[i] = $root.google.cloud.visionai.v1alpha1.FacetBucket.fromObject(object.buckets[i], long + 1); + } + } + switch (object.bucketType) { + default: + if (typeof object.bucketType === "number") { + message.bucketType = object.bucketType; + break; + } + break; + case "FACET_BUCKET_TYPE_UNSPECIFIED": + case 0: + message.bucketType = 0; + break; + case "FACET_BUCKET_TYPE_VALUE": + case 1: + message.bucketType = 1; + break; + case "FACET_BUCKET_TYPE_DATETIME": + case 2: + message.bucketType = 2; + break; + case "FACET_BUCKET_TYPE_FIXED_RANGE": + case 3: + message.bucketType = 3; + break; + case "FACET_BUCKET_TYPE_CUSTOM_RANGE": + case 4: + message.bucketType = 4; + break; + } + if (object.fetchMatchedAnnotations != null) + message.fetchMatchedAnnotations = Boolean(object.fetchMatchedAnnotations); + return message; + }; + + /** + * Creates a plain object from a FacetGroup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.FacetGroup + * @static + * @param {google.cloud.visionai.v1alpha1.FacetGroup} message FacetGroup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FacetGroup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.buckets = []; + if (options.defaults) { + object.facetId = ""; + object.displayName = ""; + object.bucketType = options.enums === String ? "FACET_BUCKET_TYPE_UNSPECIFIED" : 0; + object.fetchMatchedAnnotations = false; + } + if (message.facetId != null && message.hasOwnProperty("facetId")) + object.facetId = message.facetId; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.buckets && message.buckets.length) { + object.buckets = []; + for (var j = 0; j < message.buckets.length; ++j) + object.buckets[j] = $root.google.cloud.visionai.v1alpha1.FacetBucket.toObject(message.buckets[j], options); + } + if (message.bucketType != null && message.hasOwnProperty("bucketType")) + object.bucketType = options.enums === String ? $root.google.cloud.visionai.v1alpha1.FacetBucketType[message.bucketType] === undefined ? message.bucketType : $root.google.cloud.visionai.v1alpha1.FacetBucketType[message.bucketType] : message.bucketType; + if (message.fetchMatchedAnnotations != null && message.hasOwnProperty("fetchMatchedAnnotations")) + object.fetchMatchedAnnotations = message.fetchMatchedAnnotations; + return object; + }; + + /** + * Converts this FacetGroup to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.FacetGroup + * @instance + * @returns {Object.} JSON object + */ + FacetGroup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FacetGroup + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.FacetGroup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FacetGroup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.FacetGroup"; + }; + + return FacetGroup; + })(); + + v1alpha1.IngestAssetRequest = (function() { + + /** + * Properties of an IngestAssetRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IIngestAssetRequest + * @property {google.cloud.visionai.v1alpha1.IngestAssetRequest.IConfig|null} [config] IngestAssetRequest config + * @property {google.cloud.visionai.v1alpha1.IngestAssetRequest.ITimeIndexedData|null} [timeIndexedData] IngestAssetRequest timeIndexedData + */ + + /** + * Constructs a new IngestAssetRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents an IngestAssetRequest. + * @implements IIngestAssetRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IIngestAssetRequest=} [properties] Properties to set + */ + function IngestAssetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * IngestAssetRequest config. + * @member {google.cloud.visionai.v1alpha1.IngestAssetRequest.IConfig|null|undefined} config + * @memberof google.cloud.visionai.v1alpha1.IngestAssetRequest + * @instance + */ + IngestAssetRequest.prototype.config = null; + + /** + * IngestAssetRequest timeIndexedData. + * @member {google.cloud.visionai.v1alpha1.IngestAssetRequest.ITimeIndexedData|null|undefined} timeIndexedData + * @memberof google.cloud.visionai.v1alpha1.IngestAssetRequest + * @instance + */ + IngestAssetRequest.prototype.timeIndexedData = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * IngestAssetRequest streamingRequest. + * @member {"config"|"timeIndexedData"|undefined} streamingRequest + * @memberof google.cloud.visionai.v1alpha1.IngestAssetRequest + * @instance + */ + Object.defineProperty(IngestAssetRequest.prototype, "streamingRequest", { + get: $util.oneOfGetter($oneOfFields = ["config", "timeIndexedData"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new IngestAssetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.IngestAssetRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IIngestAssetRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.IngestAssetRequest} IngestAssetRequest instance + */ + IngestAssetRequest.create = function create(properties) { + return new IngestAssetRequest(properties); + }; + + /** + * Encodes the specified IngestAssetRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.IngestAssetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.IngestAssetRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IIngestAssetRequest} message IngestAssetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IngestAssetRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.encode(message.config, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.timeIndexedData != null && Object.hasOwnProperty.call(message, "timeIndexedData")) + $root.google.cloud.visionai.v1alpha1.IngestAssetRequest.TimeIndexedData.encode(message.timeIndexedData, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IngestAssetRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.IngestAssetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.IngestAssetRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IIngestAssetRequest} message IngestAssetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IngestAssetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IngestAssetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.IngestAssetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.IngestAssetRequest} IngestAssetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IngestAssetRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.IngestAssetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.config = $root.google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.timeIndexedData = $root.google.cloud.visionai.v1alpha1.IngestAssetRequest.TimeIndexedData.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an IngestAssetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.IngestAssetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.IngestAssetRequest} IngestAssetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IngestAssetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IngestAssetRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.IngestAssetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IngestAssetRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.config != null && message.hasOwnProperty("config")) { + properties.streamingRequest = 1; + { + var error = $root.google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.verify(message.config, long + 1); + if (error) + return "config." + error; + } + } + if (message.timeIndexedData != null && message.hasOwnProperty("timeIndexedData")) { + if (properties.streamingRequest === 1) + return "streamingRequest: multiple values"; + properties.streamingRequest = 1; + { + var error = $root.google.cloud.visionai.v1alpha1.IngestAssetRequest.TimeIndexedData.verify(message.timeIndexedData, long + 1); + if (error) + return "timeIndexedData." + error; + } + } + return null; + }; + + /** + * Creates an IngestAssetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.IngestAssetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.IngestAssetRequest} IngestAssetRequest + */ + IngestAssetRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.IngestAssetRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.IngestAssetRequest(); + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.IngestAssetRequest.config: object expected"); + message.config = $root.google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.fromObject(object.config, long + 1); + } + if (object.timeIndexedData != null) { + if (typeof object.timeIndexedData !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.IngestAssetRequest.timeIndexedData: object expected"); + message.timeIndexedData = $root.google.cloud.visionai.v1alpha1.IngestAssetRequest.TimeIndexedData.fromObject(object.timeIndexedData, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an IngestAssetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.IngestAssetRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IngestAssetRequest} message IngestAssetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IngestAssetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.config != null && message.hasOwnProperty("config")) { + object.config = $root.google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.toObject(message.config, options); + if (options.oneofs) + object.streamingRequest = "config"; + } + if (message.timeIndexedData != null && message.hasOwnProperty("timeIndexedData")) { + object.timeIndexedData = $root.google.cloud.visionai.v1alpha1.IngestAssetRequest.TimeIndexedData.toObject(message.timeIndexedData, options); + if (options.oneofs) + object.streamingRequest = "timeIndexedData"; + } + return object; + }; + + /** + * Converts this IngestAssetRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.IngestAssetRequest + * @instance + * @returns {Object.} JSON object + */ + IngestAssetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IngestAssetRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.IngestAssetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IngestAssetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.IngestAssetRequest"; + }; + + IngestAssetRequest.Config = (function() { + + /** + * Properties of a Config. + * @memberof google.cloud.visionai.v1alpha1.IngestAssetRequest + * @interface IConfig + * @property {google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.IVideoType|null} [videoType] Config videoType + * @property {string|null} [asset] Config asset + */ + + /** + * Constructs a new Config. + * @memberof google.cloud.visionai.v1alpha1.IngestAssetRequest + * @classdesc Represents a Config. + * @implements IConfig + * @constructor + * @param {google.cloud.visionai.v1alpha1.IngestAssetRequest.IConfig=} [properties] Properties to set + */ + function Config(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Config videoType. + * @member {google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.IVideoType|null|undefined} videoType + * @memberof google.cloud.visionai.v1alpha1.IngestAssetRequest.Config + * @instance + */ + Config.prototype.videoType = null; + + /** + * Config asset. + * @member {string} asset + * @memberof google.cloud.visionai.v1alpha1.IngestAssetRequest.Config + * @instance + */ + Config.prototype.asset = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Config dataType. + * @member {"videoType"|undefined} dataType + * @memberof google.cloud.visionai.v1alpha1.IngestAssetRequest.Config + * @instance + */ + Object.defineProperty(Config.prototype, "dataType", { + get: $util.oneOfGetter($oneOfFields = ["videoType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Config instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.IngestAssetRequest.Config + * @static + * @param {google.cloud.visionai.v1alpha1.IngestAssetRequest.IConfig=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.IngestAssetRequest.Config} Config instance + */ + Config.create = function create(properties) { + return new Config(properties); + }; + + /** + * Encodes the specified Config message. Does not implicitly {@link google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.IngestAssetRequest.Config + * @static + * @param {google.cloud.visionai.v1alpha1.IngestAssetRequest.IConfig} message Config message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Config.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.asset != null && Object.hasOwnProperty.call(message, "asset")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.asset); + if (message.videoType != null && Object.hasOwnProperty.call(message, "videoType")) + $root.google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.VideoType.encode(message.videoType, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Config message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.IngestAssetRequest.Config + * @static + * @param {google.cloud.visionai.v1alpha1.IngestAssetRequest.IConfig} message Config message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Config.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Config message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.IngestAssetRequest.Config + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.IngestAssetRequest.Config} Config + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Config.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.IngestAssetRequest.Config(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.videoType = $root.google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.VideoType.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 1: { + message.asset = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Config message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.IngestAssetRequest.Config + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.IngestAssetRequest.Config} Config + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Config.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Config message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.IngestAssetRequest.Config + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Config.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.videoType != null && message.hasOwnProperty("videoType")) { + properties.dataType = 1; + { + var error = $root.google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.VideoType.verify(message.videoType, long + 1); + if (error) + return "videoType." + error; + } + } + if (message.asset != null && message.hasOwnProperty("asset")) + if (!$util.isString(message.asset)) + return "asset: string expected"; + return null; + }; + + /** + * Creates a Config message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.IngestAssetRequest.Config + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.IngestAssetRequest.Config} Config + */ + Config.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.IngestAssetRequest.Config) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.IngestAssetRequest.Config(); + if (object.videoType != null) { + if (typeof object.videoType !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.videoType: object expected"); + message.videoType = $root.google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.VideoType.fromObject(object.videoType, long + 1); + } + if (object.asset != null) + message.asset = String(object.asset); + return message; + }; + + /** + * Creates a plain object from a Config message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.IngestAssetRequest.Config + * @static + * @param {google.cloud.visionai.v1alpha1.IngestAssetRequest.Config} message Config + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Config.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.asset = ""; + if (message.asset != null && message.hasOwnProperty("asset")) + object.asset = message.asset; + if (message.videoType != null && message.hasOwnProperty("videoType")) { + object.videoType = $root.google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.VideoType.toObject(message.videoType, options); + if (options.oneofs) + object.dataType = "videoType"; + } + return object; + }; + + /** + * Converts this Config to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.IngestAssetRequest.Config + * @instance + * @returns {Object.} JSON object + */ + Config.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Config + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.IngestAssetRequest.Config + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Config.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.IngestAssetRequest.Config"; + }; + + Config.VideoType = (function() { + + /** + * Properties of a VideoType. + * @memberof google.cloud.visionai.v1alpha1.IngestAssetRequest.Config + * @interface IVideoType + * @property {google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.VideoType.ContainerFormat|null} [containerFormat] VideoType containerFormat + */ + + /** + * Constructs a new VideoType. + * @memberof google.cloud.visionai.v1alpha1.IngestAssetRequest.Config + * @classdesc Represents a VideoType. + * @implements IVideoType + * @constructor + * @param {google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.IVideoType=} [properties] Properties to set + */ + function VideoType(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * VideoType containerFormat. + * @member {google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.VideoType.ContainerFormat} containerFormat + * @memberof google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.VideoType + * @instance + */ + VideoType.prototype.containerFormat = 0; + + /** + * Creates a new VideoType instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.VideoType + * @static + * @param {google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.IVideoType=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.VideoType} VideoType instance + */ + VideoType.create = function create(properties) { + return new VideoType(properties); + }; + + /** + * Encodes the specified VideoType message. Does not implicitly {@link google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.VideoType.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.VideoType + * @static + * @param {google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.IVideoType} message VideoType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoType.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.containerFormat != null && Object.hasOwnProperty.call(message, "containerFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.containerFormat); + return writer; + }; + + /** + * Encodes the specified VideoType message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.VideoType.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.VideoType + * @static + * @param {google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.IVideoType} message VideoType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoType.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VideoType message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.VideoType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.VideoType} VideoType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoType.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.VideoType(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.containerFormat = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a VideoType message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.VideoType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.VideoType} VideoType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoType.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VideoType message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.VideoType + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VideoType.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.containerFormat != null && message.hasOwnProperty("containerFormat")) + switch (message.containerFormat) { + default: + return "containerFormat: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates a VideoType message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.VideoType + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.VideoType} VideoType + */ + VideoType.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.VideoType) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.VideoType(); + switch (object.containerFormat) { + default: + if (typeof object.containerFormat === "number") { + message.containerFormat = object.containerFormat; + break; + } + break; + case "CONTAINER_FORMAT_UNSPECIFIED": + case 0: + message.containerFormat = 0; + break; + case "CONTAINER_FORMAT_MP4": + case 1: + message.containerFormat = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a VideoType message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.VideoType + * @static + * @param {google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.VideoType} message VideoType + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VideoType.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.containerFormat = options.enums === String ? "CONTAINER_FORMAT_UNSPECIFIED" : 0; + if (message.containerFormat != null && message.hasOwnProperty("containerFormat")) + object.containerFormat = options.enums === String ? $root.google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.VideoType.ContainerFormat[message.containerFormat] === undefined ? message.containerFormat : $root.google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.VideoType.ContainerFormat[message.containerFormat] : message.containerFormat; + return object; + }; + + /** + * Converts this VideoType to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.VideoType + * @instance + * @returns {Object.} JSON object + */ + VideoType.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VideoType + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.VideoType + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VideoType.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.VideoType"; + }; + + /** + * ContainerFormat enum. + * @name google.cloud.visionai.v1alpha1.IngestAssetRequest.Config.VideoType.ContainerFormat + * @enum {number} + * @property {number} CONTAINER_FORMAT_UNSPECIFIED=0 CONTAINER_FORMAT_UNSPECIFIED value + * @property {number} CONTAINER_FORMAT_MP4=1 CONTAINER_FORMAT_MP4 value + */ + VideoType.ContainerFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONTAINER_FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "CONTAINER_FORMAT_MP4"] = 1; + return values; + })(); + + return VideoType; + })(); + + return Config; + })(); + + IngestAssetRequest.TimeIndexedData = (function() { + + /** + * Properties of a TimeIndexedData. + * @memberof google.cloud.visionai.v1alpha1.IngestAssetRequest + * @interface ITimeIndexedData + * @property {Uint8Array|null} [data] TimeIndexedData data + * @property {google.cloud.visionai.v1alpha1.Partition.ITemporalPartition|null} [temporalPartition] TimeIndexedData temporalPartition + */ + + /** + * Constructs a new TimeIndexedData. + * @memberof google.cloud.visionai.v1alpha1.IngestAssetRequest + * @classdesc Represents a TimeIndexedData. + * @implements ITimeIndexedData + * @constructor + * @param {google.cloud.visionai.v1alpha1.IngestAssetRequest.ITimeIndexedData=} [properties] Properties to set + */ + function TimeIndexedData(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TimeIndexedData data. + * @member {Uint8Array} data + * @memberof google.cloud.visionai.v1alpha1.IngestAssetRequest.TimeIndexedData + * @instance + */ + TimeIndexedData.prototype.data = $util.newBuffer([]); + + /** + * TimeIndexedData temporalPartition. + * @member {google.cloud.visionai.v1alpha1.Partition.ITemporalPartition|null|undefined} temporalPartition + * @memberof google.cloud.visionai.v1alpha1.IngestAssetRequest.TimeIndexedData + * @instance + */ + TimeIndexedData.prototype.temporalPartition = null; + + /** + * Creates a new TimeIndexedData instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.IngestAssetRequest.TimeIndexedData + * @static + * @param {google.cloud.visionai.v1alpha1.IngestAssetRequest.ITimeIndexedData=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.IngestAssetRequest.TimeIndexedData} TimeIndexedData instance + */ + TimeIndexedData.create = function create(properties) { + return new TimeIndexedData(properties); + }; + + /** + * Encodes the specified TimeIndexedData message. Does not implicitly {@link google.cloud.visionai.v1alpha1.IngestAssetRequest.TimeIndexedData.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.IngestAssetRequest.TimeIndexedData + * @static + * @param {google.cloud.visionai.v1alpha1.IngestAssetRequest.ITimeIndexedData} message TimeIndexedData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeIndexedData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.data); + if (message.temporalPartition != null && Object.hasOwnProperty.call(message, "temporalPartition")) + $root.google.cloud.visionai.v1alpha1.Partition.TemporalPartition.encode(message.temporalPartition, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TimeIndexedData message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.IngestAssetRequest.TimeIndexedData.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.IngestAssetRequest.TimeIndexedData + * @static + * @param {google.cloud.visionai.v1alpha1.IngestAssetRequest.ITimeIndexedData} message TimeIndexedData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeIndexedData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimeIndexedData message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.IngestAssetRequest.TimeIndexedData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.IngestAssetRequest.TimeIndexedData} TimeIndexedData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeIndexedData.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.IngestAssetRequest.TimeIndexedData(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.data = reader.bytes(); + break; + } + case 2: { + message.temporalPartition = $root.google.cloud.visionai.v1alpha1.Partition.TemporalPartition.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TimeIndexedData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.IngestAssetRequest.TimeIndexedData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.IngestAssetRequest.TimeIndexedData} TimeIndexedData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeIndexedData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimeIndexedData message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.IngestAssetRequest.TimeIndexedData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimeIndexedData.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.data != null && message.hasOwnProperty("data")) + if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) + return "data: buffer expected"; + if (message.temporalPartition != null && message.hasOwnProperty("temporalPartition")) { + var error = $root.google.cloud.visionai.v1alpha1.Partition.TemporalPartition.verify(message.temporalPartition, long + 1); + if (error) + return "temporalPartition." + error; + } + return null; + }; + + /** + * Creates a TimeIndexedData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.IngestAssetRequest.TimeIndexedData + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.IngestAssetRequest.TimeIndexedData} TimeIndexedData + */ + TimeIndexedData.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.IngestAssetRequest.TimeIndexedData) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.IngestAssetRequest.TimeIndexedData(); + if (object.data != null) + if (typeof object.data === "string") + $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); + else if (object.data.length >= 0) + message.data = object.data; + if (object.temporalPartition != null) { + if (typeof object.temporalPartition !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.IngestAssetRequest.TimeIndexedData.temporalPartition: object expected"); + message.temporalPartition = $root.google.cloud.visionai.v1alpha1.Partition.TemporalPartition.fromObject(object.temporalPartition, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a TimeIndexedData message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.IngestAssetRequest.TimeIndexedData + * @static + * @param {google.cloud.visionai.v1alpha1.IngestAssetRequest.TimeIndexedData} message TimeIndexedData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimeIndexedData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.data = ""; + else { + object.data = []; + if (options.bytes !== Array) + object.data = $util.newBuffer(object.data); + } + object.temporalPartition = null; + } + if (message.data != null && message.hasOwnProperty("data")) + object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; + if (message.temporalPartition != null && message.hasOwnProperty("temporalPartition")) + object.temporalPartition = $root.google.cloud.visionai.v1alpha1.Partition.TemporalPartition.toObject(message.temporalPartition, options); + return object; + }; + + /** + * Converts this TimeIndexedData to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.IngestAssetRequest.TimeIndexedData + * @instance + * @returns {Object.} JSON object + */ + TimeIndexedData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TimeIndexedData + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.IngestAssetRequest.TimeIndexedData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimeIndexedData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.IngestAssetRequest.TimeIndexedData"; + }; + + return TimeIndexedData; + })(); + + return IngestAssetRequest; + })(); + + v1alpha1.IngestAssetResponse = (function() { + + /** + * Properties of an IngestAssetResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IIngestAssetResponse + * @property {google.cloud.visionai.v1alpha1.Partition.ITemporalPartition|null} [successfullyIngestedPartition] IngestAssetResponse successfullyIngestedPartition + */ + + /** + * Constructs a new IngestAssetResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents an IngestAssetResponse. + * @implements IIngestAssetResponse + * @constructor + * @param {google.cloud.visionai.v1alpha1.IIngestAssetResponse=} [properties] Properties to set + */ + function IngestAssetResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * IngestAssetResponse successfullyIngestedPartition. + * @member {google.cloud.visionai.v1alpha1.Partition.ITemporalPartition|null|undefined} successfullyIngestedPartition + * @memberof google.cloud.visionai.v1alpha1.IngestAssetResponse + * @instance + */ + IngestAssetResponse.prototype.successfullyIngestedPartition = null; + + /** + * Creates a new IngestAssetResponse instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.IngestAssetResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IIngestAssetResponse=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.IngestAssetResponse} IngestAssetResponse instance + */ + IngestAssetResponse.create = function create(properties) { + return new IngestAssetResponse(properties); + }; + + /** + * Encodes the specified IngestAssetResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.IngestAssetResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.IngestAssetResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IIngestAssetResponse} message IngestAssetResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IngestAssetResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.successfullyIngestedPartition != null && Object.hasOwnProperty.call(message, "successfullyIngestedPartition")) + $root.google.cloud.visionai.v1alpha1.Partition.TemporalPartition.encode(message.successfullyIngestedPartition, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IngestAssetResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.IngestAssetResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.IngestAssetResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IIngestAssetResponse} message IngestAssetResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IngestAssetResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IngestAssetResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.IngestAssetResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.IngestAssetResponse} IngestAssetResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IngestAssetResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.IngestAssetResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.successfullyIngestedPartition = $root.google.cloud.visionai.v1alpha1.Partition.TemporalPartition.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an IngestAssetResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.IngestAssetResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.IngestAssetResponse} IngestAssetResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IngestAssetResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IngestAssetResponse message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.IngestAssetResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IngestAssetResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.successfullyIngestedPartition != null && message.hasOwnProperty("successfullyIngestedPartition")) { + var error = $root.google.cloud.visionai.v1alpha1.Partition.TemporalPartition.verify(message.successfullyIngestedPartition, long + 1); + if (error) + return "successfullyIngestedPartition." + error; + } + return null; + }; + + /** + * Creates an IngestAssetResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.IngestAssetResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.IngestAssetResponse} IngestAssetResponse + */ + IngestAssetResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.IngestAssetResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.IngestAssetResponse(); + if (object.successfullyIngestedPartition != null) { + if (typeof object.successfullyIngestedPartition !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.IngestAssetResponse.successfullyIngestedPartition: object expected"); + message.successfullyIngestedPartition = $root.google.cloud.visionai.v1alpha1.Partition.TemporalPartition.fromObject(object.successfullyIngestedPartition, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an IngestAssetResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.IngestAssetResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IngestAssetResponse} message IngestAssetResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IngestAssetResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.successfullyIngestedPartition = null; + if (message.successfullyIngestedPartition != null && message.hasOwnProperty("successfullyIngestedPartition")) + object.successfullyIngestedPartition = $root.google.cloud.visionai.v1alpha1.Partition.TemporalPartition.toObject(message.successfullyIngestedPartition, options); + return object; + }; + + /** + * Converts this IngestAssetResponse to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.IngestAssetResponse + * @instance + * @returns {Object.} JSON object + */ + IngestAssetResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IngestAssetResponse + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.IngestAssetResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IngestAssetResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.IngestAssetResponse"; + }; + + return IngestAssetResponse; + })(); + + v1alpha1.ClipAssetRequest = (function() { + + /** + * Properties of a ClipAssetRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IClipAssetRequest + * @property {string|null} [name] ClipAssetRequest name + * @property {google.cloud.visionai.v1alpha1.Partition.ITemporalPartition|null} [temporalPartition] ClipAssetRequest temporalPartition + */ + + /** + * Constructs a new ClipAssetRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a ClipAssetRequest. + * @implements IClipAssetRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IClipAssetRequest=} [properties] Properties to set + */ + function ClipAssetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClipAssetRequest name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.ClipAssetRequest + * @instance + */ + ClipAssetRequest.prototype.name = ""; + + /** + * ClipAssetRequest temporalPartition. + * @member {google.cloud.visionai.v1alpha1.Partition.ITemporalPartition|null|undefined} temporalPartition + * @memberof google.cloud.visionai.v1alpha1.ClipAssetRequest + * @instance + */ + ClipAssetRequest.prototype.temporalPartition = null; + + /** + * Creates a new ClipAssetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ClipAssetRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IClipAssetRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ClipAssetRequest} ClipAssetRequest instance + */ + ClipAssetRequest.create = function create(properties) { + return new ClipAssetRequest(properties); + }; + + /** + * Encodes the specified ClipAssetRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ClipAssetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ClipAssetRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IClipAssetRequest} message ClipAssetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClipAssetRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.temporalPartition != null && Object.hasOwnProperty.call(message, "temporalPartition")) + $root.google.cloud.visionai.v1alpha1.Partition.TemporalPartition.encode(message.temporalPartition, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClipAssetRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ClipAssetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ClipAssetRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IClipAssetRequest} message ClipAssetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClipAssetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClipAssetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ClipAssetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ClipAssetRequest} ClipAssetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClipAssetRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ClipAssetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.temporalPartition = $root.google.cloud.visionai.v1alpha1.Partition.TemporalPartition.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ClipAssetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ClipAssetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ClipAssetRequest} ClipAssetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClipAssetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClipAssetRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ClipAssetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClipAssetRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.temporalPartition != null && message.hasOwnProperty("temporalPartition")) { + var error = $root.google.cloud.visionai.v1alpha1.Partition.TemporalPartition.verify(message.temporalPartition, long + 1); + if (error) + return "temporalPartition." + error; + } + return null; + }; + + /** + * Creates a ClipAssetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ClipAssetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ClipAssetRequest} ClipAssetRequest + */ + ClipAssetRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ClipAssetRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ClipAssetRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.temporalPartition != null) { + if (typeof object.temporalPartition !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ClipAssetRequest.temporalPartition: object expected"); + message.temporalPartition = $root.google.cloud.visionai.v1alpha1.Partition.TemporalPartition.fromObject(object.temporalPartition, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a ClipAssetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ClipAssetRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ClipAssetRequest} message ClipAssetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClipAssetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.temporalPartition = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.temporalPartition != null && message.hasOwnProperty("temporalPartition")) + object.temporalPartition = $root.google.cloud.visionai.v1alpha1.Partition.TemporalPartition.toObject(message.temporalPartition, options); + return object; + }; + + /** + * Converts this ClipAssetRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ClipAssetRequest + * @instance + * @returns {Object.} JSON object + */ + ClipAssetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClipAssetRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ClipAssetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClipAssetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ClipAssetRequest"; + }; + + return ClipAssetRequest; + })(); + + v1alpha1.ClipAssetResponse = (function() { + + /** + * Properties of a ClipAssetResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IClipAssetResponse + * @property {Array.|null} [timeIndexedUris] ClipAssetResponse timeIndexedUris + */ + + /** + * Constructs a new ClipAssetResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a ClipAssetResponse. + * @implements IClipAssetResponse + * @constructor + * @param {google.cloud.visionai.v1alpha1.IClipAssetResponse=} [properties] Properties to set + */ + function ClipAssetResponse(properties) { + this.timeIndexedUris = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClipAssetResponse timeIndexedUris. + * @member {Array.} timeIndexedUris + * @memberof google.cloud.visionai.v1alpha1.ClipAssetResponse + * @instance + */ + ClipAssetResponse.prototype.timeIndexedUris = $util.emptyArray; + + /** + * Creates a new ClipAssetResponse instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ClipAssetResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IClipAssetResponse=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ClipAssetResponse} ClipAssetResponse instance + */ + ClipAssetResponse.create = function create(properties) { + return new ClipAssetResponse(properties); + }; + + /** + * Encodes the specified ClipAssetResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ClipAssetResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ClipAssetResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IClipAssetResponse} message ClipAssetResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClipAssetResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.timeIndexedUris != null && message.timeIndexedUris.length) + for (var i = 0; i < message.timeIndexedUris.length; ++i) + $root.google.cloud.visionai.v1alpha1.ClipAssetResponse.TimeIndexedUri.encode(message.timeIndexedUris[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClipAssetResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ClipAssetResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ClipAssetResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IClipAssetResponse} message ClipAssetResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClipAssetResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClipAssetResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ClipAssetResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ClipAssetResponse} ClipAssetResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClipAssetResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ClipAssetResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.timeIndexedUris && message.timeIndexedUris.length)) + message.timeIndexedUris = []; + message.timeIndexedUris.push($root.google.cloud.visionai.v1alpha1.ClipAssetResponse.TimeIndexedUri.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ClipAssetResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ClipAssetResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ClipAssetResponse} ClipAssetResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClipAssetResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClipAssetResponse message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ClipAssetResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClipAssetResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.timeIndexedUris != null && message.hasOwnProperty("timeIndexedUris")) { + if (!Array.isArray(message.timeIndexedUris)) + return "timeIndexedUris: array expected"; + for (var i = 0; i < message.timeIndexedUris.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.ClipAssetResponse.TimeIndexedUri.verify(message.timeIndexedUris[i], long + 1); + if (error) + return "timeIndexedUris." + error; + } + } + return null; + }; + + /** + * Creates a ClipAssetResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ClipAssetResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ClipAssetResponse} ClipAssetResponse + */ + ClipAssetResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ClipAssetResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ClipAssetResponse(); + if (object.timeIndexedUris) { + if (!Array.isArray(object.timeIndexedUris)) + throw TypeError(".google.cloud.visionai.v1alpha1.ClipAssetResponse.timeIndexedUris: array expected"); + message.timeIndexedUris = []; + for (var i = 0; i < object.timeIndexedUris.length; ++i) { + if (typeof object.timeIndexedUris[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ClipAssetResponse.timeIndexedUris: object expected"); + message.timeIndexedUris[i] = $root.google.cloud.visionai.v1alpha1.ClipAssetResponse.TimeIndexedUri.fromObject(object.timeIndexedUris[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a ClipAssetResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ClipAssetResponse + * @static + * @param {google.cloud.visionai.v1alpha1.ClipAssetResponse} message ClipAssetResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClipAssetResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.timeIndexedUris = []; + if (message.timeIndexedUris && message.timeIndexedUris.length) { + object.timeIndexedUris = []; + for (var j = 0; j < message.timeIndexedUris.length; ++j) + object.timeIndexedUris[j] = $root.google.cloud.visionai.v1alpha1.ClipAssetResponse.TimeIndexedUri.toObject(message.timeIndexedUris[j], options); + } + return object; + }; + + /** + * Converts this ClipAssetResponse to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ClipAssetResponse + * @instance + * @returns {Object.} JSON object + */ + ClipAssetResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClipAssetResponse + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ClipAssetResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClipAssetResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ClipAssetResponse"; + }; + + ClipAssetResponse.TimeIndexedUri = (function() { + + /** + * Properties of a TimeIndexedUri. + * @memberof google.cloud.visionai.v1alpha1.ClipAssetResponse + * @interface ITimeIndexedUri + * @property {google.cloud.visionai.v1alpha1.Partition.ITemporalPartition|null} [temporalPartition] TimeIndexedUri temporalPartition + * @property {string|null} [uri] TimeIndexedUri uri + */ + + /** + * Constructs a new TimeIndexedUri. + * @memberof google.cloud.visionai.v1alpha1.ClipAssetResponse + * @classdesc Represents a TimeIndexedUri. + * @implements ITimeIndexedUri + * @constructor + * @param {google.cloud.visionai.v1alpha1.ClipAssetResponse.ITimeIndexedUri=} [properties] Properties to set + */ + function TimeIndexedUri(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TimeIndexedUri temporalPartition. + * @member {google.cloud.visionai.v1alpha1.Partition.ITemporalPartition|null|undefined} temporalPartition + * @memberof google.cloud.visionai.v1alpha1.ClipAssetResponse.TimeIndexedUri + * @instance + */ + TimeIndexedUri.prototype.temporalPartition = null; + + /** + * TimeIndexedUri uri. + * @member {string} uri + * @memberof google.cloud.visionai.v1alpha1.ClipAssetResponse.TimeIndexedUri + * @instance + */ + TimeIndexedUri.prototype.uri = ""; + + /** + * Creates a new TimeIndexedUri instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.ClipAssetResponse.TimeIndexedUri + * @static + * @param {google.cloud.visionai.v1alpha1.ClipAssetResponse.ITimeIndexedUri=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.ClipAssetResponse.TimeIndexedUri} TimeIndexedUri instance + */ + TimeIndexedUri.create = function create(properties) { + return new TimeIndexedUri(properties); + }; + + /** + * Encodes the specified TimeIndexedUri message. Does not implicitly {@link google.cloud.visionai.v1alpha1.ClipAssetResponse.TimeIndexedUri.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.ClipAssetResponse.TimeIndexedUri + * @static + * @param {google.cloud.visionai.v1alpha1.ClipAssetResponse.ITimeIndexedUri} message TimeIndexedUri message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeIndexedUri.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.temporalPartition != null && Object.hasOwnProperty.call(message, "temporalPartition")) + $root.google.cloud.visionai.v1alpha1.Partition.TemporalPartition.encode(message.temporalPartition, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uri); + return writer; + }; + + /** + * Encodes the specified TimeIndexedUri message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.ClipAssetResponse.TimeIndexedUri.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ClipAssetResponse.TimeIndexedUri + * @static + * @param {google.cloud.visionai.v1alpha1.ClipAssetResponse.ITimeIndexedUri} message TimeIndexedUri message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeIndexedUri.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimeIndexedUri message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.ClipAssetResponse.TimeIndexedUri + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.ClipAssetResponse.TimeIndexedUri} TimeIndexedUri + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeIndexedUri.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.ClipAssetResponse.TimeIndexedUri(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.temporalPartition = $root.google.cloud.visionai.v1alpha1.Partition.TemporalPartition.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.uri = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TimeIndexedUri message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.ClipAssetResponse.TimeIndexedUri + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.ClipAssetResponse.TimeIndexedUri} TimeIndexedUri + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeIndexedUri.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimeIndexedUri message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.ClipAssetResponse.TimeIndexedUri + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimeIndexedUri.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.temporalPartition != null && message.hasOwnProperty("temporalPartition")) { + var error = $root.google.cloud.visionai.v1alpha1.Partition.TemporalPartition.verify(message.temporalPartition, long + 1); + if (error) + return "temporalPartition." + error; + } + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + return null; + }; + + /** + * Creates a TimeIndexedUri message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.ClipAssetResponse.TimeIndexedUri + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.ClipAssetResponse.TimeIndexedUri} TimeIndexedUri + */ + TimeIndexedUri.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.ClipAssetResponse.TimeIndexedUri) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.ClipAssetResponse.TimeIndexedUri(); + if (object.temporalPartition != null) { + if (typeof object.temporalPartition !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.ClipAssetResponse.TimeIndexedUri.temporalPartition: object expected"); + message.temporalPartition = $root.google.cloud.visionai.v1alpha1.Partition.TemporalPartition.fromObject(object.temporalPartition, long + 1); + } + if (object.uri != null) + message.uri = String(object.uri); + return message; + }; + + /** + * Creates a plain object from a TimeIndexedUri message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.ClipAssetResponse.TimeIndexedUri + * @static + * @param {google.cloud.visionai.v1alpha1.ClipAssetResponse.TimeIndexedUri} message TimeIndexedUri + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimeIndexedUri.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.temporalPartition = null; + object.uri = ""; + } + if (message.temporalPartition != null && message.hasOwnProperty("temporalPartition")) + object.temporalPartition = $root.google.cloud.visionai.v1alpha1.Partition.TemporalPartition.toObject(message.temporalPartition, options); + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + return object; + }; + + /** + * Converts this TimeIndexedUri to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.ClipAssetResponse.TimeIndexedUri + * @instance + * @returns {Object.} JSON object + */ + TimeIndexedUri.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TimeIndexedUri + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.ClipAssetResponse.TimeIndexedUri + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimeIndexedUri.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.ClipAssetResponse.TimeIndexedUri"; + }; + + return TimeIndexedUri; + })(); + + return ClipAssetResponse; + })(); + + v1alpha1.GenerateHlsUriRequest = (function() { + + /** + * Properties of a GenerateHlsUriRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IGenerateHlsUriRequest + * @property {string|null} [name] GenerateHlsUriRequest name + * @property {Array.|null} [temporalPartitions] GenerateHlsUriRequest temporalPartitions + */ + + /** + * Constructs a new GenerateHlsUriRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a GenerateHlsUriRequest. + * @implements IGenerateHlsUriRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.IGenerateHlsUriRequest=} [properties] Properties to set + */ + function GenerateHlsUriRequest(properties) { + this.temporalPartitions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerateHlsUriRequest name. + * @member {string} name + * @memberof google.cloud.visionai.v1alpha1.GenerateHlsUriRequest + * @instance + */ + GenerateHlsUriRequest.prototype.name = ""; + + /** + * GenerateHlsUriRequest temporalPartitions. + * @member {Array.} temporalPartitions + * @memberof google.cloud.visionai.v1alpha1.GenerateHlsUriRequest + * @instance + */ + GenerateHlsUriRequest.prototype.temporalPartitions = $util.emptyArray; + + /** + * Creates a new GenerateHlsUriRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.GenerateHlsUriRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IGenerateHlsUriRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.GenerateHlsUriRequest} GenerateHlsUriRequest instance + */ + GenerateHlsUriRequest.create = function create(properties) { + return new GenerateHlsUriRequest(properties); + }; + + /** + * Encodes the specified GenerateHlsUriRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.GenerateHlsUriRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.GenerateHlsUriRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IGenerateHlsUriRequest} message GenerateHlsUriRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateHlsUriRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.temporalPartitions != null && message.temporalPartitions.length) + for (var i = 0; i < message.temporalPartitions.length; ++i) + $root.google.cloud.visionai.v1alpha1.Partition.TemporalPartition.encode(message.temporalPartitions[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GenerateHlsUriRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.GenerateHlsUriRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.GenerateHlsUriRequest + * @static + * @param {google.cloud.visionai.v1alpha1.IGenerateHlsUriRequest} message GenerateHlsUriRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateHlsUriRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateHlsUriRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.GenerateHlsUriRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.GenerateHlsUriRequest} GenerateHlsUriRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateHlsUriRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.GenerateHlsUriRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.temporalPartitions && message.temporalPartitions.length)) + message.temporalPartitions = []; + message.temporalPartitions.push($root.google.cloud.visionai.v1alpha1.Partition.TemporalPartition.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GenerateHlsUriRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.GenerateHlsUriRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.GenerateHlsUriRequest} GenerateHlsUriRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateHlsUriRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateHlsUriRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.GenerateHlsUriRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateHlsUriRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.temporalPartitions != null && message.hasOwnProperty("temporalPartitions")) { + if (!Array.isArray(message.temporalPartitions)) + return "temporalPartitions: array expected"; + for (var i = 0; i < message.temporalPartitions.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.Partition.TemporalPartition.verify(message.temporalPartitions[i], long + 1); + if (error) + return "temporalPartitions." + error; + } + } + return null; + }; + + /** + * Creates a GenerateHlsUriRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.GenerateHlsUriRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.GenerateHlsUriRequest} GenerateHlsUriRequest + */ + GenerateHlsUriRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.GenerateHlsUriRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.GenerateHlsUriRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.temporalPartitions) { + if (!Array.isArray(object.temporalPartitions)) + throw TypeError(".google.cloud.visionai.v1alpha1.GenerateHlsUriRequest.temporalPartitions: array expected"); + message.temporalPartitions = []; + for (var i = 0; i < object.temporalPartitions.length; ++i) { + if (typeof object.temporalPartitions[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.GenerateHlsUriRequest.temporalPartitions: object expected"); + message.temporalPartitions[i] = $root.google.cloud.visionai.v1alpha1.Partition.TemporalPartition.fromObject(object.temporalPartitions[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a GenerateHlsUriRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.GenerateHlsUriRequest + * @static + * @param {google.cloud.visionai.v1alpha1.GenerateHlsUriRequest} message GenerateHlsUriRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateHlsUriRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.temporalPartitions = []; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.temporalPartitions && message.temporalPartitions.length) { + object.temporalPartitions = []; + for (var j = 0; j < message.temporalPartitions.length; ++j) + object.temporalPartitions[j] = $root.google.cloud.visionai.v1alpha1.Partition.TemporalPartition.toObject(message.temporalPartitions[j], options); + } + return object; + }; + + /** + * Converts this GenerateHlsUriRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.GenerateHlsUriRequest + * @instance + * @returns {Object.} JSON object + */ + GenerateHlsUriRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateHlsUriRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.GenerateHlsUriRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateHlsUriRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.GenerateHlsUriRequest"; + }; + + return GenerateHlsUriRequest; + })(); + + v1alpha1.GenerateHlsUriResponse = (function() { + + /** + * Properties of a GenerateHlsUriResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IGenerateHlsUriResponse + * @property {string|null} [uri] GenerateHlsUriResponse uri + * @property {Array.|null} [temporalPartitions] GenerateHlsUriResponse temporalPartitions + */ + + /** + * Constructs a new GenerateHlsUriResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a GenerateHlsUriResponse. + * @implements IGenerateHlsUriResponse + * @constructor + * @param {google.cloud.visionai.v1alpha1.IGenerateHlsUriResponse=} [properties] Properties to set + */ + function GenerateHlsUriResponse(properties) { + this.temporalPartitions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerateHlsUriResponse uri. + * @member {string} uri + * @memberof google.cloud.visionai.v1alpha1.GenerateHlsUriResponse + * @instance + */ + GenerateHlsUriResponse.prototype.uri = ""; + + /** + * GenerateHlsUriResponse temporalPartitions. + * @member {Array.} temporalPartitions + * @memberof google.cloud.visionai.v1alpha1.GenerateHlsUriResponse + * @instance + */ + GenerateHlsUriResponse.prototype.temporalPartitions = $util.emptyArray; + + /** + * Creates a new GenerateHlsUriResponse instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.GenerateHlsUriResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IGenerateHlsUriResponse=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.GenerateHlsUriResponse} GenerateHlsUriResponse instance + */ + GenerateHlsUriResponse.create = function create(properties) { + return new GenerateHlsUriResponse(properties); + }; + + /** + * Encodes the specified GenerateHlsUriResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.GenerateHlsUriResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.GenerateHlsUriResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IGenerateHlsUriResponse} message GenerateHlsUriResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateHlsUriResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + if (message.temporalPartitions != null && message.temporalPartitions.length) + for (var i = 0; i < message.temporalPartitions.length; ++i) + $root.google.cloud.visionai.v1alpha1.Partition.TemporalPartition.encode(message.temporalPartitions[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GenerateHlsUriResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.GenerateHlsUriResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.GenerateHlsUriResponse + * @static + * @param {google.cloud.visionai.v1alpha1.IGenerateHlsUriResponse} message GenerateHlsUriResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateHlsUriResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateHlsUriResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.GenerateHlsUriResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.GenerateHlsUriResponse} GenerateHlsUriResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateHlsUriResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.GenerateHlsUriResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.uri = reader.string(); + break; + } + case 2: { + if (!(message.temporalPartitions && message.temporalPartitions.length)) + message.temporalPartitions = []; + message.temporalPartitions.push($root.google.cloud.visionai.v1alpha1.Partition.TemporalPartition.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GenerateHlsUriResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.GenerateHlsUriResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.GenerateHlsUriResponse} GenerateHlsUriResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateHlsUriResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateHlsUriResponse message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.GenerateHlsUriResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateHlsUriResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + if (message.temporalPartitions != null && message.hasOwnProperty("temporalPartitions")) { + if (!Array.isArray(message.temporalPartitions)) + return "temporalPartitions: array expected"; + for (var i = 0; i < message.temporalPartitions.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.Partition.TemporalPartition.verify(message.temporalPartitions[i], long + 1); + if (error) + return "temporalPartitions." + error; + } + } + return null; + }; + + /** + * Creates a GenerateHlsUriResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.GenerateHlsUriResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.GenerateHlsUriResponse} GenerateHlsUriResponse + */ + GenerateHlsUriResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.GenerateHlsUriResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.GenerateHlsUriResponse(); + if (object.uri != null) + message.uri = String(object.uri); + if (object.temporalPartitions) { + if (!Array.isArray(object.temporalPartitions)) + throw TypeError(".google.cloud.visionai.v1alpha1.GenerateHlsUriResponse.temporalPartitions: array expected"); + message.temporalPartitions = []; + for (var i = 0; i < object.temporalPartitions.length; ++i) { + if (typeof object.temporalPartitions[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.GenerateHlsUriResponse.temporalPartitions: object expected"); + message.temporalPartitions[i] = $root.google.cloud.visionai.v1alpha1.Partition.TemporalPartition.fromObject(object.temporalPartitions[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a GenerateHlsUriResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.GenerateHlsUriResponse + * @static + * @param {google.cloud.visionai.v1alpha1.GenerateHlsUriResponse} message GenerateHlsUriResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateHlsUriResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.temporalPartitions = []; + if (options.defaults) + object.uri = ""; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + if (message.temporalPartitions && message.temporalPartitions.length) { + object.temporalPartitions = []; + for (var j = 0; j < message.temporalPartitions.length; ++j) + object.temporalPartitions[j] = $root.google.cloud.visionai.v1alpha1.Partition.TemporalPartition.toObject(message.temporalPartitions[j], options); + } + return object; + }; + + /** + * Converts this GenerateHlsUriResponse to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.GenerateHlsUriResponse + * @instance + * @returns {Object.} JSON object + */ + GenerateHlsUriResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateHlsUriResponse + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.GenerateHlsUriResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateHlsUriResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.GenerateHlsUriResponse"; + }; + + return GenerateHlsUriResponse; + })(); + + v1alpha1.SearchAssetsRequest = (function() { + + /** + * Properties of a SearchAssetsRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @interface ISearchAssetsRequest + * @property {string|null} [corpus] SearchAssetsRequest corpus + * @property {number|null} [pageSize] SearchAssetsRequest pageSize + * @property {string|null} [pageToken] SearchAssetsRequest pageToken + * @property {google.cloud.visionai.v1alpha1.IDateTimeRangeArray|null} [contentTimeRanges] SearchAssetsRequest contentTimeRanges + * @property {Array.|null} [criteria] SearchAssetsRequest criteria + * @property {Array.|null} [facetSelections] SearchAssetsRequest facetSelections + * @property {Array.|null} [resultAnnotationKeys] SearchAssetsRequest resultAnnotationKeys + */ + + /** + * Constructs a new SearchAssetsRequest. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a SearchAssetsRequest. + * @implements ISearchAssetsRequest + * @constructor + * @param {google.cloud.visionai.v1alpha1.ISearchAssetsRequest=} [properties] Properties to set + */ + function SearchAssetsRequest(properties) { + this.criteria = []; + this.facetSelections = []; + this.resultAnnotationKeys = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchAssetsRequest corpus. + * @member {string} corpus + * @memberof google.cloud.visionai.v1alpha1.SearchAssetsRequest + * @instance + */ + SearchAssetsRequest.prototype.corpus = ""; + + /** + * SearchAssetsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.visionai.v1alpha1.SearchAssetsRequest + * @instance + */ + SearchAssetsRequest.prototype.pageSize = 0; + + /** + * SearchAssetsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.visionai.v1alpha1.SearchAssetsRequest + * @instance + */ + SearchAssetsRequest.prototype.pageToken = ""; + + /** + * SearchAssetsRequest contentTimeRanges. + * @member {google.cloud.visionai.v1alpha1.IDateTimeRangeArray|null|undefined} contentTimeRanges + * @memberof google.cloud.visionai.v1alpha1.SearchAssetsRequest + * @instance + */ + SearchAssetsRequest.prototype.contentTimeRanges = null; + + /** + * SearchAssetsRequest criteria. + * @member {Array.} criteria + * @memberof google.cloud.visionai.v1alpha1.SearchAssetsRequest + * @instance + */ + SearchAssetsRequest.prototype.criteria = $util.emptyArray; + + /** + * SearchAssetsRequest facetSelections. + * @member {Array.} facetSelections + * @memberof google.cloud.visionai.v1alpha1.SearchAssetsRequest + * @instance + */ + SearchAssetsRequest.prototype.facetSelections = $util.emptyArray; + + /** + * SearchAssetsRequest resultAnnotationKeys. + * @member {Array.} resultAnnotationKeys + * @memberof google.cloud.visionai.v1alpha1.SearchAssetsRequest + * @instance + */ + SearchAssetsRequest.prototype.resultAnnotationKeys = $util.emptyArray; + + /** + * Creates a new SearchAssetsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.SearchAssetsRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ISearchAssetsRequest=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.SearchAssetsRequest} SearchAssetsRequest instance + */ + SearchAssetsRequest.create = function create(properties) { + return new SearchAssetsRequest(properties); + }; + + /** + * Encodes the specified SearchAssetsRequest message. Does not implicitly {@link google.cloud.visionai.v1alpha1.SearchAssetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.SearchAssetsRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ISearchAssetsRequest} message SearchAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchAssetsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.corpus != null && Object.hasOwnProperty.call(message, "corpus")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.corpus); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.criteria != null && message.criteria.length) + for (var i = 0; i < message.criteria.length; ++i) + $root.google.cloud.visionai.v1alpha1.Criteria.encode(message.criteria[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.contentTimeRanges != null && Object.hasOwnProperty.call(message, "contentTimeRanges")) + $root.google.cloud.visionai.v1alpha1.DateTimeRangeArray.encode(message.contentTimeRanges, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.facetSelections != null && message.facetSelections.length) + for (var i = 0; i < message.facetSelections.length; ++i) + $root.google.cloud.visionai.v1alpha1.FacetGroup.encode(message.facetSelections[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.resultAnnotationKeys != null && message.resultAnnotationKeys.length) + for (var i = 0; i < message.resultAnnotationKeys.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.resultAnnotationKeys[i]); + return writer; + }; + + /** + * Encodes the specified SearchAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.SearchAssetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.SearchAssetsRequest + * @static + * @param {google.cloud.visionai.v1alpha1.ISearchAssetsRequest} message SearchAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchAssetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchAssetsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.SearchAssetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.SearchAssetsRequest} SearchAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchAssetsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.SearchAssetsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.corpus = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 5: { + message.contentTimeRanges = $root.google.cloud.visionai.v1alpha1.DateTimeRangeArray.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + if (!(message.criteria && message.criteria.length)) + message.criteria = []; + message.criteria.push($root.google.cloud.visionai.v1alpha1.Criteria.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 6: { + if (!(message.facetSelections && message.facetSelections.length)) + message.facetSelections = []; + message.facetSelections.push($root.google.cloud.visionai.v1alpha1.FacetGroup.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 8: { + if (!(message.resultAnnotationKeys && message.resultAnnotationKeys.length)) + message.resultAnnotationKeys = []; + message.resultAnnotationKeys.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SearchAssetsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.SearchAssetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.SearchAssetsRequest} SearchAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchAssetsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchAssetsRequest message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.SearchAssetsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchAssetsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.corpus != null && message.hasOwnProperty("corpus")) + if (!$util.isString(message.corpus)) + return "corpus: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.contentTimeRanges != null && message.hasOwnProperty("contentTimeRanges")) { + var error = $root.google.cloud.visionai.v1alpha1.DateTimeRangeArray.verify(message.contentTimeRanges, long + 1); + if (error) + return "contentTimeRanges." + error; + } + if (message.criteria != null && message.hasOwnProperty("criteria")) { + if (!Array.isArray(message.criteria)) + return "criteria: array expected"; + for (var i = 0; i < message.criteria.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.Criteria.verify(message.criteria[i], long + 1); + if (error) + return "criteria." + error; + } + } + if (message.facetSelections != null && message.hasOwnProperty("facetSelections")) { + if (!Array.isArray(message.facetSelections)) + return "facetSelections: array expected"; + for (var i = 0; i < message.facetSelections.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.FacetGroup.verify(message.facetSelections[i], long + 1); + if (error) + return "facetSelections." + error; + } + } + if (message.resultAnnotationKeys != null && message.hasOwnProperty("resultAnnotationKeys")) { + if (!Array.isArray(message.resultAnnotationKeys)) + return "resultAnnotationKeys: array expected"; + for (var i = 0; i < message.resultAnnotationKeys.length; ++i) + if (!$util.isString(message.resultAnnotationKeys[i])) + return "resultAnnotationKeys: string[] expected"; + } + return null; + }; + + /** + * Creates a SearchAssetsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.SearchAssetsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.SearchAssetsRequest} SearchAssetsRequest + */ + SearchAssetsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.SearchAssetsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.SearchAssetsRequest(); + if (object.corpus != null) + message.corpus = String(object.corpus); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.contentTimeRanges != null) { + if (typeof object.contentTimeRanges !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.SearchAssetsRequest.contentTimeRanges: object expected"); + message.contentTimeRanges = $root.google.cloud.visionai.v1alpha1.DateTimeRangeArray.fromObject(object.contentTimeRanges, long + 1); + } + if (object.criteria) { + if (!Array.isArray(object.criteria)) + throw TypeError(".google.cloud.visionai.v1alpha1.SearchAssetsRequest.criteria: array expected"); + message.criteria = []; + for (var i = 0; i < object.criteria.length; ++i) { + if (typeof object.criteria[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.SearchAssetsRequest.criteria: object expected"); + message.criteria[i] = $root.google.cloud.visionai.v1alpha1.Criteria.fromObject(object.criteria[i], long + 1); + } + } + if (object.facetSelections) { + if (!Array.isArray(object.facetSelections)) + throw TypeError(".google.cloud.visionai.v1alpha1.SearchAssetsRequest.facetSelections: array expected"); + message.facetSelections = []; + for (var i = 0; i < object.facetSelections.length; ++i) { + if (typeof object.facetSelections[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.SearchAssetsRequest.facetSelections: object expected"); + message.facetSelections[i] = $root.google.cloud.visionai.v1alpha1.FacetGroup.fromObject(object.facetSelections[i], long + 1); + } + } + if (object.resultAnnotationKeys) { + if (!Array.isArray(object.resultAnnotationKeys)) + throw TypeError(".google.cloud.visionai.v1alpha1.SearchAssetsRequest.resultAnnotationKeys: array expected"); + message.resultAnnotationKeys = []; + for (var i = 0; i < object.resultAnnotationKeys.length; ++i) + message.resultAnnotationKeys[i] = String(object.resultAnnotationKeys[i]); + } + return message; + }; + + /** + * Creates a plain object from a SearchAssetsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.SearchAssetsRequest + * @static + * @param {google.cloud.visionai.v1alpha1.SearchAssetsRequest} message SearchAssetsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchAssetsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.criteria = []; + object.facetSelections = []; + object.resultAnnotationKeys = []; + } + if (options.defaults) { + object.corpus = ""; + object.pageSize = 0; + object.pageToken = ""; + object.contentTimeRanges = null; + } + if (message.corpus != null && message.hasOwnProperty("corpus")) + object.corpus = message.corpus; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.criteria && message.criteria.length) { + object.criteria = []; + for (var j = 0; j < message.criteria.length; ++j) + object.criteria[j] = $root.google.cloud.visionai.v1alpha1.Criteria.toObject(message.criteria[j], options); + } + if (message.contentTimeRanges != null && message.hasOwnProperty("contentTimeRanges")) + object.contentTimeRanges = $root.google.cloud.visionai.v1alpha1.DateTimeRangeArray.toObject(message.contentTimeRanges, options); + if (message.facetSelections && message.facetSelections.length) { + object.facetSelections = []; + for (var j = 0; j < message.facetSelections.length; ++j) + object.facetSelections[j] = $root.google.cloud.visionai.v1alpha1.FacetGroup.toObject(message.facetSelections[j], options); + } + if (message.resultAnnotationKeys && message.resultAnnotationKeys.length) { + object.resultAnnotationKeys = []; + for (var j = 0; j < message.resultAnnotationKeys.length; ++j) + object.resultAnnotationKeys[j] = message.resultAnnotationKeys[j]; + } + return object; + }; + + /** + * Converts this SearchAssetsRequest to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.SearchAssetsRequest + * @instance + * @returns {Object.} JSON object + */ + SearchAssetsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchAssetsRequest + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.SearchAssetsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchAssetsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.SearchAssetsRequest"; + }; + + return SearchAssetsRequest; + })(); + + v1alpha1.DeleteAssetMetadata = (function() { + + /** + * Properties of a DeleteAssetMetadata. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IDeleteAssetMetadata + */ + + /** + * Constructs a new DeleteAssetMetadata. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a DeleteAssetMetadata. + * @implements IDeleteAssetMetadata + * @constructor + * @param {google.cloud.visionai.v1alpha1.IDeleteAssetMetadata=} [properties] Properties to set + */ + function DeleteAssetMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new DeleteAssetMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.DeleteAssetMetadata + * @static + * @param {google.cloud.visionai.v1alpha1.IDeleteAssetMetadata=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.DeleteAssetMetadata} DeleteAssetMetadata instance + */ + DeleteAssetMetadata.create = function create(properties) { + return new DeleteAssetMetadata(properties); + }; + + /** + * Encodes the specified DeleteAssetMetadata message. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteAssetMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.DeleteAssetMetadata + * @static + * @param {google.cloud.visionai.v1alpha1.IDeleteAssetMetadata} message DeleteAssetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAssetMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified DeleteAssetMetadata message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.DeleteAssetMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.DeleteAssetMetadata + * @static + * @param {google.cloud.visionai.v1alpha1.IDeleteAssetMetadata} message DeleteAssetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAssetMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteAssetMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.DeleteAssetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.DeleteAssetMetadata} DeleteAssetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAssetMetadata.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.DeleteAssetMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteAssetMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.DeleteAssetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.DeleteAssetMetadata} DeleteAssetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAssetMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteAssetMetadata message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.DeleteAssetMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteAssetMetadata.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates a DeleteAssetMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.DeleteAssetMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.DeleteAssetMetadata} DeleteAssetMetadata + */ + DeleteAssetMetadata.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.DeleteAssetMetadata) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.google.cloud.visionai.v1alpha1.DeleteAssetMetadata(); + }; + + /** + * Creates a plain object from a DeleteAssetMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.DeleteAssetMetadata + * @static + * @param {google.cloud.visionai.v1alpha1.DeleteAssetMetadata} message DeleteAssetMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteAssetMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this DeleteAssetMetadata to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.DeleteAssetMetadata + * @instance + * @returns {Object.} JSON object + */ + DeleteAssetMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteAssetMetadata + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.DeleteAssetMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteAssetMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.DeleteAssetMetadata"; + }; + + return DeleteAssetMetadata; + })(); + + v1alpha1.AnnotationMatchingResult = (function() { + + /** + * Properties of an AnnotationMatchingResult. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IAnnotationMatchingResult + * @property {google.cloud.visionai.v1alpha1.ICriteria|null} [criteria] AnnotationMatchingResult criteria + * @property {Array.|null} [matchedAnnotations] AnnotationMatchingResult matchedAnnotations + * @property {google.rpc.IStatus|null} [status] AnnotationMatchingResult status + */ + + /** + * Constructs a new AnnotationMatchingResult. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents an AnnotationMatchingResult. + * @implements IAnnotationMatchingResult + * @constructor + * @param {google.cloud.visionai.v1alpha1.IAnnotationMatchingResult=} [properties] Properties to set + */ + function AnnotationMatchingResult(properties) { + this.matchedAnnotations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnnotationMatchingResult criteria. + * @member {google.cloud.visionai.v1alpha1.ICriteria|null|undefined} criteria + * @memberof google.cloud.visionai.v1alpha1.AnnotationMatchingResult + * @instance + */ + AnnotationMatchingResult.prototype.criteria = null; + + /** + * AnnotationMatchingResult matchedAnnotations. + * @member {Array.} matchedAnnotations + * @memberof google.cloud.visionai.v1alpha1.AnnotationMatchingResult + * @instance + */ + AnnotationMatchingResult.prototype.matchedAnnotations = $util.emptyArray; + + /** + * AnnotationMatchingResult status. + * @member {google.rpc.IStatus|null|undefined} status + * @memberof google.cloud.visionai.v1alpha1.AnnotationMatchingResult + * @instance + */ + AnnotationMatchingResult.prototype.status = null; + + /** + * Creates a new AnnotationMatchingResult instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.AnnotationMatchingResult + * @static + * @param {google.cloud.visionai.v1alpha1.IAnnotationMatchingResult=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.AnnotationMatchingResult} AnnotationMatchingResult instance + */ + AnnotationMatchingResult.create = function create(properties) { + return new AnnotationMatchingResult(properties); + }; + + /** + * Encodes the specified AnnotationMatchingResult message. Does not implicitly {@link google.cloud.visionai.v1alpha1.AnnotationMatchingResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.AnnotationMatchingResult + * @static + * @param {google.cloud.visionai.v1alpha1.IAnnotationMatchingResult} message AnnotationMatchingResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotationMatchingResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.criteria != null && Object.hasOwnProperty.call(message, "criteria")) + $root.google.cloud.visionai.v1alpha1.Criteria.encode(message.criteria, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.matchedAnnotations != null && message.matchedAnnotations.length) + for (var i = 0; i < message.matchedAnnotations.length; ++i) + $root.google.cloud.visionai.v1alpha1.Annotation.encode(message.matchedAnnotations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnnotationMatchingResult message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.AnnotationMatchingResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.AnnotationMatchingResult + * @static + * @param {google.cloud.visionai.v1alpha1.IAnnotationMatchingResult} message AnnotationMatchingResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotationMatchingResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotationMatchingResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.AnnotationMatchingResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.AnnotationMatchingResult} AnnotationMatchingResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotationMatchingResult.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.AnnotationMatchingResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.criteria = $root.google.cloud.visionai.v1alpha1.Criteria.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + if (!(message.matchedAnnotations && message.matchedAnnotations.length)) + message.matchedAnnotations = []; + message.matchedAnnotations.push($root.google.cloud.visionai.v1alpha1.Annotation.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 3: { + message.status = $root.google.rpc.Status.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotationMatchingResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.AnnotationMatchingResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.AnnotationMatchingResult} AnnotationMatchingResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotationMatchingResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotationMatchingResult message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.AnnotationMatchingResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotationMatchingResult.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.criteria != null && message.hasOwnProperty("criteria")) { + var error = $root.google.cloud.visionai.v1alpha1.Criteria.verify(message.criteria, long + 1); + if (error) + return "criteria." + error; + } + if (message.matchedAnnotations != null && message.hasOwnProperty("matchedAnnotations")) { + if (!Array.isArray(message.matchedAnnotations)) + return "matchedAnnotations: array expected"; + for (var i = 0; i < message.matchedAnnotations.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.Annotation.verify(message.matchedAnnotations[i], long + 1); + if (error) + return "matchedAnnotations." + error; + } + } + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.rpc.Status.verify(message.status, long + 1); + if (error) + return "status." + error; + } + return null; + }; + + /** + * Creates an AnnotationMatchingResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.AnnotationMatchingResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.AnnotationMatchingResult} AnnotationMatchingResult + */ + AnnotationMatchingResult.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.AnnotationMatchingResult) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.AnnotationMatchingResult(); + if (object.criteria != null) { + if (typeof object.criteria !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.AnnotationMatchingResult.criteria: object expected"); + message.criteria = $root.google.cloud.visionai.v1alpha1.Criteria.fromObject(object.criteria, long + 1); + } + if (object.matchedAnnotations) { + if (!Array.isArray(object.matchedAnnotations)) + throw TypeError(".google.cloud.visionai.v1alpha1.AnnotationMatchingResult.matchedAnnotations: array expected"); + message.matchedAnnotations = []; + for (var i = 0; i < object.matchedAnnotations.length; ++i) { + if (typeof object.matchedAnnotations[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.AnnotationMatchingResult.matchedAnnotations: object expected"); + message.matchedAnnotations[i] = $root.google.cloud.visionai.v1alpha1.Annotation.fromObject(object.matchedAnnotations[i], long + 1); + } + } + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.AnnotationMatchingResult.status: object expected"); + message.status = $root.google.rpc.Status.fromObject(object.status, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an AnnotationMatchingResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.AnnotationMatchingResult + * @static + * @param {google.cloud.visionai.v1alpha1.AnnotationMatchingResult} message AnnotationMatchingResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotationMatchingResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.matchedAnnotations = []; + if (options.defaults) { + object.criteria = null; + object.status = null; + } + if (message.criteria != null && message.hasOwnProperty("criteria")) + object.criteria = $root.google.cloud.visionai.v1alpha1.Criteria.toObject(message.criteria, options); + if (message.matchedAnnotations && message.matchedAnnotations.length) { + object.matchedAnnotations = []; + for (var j = 0; j < message.matchedAnnotations.length; ++j) + object.matchedAnnotations[j] = $root.google.cloud.visionai.v1alpha1.Annotation.toObject(message.matchedAnnotations[j], options); + } + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.rpc.Status.toObject(message.status, options); + return object; + }; + + /** + * Converts this AnnotationMatchingResult to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.AnnotationMatchingResult + * @instance + * @returns {Object.} JSON object + */ + AnnotationMatchingResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnnotationMatchingResult + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.AnnotationMatchingResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnnotationMatchingResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.AnnotationMatchingResult"; + }; + + return AnnotationMatchingResult; + })(); + + v1alpha1.SearchResultItem = (function() { + + /** + * Properties of a SearchResultItem. + * @memberof google.cloud.visionai.v1alpha1 + * @interface ISearchResultItem + * @property {string|null} [asset] SearchResultItem asset + * @property {Array.|null} [segments] SearchResultItem segments + * @property {google.cloud.visionai.v1alpha1.Partition.ITemporalPartition|null} [segment] SearchResultItem segment + * @property {Array.|null} [requestedAnnotations] SearchResultItem requestedAnnotations + * @property {Array.|null} [annotationMatchingResults] SearchResultItem annotationMatchingResults + */ + + /** + * Constructs a new SearchResultItem. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a SearchResultItem. + * @implements ISearchResultItem + * @constructor + * @param {google.cloud.visionai.v1alpha1.ISearchResultItem=} [properties] Properties to set + */ + function SearchResultItem(properties) { + this.segments = []; + this.requestedAnnotations = []; + this.annotationMatchingResults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchResultItem asset. + * @member {string} asset + * @memberof google.cloud.visionai.v1alpha1.SearchResultItem + * @instance + */ + SearchResultItem.prototype.asset = ""; + + /** + * SearchResultItem segments. + * @member {Array.} segments + * @memberof google.cloud.visionai.v1alpha1.SearchResultItem + * @instance + */ + SearchResultItem.prototype.segments = $util.emptyArray; + + /** + * SearchResultItem segment. + * @member {google.cloud.visionai.v1alpha1.Partition.ITemporalPartition|null|undefined} segment + * @memberof google.cloud.visionai.v1alpha1.SearchResultItem + * @instance + */ + SearchResultItem.prototype.segment = null; + + /** + * SearchResultItem requestedAnnotations. + * @member {Array.} requestedAnnotations + * @memberof google.cloud.visionai.v1alpha1.SearchResultItem + * @instance + */ + SearchResultItem.prototype.requestedAnnotations = $util.emptyArray; + + /** + * SearchResultItem annotationMatchingResults. + * @member {Array.} annotationMatchingResults + * @memberof google.cloud.visionai.v1alpha1.SearchResultItem + * @instance + */ + SearchResultItem.prototype.annotationMatchingResults = $util.emptyArray; + + /** + * Creates a new SearchResultItem instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.SearchResultItem + * @static + * @param {google.cloud.visionai.v1alpha1.ISearchResultItem=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.SearchResultItem} SearchResultItem instance + */ + SearchResultItem.create = function create(properties) { + return new SearchResultItem(properties); + }; + + /** + * Encodes the specified SearchResultItem message. Does not implicitly {@link google.cloud.visionai.v1alpha1.SearchResultItem.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.SearchResultItem + * @static + * @param {google.cloud.visionai.v1alpha1.ISearchResultItem} message SearchResultItem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchResultItem.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.asset != null && Object.hasOwnProperty.call(message, "asset")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.asset); + if (message.segments != null && message.segments.length) + for (var i = 0; i < message.segments.length; ++i) + $root.google.cloud.visionai.v1alpha1.Partition.TemporalPartition.encode(message.segments[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestedAnnotations != null && message.requestedAnnotations.length) + for (var i = 0; i < message.requestedAnnotations.length; ++i) + $root.google.cloud.visionai.v1alpha1.Annotation.encode(message.requestedAnnotations[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.annotationMatchingResults != null && message.annotationMatchingResults.length) + for (var i = 0; i < message.annotationMatchingResults.length; ++i) + $root.google.cloud.visionai.v1alpha1.AnnotationMatchingResult.encode(message.annotationMatchingResults[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.segment != null && Object.hasOwnProperty.call(message, "segment")) + $root.google.cloud.visionai.v1alpha1.Partition.TemporalPartition.encode(message.segment, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SearchResultItem message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.SearchResultItem.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.SearchResultItem + * @static + * @param {google.cloud.visionai.v1alpha1.ISearchResultItem} message SearchResultItem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchResultItem.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchResultItem message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.SearchResultItem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.SearchResultItem} SearchResultItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchResultItem.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.SearchResultItem(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.asset = reader.string(); + break; + } + case 2: { + if (!(message.segments && message.segments.length)) + message.segments = []; + message.segments.push($root.google.cloud.visionai.v1alpha1.Partition.TemporalPartition.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 5: { + message.segment = $root.google.cloud.visionai.v1alpha1.Partition.TemporalPartition.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + if (!(message.requestedAnnotations && message.requestedAnnotations.length)) + message.requestedAnnotations = []; + message.requestedAnnotations.push($root.google.cloud.visionai.v1alpha1.Annotation.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 4: { + if (!(message.annotationMatchingResults && message.annotationMatchingResults.length)) + message.annotationMatchingResults = []; + message.annotationMatchingResults.push($root.google.cloud.visionai.v1alpha1.AnnotationMatchingResult.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SearchResultItem message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.SearchResultItem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.SearchResultItem} SearchResultItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchResultItem.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchResultItem message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.SearchResultItem + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchResultItem.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.asset != null && message.hasOwnProperty("asset")) + if (!$util.isString(message.asset)) + return "asset: string expected"; + if (message.segments != null && message.hasOwnProperty("segments")) { + if (!Array.isArray(message.segments)) + return "segments: array expected"; + for (var i = 0; i < message.segments.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.Partition.TemporalPartition.verify(message.segments[i], long + 1); + if (error) + return "segments." + error; + } + } + if (message.segment != null && message.hasOwnProperty("segment")) { + var error = $root.google.cloud.visionai.v1alpha1.Partition.TemporalPartition.verify(message.segment, long + 1); + if (error) + return "segment." + error; + } + if (message.requestedAnnotations != null && message.hasOwnProperty("requestedAnnotations")) { + if (!Array.isArray(message.requestedAnnotations)) + return "requestedAnnotations: array expected"; + for (var i = 0; i < message.requestedAnnotations.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.Annotation.verify(message.requestedAnnotations[i], long + 1); + if (error) + return "requestedAnnotations." + error; + } + } + if (message.annotationMatchingResults != null && message.hasOwnProperty("annotationMatchingResults")) { + if (!Array.isArray(message.annotationMatchingResults)) + return "annotationMatchingResults: array expected"; + for (var i = 0; i < message.annotationMatchingResults.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.AnnotationMatchingResult.verify(message.annotationMatchingResults[i], long + 1); + if (error) + return "annotationMatchingResults." + error; + } + } + return null; + }; + + /** + * Creates a SearchResultItem message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.SearchResultItem + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.SearchResultItem} SearchResultItem + */ + SearchResultItem.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.SearchResultItem) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.SearchResultItem(); + if (object.asset != null) + message.asset = String(object.asset); + if (object.segments) { + if (!Array.isArray(object.segments)) + throw TypeError(".google.cloud.visionai.v1alpha1.SearchResultItem.segments: array expected"); + message.segments = []; + for (var i = 0; i < object.segments.length; ++i) { + if (typeof object.segments[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.SearchResultItem.segments: object expected"); + message.segments[i] = $root.google.cloud.visionai.v1alpha1.Partition.TemporalPartition.fromObject(object.segments[i], long + 1); + } + } + if (object.segment != null) { + if (typeof object.segment !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.SearchResultItem.segment: object expected"); + message.segment = $root.google.cloud.visionai.v1alpha1.Partition.TemporalPartition.fromObject(object.segment, long + 1); + } + if (object.requestedAnnotations) { + if (!Array.isArray(object.requestedAnnotations)) + throw TypeError(".google.cloud.visionai.v1alpha1.SearchResultItem.requestedAnnotations: array expected"); + message.requestedAnnotations = []; + for (var i = 0; i < object.requestedAnnotations.length; ++i) { + if (typeof object.requestedAnnotations[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.SearchResultItem.requestedAnnotations: object expected"); + message.requestedAnnotations[i] = $root.google.cloud.visionai.v1alpha1.Annotation.fromObject(object.requestedAnnotations[i], long + 1); + } + } + if (object.annotationMatchingResults) { + if (!Array.isArray(object.annotationMatchingResults)) + throw TypeError(".google.cloud.visionai.v1alpha1.SearchResultItem.annotationMatchingResults: array expected"); + message.annotationMatchingResults = []; + for (var i = 0; i < object.annotationMatchingResults.length; ++i) { + if (typeof object.annotationMatchingResults[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.SearchResultItem.annotationMatchingResults: object expected"); + message.annotationMatchingResults[i] = $root.google.cloud.visionai.v1alpha1.AnnotationMatchingResult.fromObject(object.annotationMatchingResults[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a SearchResultItem message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.SearchResultItem + * @static + * @param {google.cloud.visionai.v1alpha1.SearchResultItem} message SearchResultItem + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchResultItem.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.segments = []; + object.requestedAnnotations = []; + object.annotationMatchingResults = []; + } + if (options.defaults) { + object.asset = ""; + object.segment = null; + } + if (message.asset != null && message.hasOwnProperty("asset")) + object.asset = message.asset; + if (message.segments && message.segments.length) { + object.segments = []; + for (var j = 0; j < message.segments.length; ++j) + object.segments[j] = $root.google.cloud.visionai.v1alpha1.Partition.TemporalPartition.toObject(message.segments[j], options); + } + if (message.requestedAnnotations && message.requestedAnnotations.length) { + object.requestedAnnotations = []; + for (var j = 0; j < message.requestedAnnotations.length; ++j) + object.requestedAnnotations[j] = $root.google.cloud.visionai.v1alpha1.Annotation.toObject(message.requestedAnnotations[j], options); + } + if (message.annotationMatchingResults && message.annotationMatchingResults.length) { + object.annotationMatchingResults = []; + for (var j = 0; j < message.annotationMatchingResults.length; ++j) + object.annotationMatchingResults[j] = $root.google.cloud.visionai.v1alpha1.AnnotationMatchingResult.toObject(message.annotationMatchingResults[j], options); + } + if (message.segment != null && message.hasOwnProperty("segment")) + object.segment = $root.google.cloud.visionai.v1alpha1.Partition.TemporalPartition.toObject(message.segment, options); + return object; + }; + + /** + * Converts this SearchResultItem to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.SearchResultItem + * @instance + * @returns {Object.} JSON object + */ + SearchResultItem.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchResultItem + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.SearchResultItem + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchResultItem.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.SearchResultItem"; + }; + + return SearchResultItem; + })(); + + v1alpha1.SearchAssetsResponse = (function() { + + /** + * Properties of a SearchAssetsResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @interface ISearchAssetsResponse + * @property {Array.|null} [searchResultItems] SearchAssetsResponse searchResultItems + * @property {string|null} [nextPageToken] SearchAssetsResponse nextPageToken + * @property {Array.|null} [facetResults] SearchAssetsResponse facetResults + */ + + /** + * Constructs a new SearchAssetsResponse. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a SearchAssetsResponse. + * @implements ISearchAssetsResponse + * @constructor + * @param {google.cloud.visionai.v1alpha1.ISearchAssetsResponse=} [properties] Properties to set + */ + function SearchAssetsResponse(properties) { + this.searchResultItems = []; + this.facetResults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchAssetsResponse searchResultItems. + * @member {Array.} searchResultItems + * @memberof google.cloud.visionai.v1alpha1.SearchAssetsResponse + * @instance + */ + SearchAssetsResponse.prototype.searchResultItems = $util.emptyArray; + + /** + * SearchAssetsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.visionai.v1alpha1.SearchAssetsResponse + * @instance + */ + SearchAssetsResponse.prototype.nextPageToken = ""; + + /** + * SearchAssetsResponse facetResults. + * @member {Array.} facetResults + * @memberof google.cloud.visionai.v1alpha1.SearchAssetsResponse + * @instance + */ + SearchAssetsResponse.prototype.facetResults = $util.emptyArray; + + /** + * Creates a new SearchAssetsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.SearchAssetsResponse + * @static + * @param {google.cloud.visionai.v1alpha1.ISearchAssetsResponse=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.SearchAssetsResponse} SearchAssetsResponse instance + */ + SearchAssetsResponse.create = function create(properties) { + return new SearchAssetsResponse(properties); + }; + + /** + * Encodes the specified SearchAssetsResponse message. Does not implicitly {@link google.cloud.visionai.v1alpha1.SearchAssetsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.SearchAssetsResponse + * @static + * @param {google.cloud.visionai.v1alpha1.ISearchAssetsResponse} message SearchAssetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchAssetsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.searchResultItems != null && message.searchResultItems.length) + for (var i = 0; i < message.searchResultItems.length; ++i) + $root.google.cloud.visionai.v1alpha1.SearchResultItem.encode(message.searchResultItems[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.facetResults != null && message.facetResults.length) + for (var i = 0; i < message.facetResults.length; ++i) + $root.google.cloud.visionai.v1alpha1.FacetGroup.encode(message.facetResults[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SearchAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.SearchAssetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.SearchAssetsResponse + * @static + * @param {google.cloud.visionai.v1alpha1.ISearchAssetsResponse} message SearchAssetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchAssetsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.SearchAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.SearchAssetsResponse} SearchAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchAssetsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.SearchAssetsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.searchResultItems && message.searchResultItems.length)) + message.searchResultItems = []; + message.searchResultItems.push($root.google.cloud.visionai.v1alpha1.SearchResultItem.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.facetResults && message.facetResults.length)) + message.facetResults = []; + message.facetResults.push($root.google.cloud.visionai.v1alpha1.FacetGroup.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SearchAssetsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.SearchAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.SearchAssetsResponse} SearchAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchAssetsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchAssetsResponse message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.SearchAssetsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchAssetsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.searchResultItems != null && message.hasOwnProperty("searchResultItems")) { + if (!Array.isArray(message.searchResultItems)) + return "searchResultItems: array expected"; + for (var i = 0; i < message.searchResultItems.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.SearchResultItem.verify(message.searchResultItems[i], long + 1); + if (error) + return "searchResultItems." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.facetResults != null && message.hasOwnProperty("facetResults")) { + if (!Array.isArray(message.facetResults)) + return "facetResults: array expected"; + for (var i = 0; i < message.facetResults.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.FacetGroup.verify(message.facetResults[i], long + 1); + if (error) + return "facetResults." + error; + } + } + return null; + }; + + /** + * Creates a SearchAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.SearchAssetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.SearchAssetsResponse} SearchAssetsResponse + */ + SearchAssetsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.SearchAssetsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.SearchAssetsResponse(); + if (object.searchResultItems) { + if (!Array.isArray(object.searchResultItems)) + throw TypeError(".google.cloud.visionai.v1alpha1.SearchAssetsResponse.searchResultItems: array expected"); + message.searchResultItems = []; + for (var i = 0; i < object.searchResultItems.length; ++i) { + if (typeof object.searchResultItems[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.SearchAssetsResponse.searchResultItems: object expected"); + message.searchResultItems[i] = $root.google.cloud.visionai.v1alpha1.SearchResultItem.fromObject(object.searchResultItems[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.facetResults) { + if (!Array.isArray(object.facetResults)) + throw TypeError(".google.cloud.visionai.v1alpha1.SearchAssetsResponse.facetResults: array expected"); + message.facetResults = []; + for (var i = 0; i < object.facetResults.length; ++i) { + if (typeof object.facetResults[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.SearchAssetsResponse.facetResults: object expected"); + message.facetResults[i] = $root.google.cloud.visionai.v1alpha1.FacetGroup.fromObject(object.facetResults[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a SearchAssetsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.SearchAssetsResponse + * @static + * @param {google.cloud.visionai.v1alpha1.SearchAssetsResponse} message SearchAssetsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchAssetsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.searchResultItems = []; + object.facetResults = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.searchResultItems && message.searchResultItems.length) { + object.searchResultItems = []; + for (var j = 0; j < message.searchResultItems.length; ++j) + object.searchResultItems[j] = $root.google.cloud.visionai.v1alpha1.SearchResultItem.toObject(message.searchResultItems[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.facetResults && message.facetResults.length) { + object.facetResults = []; + for (var j = 0; j < message.facetResults.length; ++j) + object.facetResults[j] = $root.google.cloud.visionai.v1alpha1.FacetGroup.toObject(message.facetResults[j], options); + } + return object; + }; + + /** + * Converts this SearchAssetsResponse to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.SearchAssetsResponse + * @instance + * @returns {Object.} JSON object + */ + SearchAssetsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchAssetsResponse + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.SearchAssetsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchAssetsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.SearchAssetsResponse"; + }; + + return SearchAssetsResponse; + })(); + + v1alpha1.IntRange = (function() { + + /** + * Properties of an IntRange. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IIntRange + * @property {number|Long|null} [start] IntRange start + * @property {number|Long|null} [end] IntRange end + */ + + /** + * Constructs a new IntRange. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents an IntRange. + * @implements IIntRange + * @constructor + * @param {google.cloud.visionai.v1alpha1.IIntRange=} [properties] Properties to set + */ + function IntRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * IntRange start. + * @member {number|Long|null|undefined} start + * @memberof google.cloud.visionai.v1alpha1.IntRange + * @instance + */ + IntRange.prototype.start = null; + + /** + * IntRange end. + * @member {number|Long|null|undefined} end + * @memberof google.cloud.visionai.v1alpha1.IntRange + * @instance + */ + IntRange.prototype.end = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(IntRange.prototype, "_start", { + get: $util.oneOfGetter($oneOfFields = ["start"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(IntRange.prototype, "_end", { + get: $util.oneOfGetter($oneOfFields = ["end"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new IntRange instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.IntRange + * @static + * @param {google.cloud.visionai.v1alpha1.IIntRange=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.IntRange} IntRange instance + */ + IntRange.create = function create(properties) { + return new IntRange(properties); + }; + + /** + * Encodes the specified IntRange message. Does not implicitly {@link google.cloud.visionai.v1alpha1.IntRange.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.IntRange + * @static + * @param {google.cloud.visionai.v1alpha1.IIntRange} message IntRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.end); + return writer; + }; + + /** + * Encodes the specified IntRange message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.IntRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.IntRange + * @static + * @param {google.cloud.visionai.v1alpha1.IIntRange} message IntRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IntRange message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.IntRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.IntRange} IntRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntRange.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.IntRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int64(); + break; + } + case 2: { + message.end = reader.int64(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an IntRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.IntRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.IntRange} IntRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IntRange message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.IntRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IntRange.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.start != null && message.hasOwnProperty("start")) { + properties._start = 1; + if (!$util.isInteger(message.start) && !(message.start && $util.isInteger(message.start.low) && $util.isInteger(message.start.high))) + return "start: integer|Long expected"; + } + if (message.end != null && message.hasOwnProperty("end")) { + properties._end = 1; + if (!$util.isInteger(message.end) && !(message.end && $util.isInteger(message.end.low) && $util.isInteger(message.end.high))) + return "end: integer|Long expected"; + } + return null; + }; + + /** + * Creates an IntRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.IntRange + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.IntRange} IntRange + */ + IntRange.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.IntRange) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.IntRange(); + if (object.start != null) + if ($util.Long) + (message.start = $util.Long.fromValue(object.start)).unsigned = false; + else if (typeof object.start === "string") + message.start = parseInt(object.start, 10); + else if (typeof object.start === "number") + message.start = object.start; + else if (typeof object.start === "object") + message.start = new $util.LongBits(object.start.low >>> 0, object.start.high >>> 0).toNumber(); + if (object.end != null) + if ($util.Long) + (message.end = $util.Long.fromValue(object.end)).unsigned = false; + else if (typeof object.end === "string") + message.end = parseInt(object.end, 10); + else if (typeof object.end === "number") + message.end = object.end; + else if (typeof object.end === "object") + message.end = new $util.LongBits(object.end.low >>> 0, object.end.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an IntRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.IntRange + * @static + * @param {google.cloud.visionai.v1alpha1.IntRange} message IntRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IntRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.start != null && message.hasOwnProperty("start")) { + if (typeof message.start === "number") + object.start = options.longs === String ? String(message.start) : message.start; + else + object.start = options.longs === String ? $util.Long.prototype.toString.call(message.start) : options.longs === Number ? new $util.LongBits(message.start.low >>> 0, message.start.high >>> 0).toNumber() : message.start; + if (options.oneofs) + object._start = "start"; + } + if (message.end != null && message.hasOwnProperty("end")) { + if (typeof message.end === "number") + object.end = options.longs === String ? String(message.end) : message.end; + else + object.end = options.longs === String ? $util.Long.prototype.toString.call(message.end) : options.longs === Number ? new $util.LongBits(message.end.low >>> 0, message.end.high >>> 0).toNumber() : message.end; + if (options.oneofs) + object._end = "end"; + } + return object; + }; + + /** + * Converts this IntRange to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.IntRange + * @instance + * @returns {Object.} JSON object + */ + IntRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IntRange + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.IntRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IntRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.IntRange"; + }; + + return IntRange; + })(); + + v1alpha1.FloatRange = (function() { + + /** + * Properties of a FloatRange. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IFloatRange + * @property {number|null} [start] FloatRange start + * @property {number|null} [end] FloatRange end + */ + + /** + * Constructs a new FloatRange. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a FloatRange. + * @implements IFloatRange + * @constructor + * @param {google.cloud.visionai.v1alpha1.IFloatRange=} [properties] Properties to set + */ + function FloatRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FloatRange start. + * @member {number|null|undefined} start + * @memberof google.cloud.visionai.v1alpha1.FloatRange + * @instance + */ + FloatRange.prototype.start = null; + + /** + * FloatRange end. + * @member {number|null|undefined} end + * @memberof google.cloud.visionai.v1alpha1.FloatRange + * @instance + */ + FloatRange.prototype.end = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(FloatRange.prototype, "_start", { + get: $util.oneOfGetter($oneOfFields = ["start"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(FloatRange.prototype, "_end", { + get: $util.oneOfGetter($oneOfFields = ["end"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new FloatRange instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.FloatRange + * @static + * @param {google.cloud.visionai.v1alpha1.IFloatRange=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.FloatRange} FloatRange instance + */ + FloatRange.create = function create(properties) { + return new FloatRange(properties); + }; + + /** + * Encodes the specified FloatRange message. Does not implicitly {@link google.cloud.visionai.v1alpha1.FloatRange.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.FloatRange + * @static + * @param {google.cloud.visionai.v1alpha1.IFloatRange} message FloatRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.end); + return writer; + }; + + /** + * Encodes the specified FloatRange message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.FloatRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.FloatRange + * @static + * @param {google.cloud.visionai.v1alpha1.IFloatRange} message FloatRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FloatRange message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.FloatRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.FloatRange} FloatRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatRange.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.FloatRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.float(); + break; + } + case 2: { + message.end = reader.float(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FloatRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.FloatRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.FloatRange} FloatRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FloatRange message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.FloatRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FloatRange.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.start != null && message.hasOwnProperty("start")) { + properties._start = 1; + if (typeof message.start !== "number") + return "start: number expected"; + } + if (message.end != null && message.hasOwnProperty("end")) { + properties._end = 1; + if (typeof message.end !== "number") + return "end: number expected"; + } + return null; + }; + + /** + * Creates a FloatRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.FloatRange + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.FloatRange} FloatRange + */ + FloatRange.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.FloatRange) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.FloatRange(); + if (object.start != null) + message.start = Number(object.start); + if (object.end != null) + message.end = Number(object.end); + return message; + }; + + /** + * Creates a plain object from a FloatRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.FloatRange + * @static + * @param {google.cloud.visionai.v1alpha1.FloatRange} message FloatRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FloatRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.start != null && message.hasOwnProperty("start")) { + object.start = options.json && !isFinite(message.start) ? String(message.start) : message.start; + if (options.oneofs) + object._start = "start"; + } + if (message.end != null && message.hasOwnProperty("end")) { + object.end = options.json && !isFinite(message.end) ? String(message.end) : message.end; + if (options.oneofs) + object._end = "end"; + } + return object; + }; + + /** + * Converts this FloatRange to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.FloatRange + * @instance + * @returns {Object.} JSON object + */ + FloatRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FloatRange + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.FloatRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.FloatRange"; + }; + + return FloatRange; + })(); + + v1alpha1.StringArray = (function() { + + /** + * Properties of a StringArray. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IStringArray + * @property {Array.|null} [txtValues] StringArray txtValues + */ + + /** + * Constructs a new StringArray. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a StringArray. + * @implements IStringArray + * @constructor + * @param {google.cloud.visionai.v1alpha1.IStringArray=} [properties] Properties to set + */ + function StringArray(properties) { + this.txtValues = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * StringArray txtValues. + * @member {Array.} txtValues + * @memberof google.cloud.visionai.v1alpha1.StringArray + * @instance + */ + StringArray.prototype.txtValues = $util.emptyArray; + + /** + * Creates a new StringArray instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.StringArray + * @static + * @param {google.cloud.visionai.v1alpha1.IStringArray=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.StringArray} StringArray instance + */ + StringArray.create = function create(properties) { + return new StringArray(properties); + }; + + /** + * Encodes the specified StringArray message. Does not implicitly {@link google.cloud.visionai.v1alpha1.StringArray.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.StringArray + * @static + * @param {google.cloud.visionai.v1alpha1.IStringArray} message StringArray message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringArray.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.txtValues != null && message.txtValues.length) + for (var i = 0; i < message.txtValues.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.txtValues[i]); + return writer; + }; + + /** + * Encodes the specified StringArray message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.StringArray.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.StringArray + * @static + * @param {google.cloud.visionai.v1alpha1.IStringArray} message StringArray message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringArray.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StringArray message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.StringArray + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.StringArray} StringArray + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringArray.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.StringArray(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.txtValues && message.txtValues.length)) + message.txtValues = []; + message.txtValues.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a StringArray message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.StringArray + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.StringArray} StringArray + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringArray.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StringArray message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.StringArray + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StringArray.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.txtValues != null && message.hasOwnProperty("txtValues")) { + if (!Array.isArray(message.txtValues)) + return "txtValues: array expected"; + for (var i = 0; i < message.txtValues.length; ++i) + if (!$util.isString(message.txtValues[i])) + return "txtValues: string[] expected"; + } + return null; + }; + + /** + * Creates a StringArray message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.StringArray + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.StringArray} StringArray + */ + StringArray.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.StringArray) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.StringArray(); + if (object.txtValues) { + if (!Array.isArray(object.txtValues)) + throw TypeError(".google.cloud.visionai.v1alpha1.StringArray.txtValues: array expected"); + message.txtValues = []; + for (var i = 0; i < object.txtValues.length; ++i) + message.txtValues[i] = String(object.txtValues[i]); + } + return message; + }; + + /** + * Creates a plain object from a StringArray message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.StringArray + * @static + * @param {google.cloud.visionai.v1alpha1.StringArray} message StringArray + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StringArray.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.txtValues = []; + if (message.txtValues && message.txtValues.length) { + object.txtValues = []; + for (var j = 0; j < message.txtValues.length; ++j) + object.txtValues[j] = message.txtValues[j]; + } + return object; + }; + + /** + * Converts this StringArray to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.StringArray + * @instance + * @returns {Object.} JSON object + */ + StringArray.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StringArray + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.StringArray + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringArray.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.StringArray"; + }; + + return StringArray; + })(); + + v1alpha1.IntRangeArray = (function() { + + /** + * Properties of an IntRangeArray. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IIntRangeArray + * @property {Array.|null} [intRanges] IntRangeArray intRanges + */ + + /** + * Constructs a new IntRangeArray. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents an IntRangeArray. + * @implements IIntRangeArray + * @constructor + * @param {google.cloud.visionai.v1alpha1.IIntRangeArray=} [properties] Properties to set + */ + function IntRangeArray(properties) { + this.intRanges = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * IntRangeArray intRanges. + * @member {Array.} intRanges + * @memberof google.cloud.visionai.v1alpha1.IntRangeArray + * @instance + */ + IntRangeArray.prototype.intRanges = $util.emptyArray; + + /** + * Creates a new IntRangeArray instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.IntRangeArray + * @static + * @param {google.cloud.visionai.v1alpha1.IIntRangeArray=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.IntRangeArray} IntRangeArray instance + */ + IntRangeArray.create = function create(properties) { + return new IntRangeArray(properties); + }; + + /** + * Encodes the specified IntRangeArray message. Does not implicitly {@link google.cloud.visionai.v1alpha1.IntRangeArray.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.IntRangeArray + * @static + * @param {google.cloud.visionai.v1alpha1.IIntRangeArray} message IntRangeArray message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntRangeArray.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.intRanges != null && message.intRanges.length) + for (var i = 0; i < message.intRanges.length; ++i) + $root.google.cloud.visionai.v1alpha1.IntRange.encode(message.intRanges[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IntRangeArray message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.IntRangeArray.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.IntRangeArray + * @static + * @param {google.cloud.visionai.v1alpha1.IIntRangeArray} message IntRangeArray message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntRangeArray.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IntRangeArray message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.IntRangeArray + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.IntRangeArray} IntRangeArray + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntRangeArray.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.IntRangeArray(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.intRanges && message.intRanges.length)) + message.intRanges = []; + message.intRanges.push($root.google.cloud.visionai.v1alpha1.IntRange.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an IntRangeArray message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.IntRangeArray + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.IntRangeArray} IntRangeArray + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntRangeArray.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IntRangeArray message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.IntRangeArray + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IntRangeArray.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.intRanges != null && message.hasOwnProperty("intRanges")) { + if (!Array.isArray(message.intRanges)) + return "intRanges: array expected"; + for (var i = 0; i < message.intRanges.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.IntRange.verify(message.intRanges[i], long + 1); + if (error) + return "intRanges." + error; + } + } + return null; + }; + + /** + * Creates an IntRangeArray message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.IntRangeArray + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.IntRangeArray} IntRangeArray + */ + IntRangeArray.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.IntRangeArray) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.IntRangeArray(); + if (object.intRanges) { + if (!Array.isArray(object.intRanges)) + throw TypeError(".google.cloud.visionai.v1alpha1.IntRangeArray.intRanges: array expected"); + message.intRanges = []; + for (var i = 0; i < object.intRanges.length; ++i) { + if (typeof object.intRanges[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.IntRangeArray.intRanges: object expected"); + message.intRanges[i] = $root.google.cloud.visionai.v1alpha1.IntRange.fromObject(object.intRanges[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from an IntRangeArray message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.IntRangeArray + * @static + * @param {google.cloud.visionai.v1alpha1.IntRangeArray} message IntRangeArray + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IntRangeArray.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.intRanges = []; + if (message.intRanges && message.intRanges.length) { + object.intRanges = []; + for (var j = 0; j < message.intRanges.length; ++j) + object.intRanges[j] = $root.google.cloud.visionai.v1alpha1.IntRange.toObject(message.intRanges[j], options); + } + return object; + }; + + /** + * Converts this IntRangeArray to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.IntRangeArray + * @instance + * @returns {Object.} JSON object + */ + IntRangeArray.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IntRangeArray + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.IntRangeArray + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IntRangeArray.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.IntRangeArray"; + }; + + return IntRangeArray; + })(); + + v1alpha1.FloatRangeArray = (function() { + + /** + * Properties of a FloatRangeArray. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IFloatRangeArray + * @property {Array.|null} [floatRanges] FloatRangeArray floatRanges + */ + + /** + * Constructs a new FloatRangeArray. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a FloatRangeArray. + * @implements IFloatRangeArray + * @constructor + * @param {google.cloud.visionai.v1alpha1.IFloatRangeArray=} [properties] Properties to set + */ + function FloatRangeArray(properties) { + this.floatRanges = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FloatRangeArray floatRanges. + * @member {Array.} floatRanges + * @memberof google.cloud.visionai.v1alpha1.FloatRangeArray + * @instance + */ + FloatRangeArray.prototype.floatRanges = $util.emptyArray; + + /** + * Creates a new FloatRangeArray instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.FloatRangeArray + * @static + * @param {google.cloud.visionai.v1alpha1.IFloatRangeArray=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.FloatRangeArray} FloatRangeArray instance + */ + FloatRangeArray.create = function create(properties) { + return new FloatRangeArray(properties); + }; + + /** + * Encodes the specified FloatRangeArray message. Does not implicitly {@link google.cloud.visionai.v1alpha1.FloatRangeArray.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.FloatRangeArray + * @static + * @param {google.cloud.visionai.v1alpha1.IFloatRangeArray} message FloatRangeArray message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatRangeArray.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.floatRanges != null && message.floatRanges.length) + for (var i = 0; i < message.floatRanges.length; ++i) + $root.google.cloud.visionai.v1alpha1.FloatRange.encode(message.floatRanges[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FloatRangeArray message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.FloatRangeArray.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.FloatRangeArray + * @static + * @param {google.cloud.visionai.v1alpha1.IFloatRangeArray} message FloatRangeArray message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatRangeArray.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FloatRangeArray message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.FloatRangeArray + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.FloatRangeArray} FloatRangeArray + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatRangeArray.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.FloatRangeArray(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.floatRanges && message.floatRanges.length)) + message.floatRanges = []; + message.floatRanges.push($root.google.cloud.visionai.v1alpha1.FloatRange.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FloatRangeArray message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.FloatRangeArray + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.FloatRangeArray} FloatRangeArray + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatRangeArray.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FloatRangeArray message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.FloatRangeArray + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FloatRangeArray.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.floatRanges != null && message.hasOwnProperty("floatRanges")) { + if (!Array.isArray(message.floatRanges)) + return "floatRanges: array expected"; + for (var i = 0; i < message.floatRanges.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.FloatRange.verify(message.floatRanges[i], long + 1); + if (error) + return "floatRanges." + error; + } + } + return null; + }; + + /** + * Creates a FloatRangeArray message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.FloatRangeArray + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.FloatRangeArray} FloatRangeArray + */ + FloatRangeArray.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.FloatRangeArray) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.FloatRangeArray(); + if (object.floatRanges) { + if (!Array.isArray(object.floatRanges)) + throw TypeError(".google.cloud.visionai.v1alpha1.FloatRangeArray.floatRanges: array expected"); + message.floatRanges = []; + for (var i = 0; i < object.floatRanges.length; ++i) { + if (typeof object.floatRanges[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.FloatRangeArray.floatRanges: object expected"); + message.floatRanges[i] = $root.google.cloud.visionai.v1alpha1.FloatRange.fromObject(object.floatRanges[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a FloatRangeArray message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.FloatRangeArray + * @static + * @param {google.cloud.visionai.v1alpha1.FloatRangeArray} message FloatRangeArray + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FloatRangeArray.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.floatRanges = []; + if (message.floatRanges && message.floatRanges.length) { + object.floatRanges = []; + for (var j = 0; j < message.floatRanges.length; ++j) + object.floatRanges[j] = $root.google.cloud.visionai.v1alpha1.FloatRange.toObject(message.floatRanges[j], options); + } + return object; + }; + + /** + * Converts this FloatRangeArray to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.FloatRangeArray + * @instance + * @returns {Object.} JSON object + */ + FloatRangeArray.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FloatRangeArray + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.FloatRangeArray + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatRangeArray.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.FloatRangeArray"; + }; + + return FloatRangeArray; + })(); + + v1alpha1.DateTimeRange = (function() { + + /** + * Properties of a DateTimeRange. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IDateTimeRange + * @property {google.type.IDateTime|null} [start] DateTimeRange start + * @property {google.type.IDateTime|null} [end] DateTimeRange end + */ + + /** + * Constructs a new DateTimeRange. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a DateTimeRange. + * @implements IDateTimeRange + * @constructor + * @param {google.cloud.visionai.v1alpha1.IDateTimeRange=} [properties] Properties to set + */ + function DateTimeRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DateTimeRange start. + * @member {google.type.IDateTime|null|undefined} start + * @memberof google.cloud.visionai.v1alpha1.DateTimeRange + * @instance + */ + DateTimeRange.prototype.start = null; + + /** + * DateTimeRange end. + * @member {google.type.IDateTime|null|undefined} end + * @memberof google.cloud.visionai.v1alpha1.DateTimeRange + * @instance + */ + DateTimeRange.prototype.end = null; + + /** + * Creates a new DateTimeRange instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.DateTimeRange + * @static + * @param {google.cloud.visionai.v1alpha1.IDateTimeRange=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.DateTimeRange} DateTimeRange instance + */ + DateTimeRange.create = function create(properties) { + return new DateTimeRange(properties); + }; + + /** + * Encodes the specified DateTimeRange message. Does not implicitly {@link google.cloud.visionai.v1alpha1.DateTimeRange.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.DateTimeRange + * @static + * @param {google.cloud.visionai.v1alpha1.IDateTimeRange} message DateTimeRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DateTimeRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + $root.google.type.DateTime.encode(message.start, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + $root.google.type.DateTime.encode(message.end, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DateTimeRange message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.DateTimeRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.DateTimeRange + * @static + * @param {google.cloud.visionai.v1alpha1.IDateTimeRange} message DateTimeRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DateTimeRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DateTimeRange message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.DateTimeRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.DateTimeRange} DateTimeRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DateTimeRange.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.DateTimeRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = $root.google.type.DateTime.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.end = $root.google.type.DateTime.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DateTimeRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.DateTimeRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.DateTimeRange} DateTimeRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DateTimeRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DateTimeRange message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.DateTimeRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DateTimeRange.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.start != null && message.hasOwnProperty("start")) { + var error = $root.google.type.DateTime.verify(message.start, long + 1); + if (error) + return "start." + error; + } + if (message.end != null && message.hasOwnProperty("end")) { + var error = $root.google.type.DateTime.verify(message.end, long + 1); + if (error) + return "end." + error; + } + return null; + }; + + /** + * Creates a DateTimeRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.DateTimeRange + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.DateTimeRange} DateTimeRange + */ + DateTimeRange.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.DateTimeRange) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.DateTimeRange(); + if (object.start != null) { + if (typeof object.start !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.DateTimeRange.start: object expected"); + message.start = $root.google.type.DateTime.fromObject(object.start, long + 1); + } + if (object.end != null) { + if (typeof object.end !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.DateTimeRange.end: object expected"); + message.end = $root.google.type.DateTime.fromObject(object.end, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a DateTimeRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.DateTimeRange + * @static + * @param {google.cloud.visionai.v1alpha1.DateTimeRange} message DateTimeRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DateTimeRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = null; + object.end = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = $root.google.type.DateTime.toObject(message.start, options); + if (message.end != null && message.hasOwnProperty("end")) + object.end = $root.google.type.DateTime.toObject(message.end, options); + return object; + }; + + /** + * Converts this DateTimeRange to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.DateTimeRange + * @instance + * @returns {Object.} JSON object + */ + DateTimeRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DateTimeRange + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.DateTimeRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DateTimeRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.DateTimeRange"; + }; + + return DateTimeRange; + })(); + + v1alpha1.DateTimeRangeArray = (function() { + + /** + * Properties of a DateTimeRangeArray. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IDateTimeRangeArray + * @property {Array.|null} [dateTimeRanges] DateTimeRangeArray dateTimeRanges + */ + + /** + * Constructs a new DateTimeRangeArray. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a DateTimeRangeArray. + * @implements IDateTimeRangeArray + * @constructor + * @param {google.cloud.visionai.v1alpha1.IDateTimeRangeArray=} [properties] Properties to set + */ + function DateTimeRangeArray(properties) { + this.dateTimeRanges = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DateTimeRangeArray dateTimeRanges. + * @member {Array.} dateTimeRanges + * @memberof google.cloud.visionai.v1alpha1.DateTimeRangeArray + * @instance + */ + DateTimeRangeArray.prototype.dateTimeRanges = $util.emptyArray; + + /** + * Creates a new DateTimeRangeArray instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.DateTimeRangeArray + * @static + * @param {google.cloud.visionai.v1alpha1.IDateTimeRangeArray=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.DateTimeRangeArray} DateTimeRangeArray instance + */ + DateTimeRangeArray.create = function create(properties) { + return new DateTimeRangeArray(properties); + }; + + /** + * Encodes the specified DateTimeRangeArray message. Does not implicitly {@link google.cloud.visionai.v1alpha1.DateTimeRangeArray.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.DateTimeRangeArray + * @static + * @param {google.cloud.visionai.v1alpha1.IDateTimeRangeArray} message DateTimeRangeArray message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DateTimeRangeArray.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dateTimeRanges != null && message.dateTimeRanges.length) + for (var i = 0; i < message.dateTimeRanges.length; ++i) + $root.google.cloud.visionai.v1alpha1.DateTimeRange.encode(message.dateTimeRanges[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DateTimeRangeArray message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.DateTimeRangeArray.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.DateTimeRangeArray + * @static + * @param {google.cloud.visionai.v1alpha1.IDateTimeRangeArray} message DateTimeRangeArray message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DateTimeRangeArray.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DateTimeRangeArray message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.DateTimeRangeArray + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.DateTimeRangeArray} DateTimeRangeArray + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DateTimeRangeArray.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.DateTimeRangeArray(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.dateTimeRanges && message.dateTimeRanges.length)) + message.dateTimeRanges = []; + message.dateTimeRanges.push($root.google.cloud.visionai.v1alpha1.DateTimeRange.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DateTimeRangeArray message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.DateTimeRangeArray + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.DateTimeRangeArray} DateTimeRangeArray + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DateTimeRangeArray.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DateTimeRangeArray message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.DateTimeRangeArray + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DateTimeRangeArray.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.dateTimeRanges != null && message.hasOwnProperty("dateTimeRanges")) { + if (!Array.isArray(message.dateTimeRanges)) + return "dateTimeRanges: array expected"; + for (var i = 0; i < message.dateTimeRanges.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.DateTimeRange.verify(message.dateTimeRanges[i], long + 1); + if (error) + return "dateTimeRanges." + error; + } + } + return null; + }; + + /** + * Creates a DateTimeRangeArray message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.DateTimeRangeArray + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.DateTimeRangeArray} DateTimeRangeArray + */ + DateTimeRangeArray.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.DateTimeRangeArray) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.DateTimeRangeArray(); + if (object.dateTimeRanges) { + if (!Array.isArray(object.dateTimeRanges)) + throw TypeError(".google.cloud.visionai.v1alpha1.DateTimeRangeArray.dateTimeRanges: array expected"); + message.dateTimeRanges = []; + for (var i = 0; i < object.dateTimeRanges.length; ++i) { + if (typeof object.dateTimeRanges[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.DateTimeRangeArray.dateTimeRanges: object expected"); + message.dateTimeRanges[i] = $root.google.cloud.visionai.v1alpha1.DateTimeRange.fromObject(object.dateTimeRanges[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a DateTimeRangeArray message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.DateTimeRangeArray + * @static + * @param {google.cloud.visionai.v1alpha1.DateTimeRangeArray} message DateTimeRangeArray + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DateTimeRangeArray.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dateTimeRanges = []; + if (message.dateTimeRanges && message.dateTimeRanges.length) { + object.dateTimeRanges = []; + for (var j = 0; j < message.dateTimeRanges.length; ++j) + object.dateTimeRanges[j] = $root.google.cloud.visionai.v1alpha1.DateTimeRange.toObject(message.dateTimeRanges[j], options); + } + return object; + }; + + /** + * Converts this DateTimeRangeArray to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.DateTimeRangeArray + * @instance + * @returns {Object.} JSON object + */ + DateTimeRangeArray.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DateTimeRangeArray + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.DateTimeRangeArray + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DateTimeRangeArray.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.DateTimeRangeArray"; + }; + + return DateTimeRangeArray; + })(); + + v1alpha1.CircleArea = (function() { + + /** + * Properties of a CircleArea. + * @memberof google.cloud.visionai.v1alpha1 + * @interface ICircleArea + * @property {number|null} [latitude] CircleArea latitude + * @property {number|null} [longitude] CircleArea longitude + * @property {number|null} [radiusMeter] CircleArea radiusMeter + */ + + /** + * Constructs a new CircleArea. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a CircleArea. + * @implements ICircleArea + * @constructor + * @param {google.cloud.visionai.v1alpha1.ICircleArea=} [properties] Properties to set + */ + function CircleArea(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CircleArea latitude. + * @member {number} latitude + * @memberof google.cloud.visionai.v1alpha1.CircleArea + * @instance + */ + CircleArea.prototype.latitude = 0; + + /** + * CircleArea longitude. + * @member {number} longitude + * @memberof google.cloud.visionai.v1alpha1.CircleArea + * @instance + */ + CircleArea.prototype.longitude = 0; + + /** + * CircleArea radiusMeter. + * @member {number} radiusMeter + * @memberof google.cloud.visionai.v1alpha1.CircleArea + * @instance + */ + CircleArea.prototype.radiusMeter = 0; + + /** + * Creates a new CircleArea instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.CircleArea + * @static + * @param {google.cloud.visionai.v1alpha1.ICircleArea=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.CircleArea} CircleArea instance + */ + CircleArea.create = function create(properties) { + return new CircleArea(properties); + }; + + /** + * Encodes the specified CircleArea message. Does not implicitly {@link google.cloud.visionai.v1alpha1.CircleArea.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.CircleArea + * @static + * @param {google.cloud.visionai.v1alpha1.ICircleArea} message CircleArea message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CircleArea.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.latitude != null && Object.hasOwnProperty.call(message, "latitude")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.latitude); + if (message.longitude != null && Object.hasOwnProperty.call(message, "longitude")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.longitude); + if (message.radiusMeter != null && Object.hasOwnProperty.call(message, "radiusMeter")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.radiusMeter); + return writer; + }; + + /** + * Encodes the specified CircleArea message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.CircleArea.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.CircleArea + * @static + * @param {google.cloud.visionai.v1alpha1.ICircleArea} message CircleArea message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CircleArea.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CircleArea message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.CircleArea + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.CircleArea} CircleArea + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CircleArea.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.CircleArea(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.latitude = reader.double(); + break; + } + case 2: { + message.longitude = reader.double(); + break; + } + case 3: { + message.radiusMeter = reader.double(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CircleArea message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.CircleArea + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.CircleArea} CircleArea + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CircleArea.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CircleArea message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.CircleArea + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CircleArea.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.latitude != null && message.hasOwnProperty("latitude")) + if (typeof message.latitude !== "number") + return "latitude: number expected"; + if (message.longitude != null && message.hasOwnProperty("longitude")) + if (typeof message.longitude !== "number") + return "longitude: number expected"; + if (message.radiusMeter != null && message.hasOwnProperty("radiusMeter")) + if (typeof message.radiusMeter !== "number") + return "radiusMeter: number expected"; + return null; + }; + + /** + * Creates a CircleArea message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.CircleArea + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.CircleArea} CircleArea + */ + CircleArea.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.CircleArea) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.CircleArea(); + if (object.latitude != null) + message.latitude = Number(object.latitude); + if (object.longitude != null) + message.longitude = Number(object.longitude); + if (object.radiusMeter != null) + message.radiusMeter = Number(object.radiusMeter); + return message; + }; + + /** + * Creates a plain object from a CircleArea message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.CircleArea + * @static + * @param {google.cloud.visionai.v1alpha1.CircleArea} message CircleArea + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CircleArea.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.latitude = 0; + object.longitude = 0; + object.radiusMeter = 0; + } + if (message.latitude != null && message.hasOwnProperty("latitude")) + object.latitude = options.json && !isFinite(message.latitude) ? String(message.latitude) : message.latitude; + if (message.longitude != null && message.hasOwnProperty("longitude")) + object.longitude = options.json && !isFinite(message.longitude) ? String(message.longitude) : message.longitude; + if (message.radiusMeter != null && message.hasOwnProperty("radiusMeter")) + object.radiusMeter = options.json && !isFinite(message.radiusMeter) ? String(message.radiusMeter) : message.radiusMeter; + return object; + }; + + /** + * Converts this CircleArea to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.CircleArea + * @instance + * @returns {Object.} JSON object + */ + CircleArea.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CircleArea + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.CircleArea + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CircleArea.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.CircleArea"; + }; + + return CircleArea; + })(); + + v1alpha1.GeoLocationArray = (function() { + + /** + * Properties of a GeoLocationArray. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IGeoLocationArray + * @property {Array.|null} [circleAreas] GeoLocationArray circleAreas + */ + + /** + * Constructs a new GeoLocationArray. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a GeoLocationArray. + * @implements IGeoLocationArray + * @constructor + * @param {google.cloud.visionai.v1alpha1.IGeoLocationArray=} [properties] Properties to set + */ + function GeoLocationArray(properties) { + this.circleAreas = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeoLocationArray circleAreas. + * @member {Array.} circleAreas + * @memberof google.cloud.visionai.v1alpha1.GeoLocationArray + * @instance + */ + GeoLocationArray.prototype.circleAreas = $util.emptyArray; + + /** + * Creates a new GeoLocationArray instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.GeoLocationArray + * @static + * @param {google.cloud.visionai.v1alpha1.IGeoLocationArray=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.GeoLocationArray} GeoLocationArray instance + */ + GeoLocationArray.create = function create(properties) { + return new GeoLocationArray(properties); + }; + + /** + * Encodes the specified GeoLocationArray message. Does not implicitly {@link google.cloud.visionai.v1alpha1.GeoLocationArray.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.GeoLocationArray + * @static + * @param {google.cloud.visionai.v1alpha1.IGeoLocationArray} message GeoLocationArray message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeoLocationArray.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.circleAreas != null && message.circleAreas.length) + for (var i = 0; i < message.circleAreas.length; ++i) + $root.google.cloud.visionai.v1alpha1.CircleArea.encode(message.circleAreas[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeoLocationArray message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.GeoLocationArray.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.GeoLocationArray + * @static + * @param {google.cloud.visionai.v1alpha1.IGeoLocationArray} message GeoLocationArray message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeoLocationArray.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeoLocationArray message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.GeoLocationArray + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.GeoLocationArray} GeoLocationArray + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeoLocationArray.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.GeoLocationArray(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.circleAreas && message.circleAreas.length)) + message.circleAreas = []; + message.circleAreas.push($root.google.cloud.visionai.v1alpha1.CircleArea.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GeoLocationArray message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.GeoLocationArray + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.GeoLocationArray} GeoLocationArray + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeoLocationArray.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeoLocationArray message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.GeoLocationArray + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeoLocationArray.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.circleAreas != null && message.hasOwnProperty("circleAreas")) { + if (!Array.isArray(message.circleAreas)) + return "circleAreas: array expected"; + for (var i = 0; i < message.circleAreas.length; ++i) { + var error = $root.google.cloud.visionai.v1alpha1.CircleArea.verify(message.circleAreas[i], long + 1); + if (error) + return "circleAreas." + error; + } + } + return null; + }; + + /** + * Creates a GeoLocationArray message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.GeoLocationArray + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.GeoLocationArray} GeoLocationArray + */ + GeoLocationArray.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.GeoLocationArray) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.GeoLocationArray(); + if (object.circleAreas) { + if (!Array.isArray(object.circleAreas)) + throw TypeError(".google.cloud.visionai.v1alpha1.GeoLocationArray.circleAreas: array expected"); + message.circleAreas = []; + for (var i = 0; i < object.circleAreas.length; ++i) { + if (typeof object.circleAreas[i] !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.GeoLocationArray.circleAreas: object expected"); + message.circleAreas[i] = $root.google.cloud.visionai.v1alpha1.CircleArea.fromObject(object.circleAreas[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a GeoLocationArray message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.GeoLocationArray + * @static + * @param {google.cloud.visionai.v1alpha1.GeoLocationArray} message GeoLocationArray + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeoLocationArray.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.circleAreas = []; + if (message.circleAreas && message.circleAreas.length) { + object.circleAreas = []; + for (var j = 0; j < message.circleAreas.length; ++j) + object.circleAreas[j] = $root.google.cloud.visionai.v1alpha1.CircleArea.toObject(message.circleAreas[j], options); + } + return object; + }; + + /** + * Converts this GeoLocationArray to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.GeoLocationArray + * @instance + * @returns {Object.} JSON object + */ + GeoLocationArray.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeoLocationArray + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.GeoLocationArray + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeoLocationArray.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.GeoLocationArray"; + }; + + return GeoLocationArray; + })(); + + v1alpha1.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IBoolValue + * @property {boolean|null} [value] BoolValue value + */ + + /** + * Constructs a new BoolValue. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a BoolValue. + * @implements IBoolValue + * @constructor + * @param {google.cloud.visionai.v1alpha1.IBoolValue=} [properties] Properties to set + */ + function BoolValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * BoolValue value. + * @member {boolean} value + * @memberof google.cloud.visionai.v1alpha1.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.BoolValue + * @static + * @param {google.cloud.visionai.v1alpha1.IBoolValue=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.cloud.visionai.v1alpha1.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.BoolValue + * @static + * @param {google.cloud.visionai.v1alpha1.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.value); + return writer; + }; + + /** + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.BoolValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.BoolValue + * @static + * @param {google.cloud.visionai.v1alpha1.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.BoolValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoolValue message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.BoolValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoolValue.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "boolean") + return "value: boolean expected"; + return null; + }; + + /** + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.BoolValue + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.BoolValue} BoolValue + */ + BoolValue.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.BoolValue) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.BoolValue(); + if (object.value != null) + message.value = Boolean(object.value); + return message; + }; + + /** + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.BoolValue + * @static + * @param {google.cloud.visionai.v1alpha1.BoolValue} message BoolValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoolValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = false; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this BoolValue to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.BoolValue + * @instance + * @returns {Object.} JSON object + */ + BoolValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.BoolValue"; + }; + + return BoolValue; + })(); + + v1alpha1.Criteria = (function() { + + /** + * Properties of a Criteria. + * @memberof google.cloud.visionai.v1alpha1 + * @interface ICriteria + * @property {google.cloud.visionai.v1alpha1.IStringArray|null} [textArray] Criteria textArray + * @property {google.cloud.visionai.v1alpha1.IIntRangeArray|null} [intRangeArray] Criteria intRangeArray + * @property {google.cloud.visionai.v1alpha1.IFloatRangeArray|null} [floatRangeArray] Criteria floatRangeArray + * @property {google.cloud.visionai.v1alpha1.IDateTimeRangeArray|null} [dateTimeRangeArray] Criteria dateTimeRangeArray + * @property {google.cloud.visionai.v1alpha1.IGeoLocationArray|null} [geoLocationArray] Criteria geoLocationArray + * @property {google.cloud.visionai.v1alpha1.IBoolValue|null} [boolValue] Criteria boolValue + * @property {string|null} [field] Criteria field + * @property {boolean|null} [fetchMatchedAnnotations] Criteria fetchMatchedAnnotations + */ + + /** + * Constructs a new Criteria. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a Criteria. + * @implements ICriteria + * @constructor + * @param {google.cloud.visionai.v1alpha1.ICriteria=} [properties] Properties to set + */ + function Criteria(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Criteria textArray. + * @member {google.cloud.visionai.v1alpha1.IStringArray|null|undefined} textArray + * @memberof google.cloud.visionai.v1alpha1.Criteria + * @instance + */ + Criteria.prototype.textArray = null; + + /** + * Criteria intRangeArray. + * @member {google.cloud.visionai.v1alpha1.IIntRangeArray|null|undefined} intRangeArray + * @memberof google.cloud.visionai.v1alpha1.Criteria + * @instance + */ + Criteria.prototype.intRangeArray = null; + + /** + * Criteria floatRangeArray. + * @member {google.cloud.visionai.v1alpha1.IFloatRangeArray|null|undefined} floatRangeArray + * @memberof google.cloud.visionai.v1alpha1.Criteria + * @instance + */ + Criteria.prototype.floatRangeArray = null; + + /** + * Criteria dateTimeRangeArray. + * @member {google.cloud.visionai.v1alpha1.IDateTimeRangeArray|null|undefined} dateTimeRangeArray + * @memberof google.cloud.visionai.v1alpha1.Criteria + * @instance + */ + Criteria.prototype.dateTimeRangeArray = null; + + /** + * Criteria geoLocationArray. + * @member {google.cloud.visionai.v1alpha1.IGeoLocationArray|null|undefined} geoLocationArray + * @memberof google.cloud.visionai.v1alpha1.Criteria + * @instance + */ + Criteria.prototype.geoLocationArray = null; + + /** + * Criteria boolValue. + * @member {google.cloud.visionai.v1alpha1.IBoolValue|null|undefined} boolValue + * @memberof google.cloud.visionai.v1alpha1.Criteria + * @instance + */ + Criteria.prototype.boolValue = null; + + /** + * Criteria field. + * @member {string} field + * @memberof google.cloud.visionai.v1alpha1.Criteria + * @instance + */ + Criteria.prototype.field = ""; + + /** + * Criteria fetchMatchedAnnotations. + * @member {boolean} fetchMatchedAnnotations + * @memberof google.cloud.visionai.v1alpha1.Criteria + * @instance + */ + Criteria.prototype.fetchMatchedAnnotations = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Criteria value. + * @member {"textArray"|"intRangeArray"|"floatRangeArray"|"dateTimeRangeArray"|"geoLocationArray"|"boolValue"|undefined} value + * @memberof google.cloud.visionai.v1alpha1.Criteria + * @instance + */ + Object.defineProperty(Criteria.prototype, "value", { + get: $util.oneOfGetter($oneOfFields = ["textArray", "intRangeArray", "floatRangeArray", "dateTimeRangeArray", "geoLocationArray", "boolValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Criteria instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.Criteria + * @static + * @param {google.cloud.visionai.v1alpha1.ICriteria=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.Criteria} Criteria instance + */ + Criteria.create = function create(properties) { + return new Criteria(properties); + }; + + /** + * Encodes the specified Criteria message. Does not implicitly {@link google.cloud.visionai.v1alpha1.Criteria.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.Criteria + * @static + * @param {google.cloud.visionai.v1alpha1.ICriteria} message Criteria message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Criteria.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.field != null && Object.hasOwnProperty.call(message, "field")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.field); + if (message.textArray != null && Object.hasOwnProperty.call(message, "textArray")) + $root.google.cloud.visionai.v1alpha1.StringArray.encode(message.textArray, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.intRangeArray != null && Object.hasOwnProperty.call(message, "intRangeArray")) + $root.google.cloud.visionai.v1alpha1.IntRangeArray.encode(message.intRangeArray, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.floatRangeArray != null && Object.hasOwnProperty.call(message, "floatRangeArray")) + $root.google.cloud.visionai.v1alpha1.FloatRangeArray.encode(message.floatRangeArray, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.dateTimeRangeArray != null && Object.hasOwnProperty.call(message, "dateTimeRangeArray")) + $root.google.cloud.visionai.v1alpha1.DateTimeRangeArray.encode(message.dateTimeRangeArray, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.geoLocationArray != null && Object.hasOwnProperty.call(message, "geoLocationArray")) + $root.google.cloud.visionai.v1alpha1.GeoLocationArray.encode(message.geoLocationArray, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) + $root.google.cloud.visionai.v1alpha1.BoolValue.encode(message.boolValue, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.fetchMatchedAnnotations != null && Object.hasOwnProperty.call(message, "fetchMatchedAnnotations")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.fetchMatchedAnnotations); + return writer; + }; + + /** + * Encodes the specified Criteria message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.Criteria.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.Criteria + * @static + * @param {google.cloud.visionai.v1alpha1.ICriteria} message Criteria message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Criteria.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Criteria message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.Criteria + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.Criteria} Criteria + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Criteria.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.Criteria(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.textArray = $root.google.cloud.visionai.v1alpha1.StringArray.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.intRangeArray = $root.google.cloud.visionai.v1alpha1.IntRangeArray.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.floatRangeArray = $root.google.cloud.visionai.v1alpha1.FloatRangeArray.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.dateTimeRangeArray = $root.google.cloud.visionai.v1alpha1.DateTimeRangeArray.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.geoLocationArray = $root.google.cloud.visionai.v1alpha1.GeoLocationArray.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + message.boolValue = $root.google.cloud.visionai.v1alpha1.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 1: { + message.field = reader.string(); + break; + } + case 8: { + message.fetchMatchedAnnotations = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Criteria message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.Criteria + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.Criteria} Criteria + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Criteria.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Criteria message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.Criteria + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Criteria.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.textArray != null && message.hasOwnProperty("textArray")) { + properties.value = 1; + { + var error = $root.google.cloud.visionai.v1alpha1.StringArray.verify(message.textArray, long + 1); + if (error) + return "textArray." + error; + } + } + if (message.intRangeArray != null && message.hasOwnProperty("intRangeArray")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.cloud.visionai.v1alpha1.IntRangeArray.verify(message.intRangeArray, long + 1); + if (error) + return "intRangeArray." + error; + } + } + if (message.floatRangeArray != null && message.hasOwnProperty("floatRangeArray")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.cloud.visionai.v1alpha1.FloatRangeArray.verify(message.floatRangeArray, long + 1); + if (error) + return "floatRangeArray." + error; + } + } + if (message.dateTimeRangeArray != null && message.hasOwnProperty("dateTimeRangeArray")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.cloud.visionai.v1alpha1.DateTimeRangeArray.verify(message.dateTimeRangeArray, long + 1); + if (error) + return "dateTimeRangeArray." + error; + } + } + if (message.geoLocationArray != null && message.hasOwnProperty("geoLocationArray")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.cloud.visionai.v1alpha1.GeoLocationArray.verify(message.geoLocationArray, long + 1); + if (error) + return "geoLocationArray." + error; + } + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.cloud.visionai.v1alpha1.BoolValue.verify(message.boolValue, long + 1); + if (error) + return "boolValue." + error; + } + } + if (message.field != null && message.hasOwnProperty("field")) + if (!$util.isString(message.field)) + return "field: string expected"; + if (message.fetchMatchedAnnotations != null && message.hasOwnProperty("fetchMatchedAnnotations")) + if (typeof message.fetchMatchedAnnotations !== "boolean") + return "fetchMatchedAnnotations: boolean expected"; + return null; + }; + + /** + * Creates a Criteria message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.Criteria + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.Criteria} Criteria + */ + Criteria.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.Criteria) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.Criteria(); + if (object.textArray != null) { + if (typeof object.textArray !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Criteria.textArray: object expected"); + message.textArray = $root.google.cloud.visionai.v1alpha1.StringArray.fromObject(object.textArray, long + 1); + } + if (object.intRangeArray != null) { + if (typeof object.intRangeArray !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Criteria.intRangeArray: object expected"); + message.intRangeArray = $root.google.cloud.visionai.v1alpha1.IntRangeArray.fromObject(object.intRangeArray, long + 1); + } + if (object.floatRangeArray != null) { + if (typeof object.floatRangeArray !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Criteria.floatRangeArray: object expected"); + message.floatRangeArray = $root.google.cloud.visionai.v1alpha1.FloatRangeArray.fromObject(object.floatRangeArray, long + 1); + } + if (object.dateTimeRangeArray != null) { + if (typeof object.dateTimeRangeArray !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Criteria.dateTimeRangeArray: object expected"); + message.dateTimeRangeArray = $root.google.cloud.visionai.v1alpha1.DateTimeRangeArray.fromObject(object.dateTimeRangeArray, long + 1); + } + if (object.geoLocationArray != null) { + if (typeof object.geoLocationArray !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Criteria.geoLocationArray: object expected"); + message.geoLocationArray = $root.google.cloud.visionai.v1alpha1.GeoLocationArray.fromObject(object.geoLocationArray, long + 1); + } + if (object.boolValue != null) { + if (typeof object.boolValue !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Criteria.boolValue: object expected"); + message.boolValue = $root.google.cloud.visionai.v1alpha1.BoolValue.fromObject(object.boolValue, long + 1); + } + if (object.field != null) + message.field = String(object.field); + if (object.fetchMatchedAnnotations != null) + message.fetchMatchedAnnotations = Boolean(object.fetchMatchedAnnotations); + return message; + }; + + /** + * Creates a plain object from a Criteria message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.Criteria + * @static + * @param {google.cloud.visionai.v1alpha1.Criteria} message Criteria + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Criteria.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.field = ""; + object.fetchMatchedAnnotations = false; + } + if (message.field != null && message.hasOwnProperty("field")) + object.field = message.field; + if (message.textArray != null && message.hasOwnProperty("textArray")) { + object.textArray = $root.google.cloud.visionai.v1alpha1.StringArray.toObject(message.textArray, options); + if (options.oneofs) + object.value = "textArray"; + } + if (message.intRangeArray != null && message.hasOwnProperty("intRangeArray")) { + object.intRangeArray = $root.google.cloud.visionai.v1alpha1.IntRangeArray.toObject(message.intRangeArray, options); + if (options.oneofs) + object.value = "intRangeArray"; + } + if (message.floatRangeArray != null && message.hasOwnProperty("floatRangeArray")) { + object.floatRangeArray = $root.google.cloud.visionai.v1alpha1.FloatRangeArray.toObject(message.floatRangeArray, options); + if (options.oneofs) + object.value = "floatRangeArray"; + } + if (message.dateTimeRangeArray != null && message.hasOwnProperty("dateTimeRangeArray")) { + object.dateTimeRangeArray = $root.google.cloud.visionai.v1alpha1.DateTimeRangeArray.toObject(message.dateTimeRangeArray, options); + if (options.oneofs) + object.value = "dateTimeRangeArray"; + } + if (message.geoLocationArray != null && message.hasOwnProperty("geoLocationArray")) { + object.geoLocationArray = $root.google.cloud.visionai.v1alpha1.GeoLocationArray.toObject(message.geoLocationArray, options); + if (options.oneofs) + object.value = "geoLocationArray"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + object.boolValue = $root.google.cloud.visionai.v1alpha1.BoolValue.toObject(message.boolValue, options); + if (options.oneofs) + object.value = "boolValue"; + } + if (message.fetchMatchedAnnotations != null && message.hasOwnProperty("fetchMatchedAnnotations")) + object.fetchMatchedAnnotations = message.fetchMatchedAnnotations; + return object; + }; + + /** + * Converts this Criteria to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.Criteria + * @instance + * @returns {Object.} JSON object + */ + Criteria.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Criteria + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.Criteria + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Criteria.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.Criteria"; + }; + + return Criteria; + })(); + + v1alpha1.Partition = (function() { + + /** + * Properties of a Partition. + * @memberof google.cloud.visionai.v1alpha1 + * @interface IPartition + * @property {google.cloud.visionai.v1alpha1.Partition.ITemporalPartition|null} [temporalPartition] Partition temporalPartition + * @property {google.cloud.visionai.v1alpha1.Partition.ISpatialPartition|null} [spatialPartition] Partition spatialPartition + */ + + /** + * Constructs a new Partition. + * @memberof google.cloud.visionai.v1alpha1 + * @classdesc Represents a Partition. + * @implements IPartition + * @constructor + * @param {google.cloud.visionai.v1alpha1.IPartition=} [properties] Properties to set + */ + function Partition(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Partition temporalPartition. + * @member {google.cloud.visionai.v1alpha1.Partition.ITemporalPartition|null|undefined} temporalPartition + * @memberof google.cloud.visionai.v1alpha1.Partition + * @instance + */ + Partition.prototype.temporalPartition = null; + + /** + * Partition spatialPartition. + * @member {google.cloud.visionai.v1alpha1.Partition.ISpatialPartition|null|undefined} spatialPartition + * @memberof google.cloud.visionai.v1alpha1.Partition + * @instance + */ + Partition.prototype.spatialPartition = null; + + /** + * Creates a new Partition instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.Partition + * @static + * @param {google.cloud.visionai.v1alpha1.IPartition=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.Partition} Partition instance + */ + Partition.create = function create(properties) { + return new Partition(properties); + }; + + /** + * Encodes the specified Partition message. Does not implicitly {@link google.cloud.visionai.v1alpha1.Partition.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.Partition + * @static + * @param {google.cloud.visionai.v1alpha1.IPartition} message Partition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Partition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.temporalPartition != null && Object.hasOwnProperty.call(message, "temporalPartition")) + $root.google.cloud.visionai.v1alpha1.Partition.TemporalPartition.encode(message.temporalPartition, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.spatialPartition != null && Object.hasOwnProperty.call(message, "spatialPartition")) + $root.google.cloud.visionai.v1alpha1.Partition.SpatialPartition.encode(message.spatialPartition, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Partition message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.Partition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.Partition + * @static + * @param {google.cloud.visionai.v1alpha1.IPartition} message Partition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Partition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Partition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.Partition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.Partition} Partition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Partition.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.Partition(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.temporalPartition = $root.google.cloud.visionai.v1alpha1.Partition.TemporalPartition.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.spatialPartition = $root.google.cloud.visionai.v1alpha1.Partition.SpatialPartition.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Partition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.Partition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.Partition} Partition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Partition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Partition message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.Partition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Partition.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.temporalPartition != null && message.hasOwnProperty("temporalPartition")) { + var error = $root.google.cloud.visionai.v1alpha1.Partition.TemporalPartition.verify(message.temporalPartition, long + 1); + if (error) + return "temporalPartition." + error; + } + if (message.spatialPartition != null && message.hasOwnProperty("spatialPartition")) { + var error = $root.google.cloud.visionai.v1alpha1.Partition.SpatialPartition.verify(message.spatialPartition, long + 1); + if (error) + return "spatialPartition." + error; + } + return null; + }; + + /** + * Creates a Partition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.Partition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.Partition} Partition + */ + Partition.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.Partition) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.Partition(); + if (object.temporalPartition != null) { + if (typeof object.temporalPartition !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Partition.temporalPartition: object expected"); + message.temporalPartition = $root.google.cloud.visionai.v1alpha1.Partition.TemporalPartition.fromObject(object.temporalPartition, long + 1); + } + if (object.spatialPartition != null) { + if (typeof object.spatialPartition !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Partition.spatialPartition: object expected"); + message.spatialPartition = $root.google.cloud.visionai.v1alpha1.Partition.SpatialPartition.fromObject(object.spatialPartition, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a Partition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.Partition + * @static + * @param {google.cloud.visionai.v1alpha1.Partition} message Partition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Partition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.temporalPartition = null; + object.spatialPartition = null; + } + if (message.temporalPartition != null && message.hasOwnProperty("temporalPartition")) + object.temporalPartition = $root.google.cloud.visionai.v1alpha1.Partition.TemporalPartition.toObject(message.temporalPartition, options); + if (message.spatialPartition != null && message.hasOwnProperty("spatialPartition")) + object.spatialPartition = $root.google.cloud.visionai.v1alpha1.Partition.SpatialPartition.toObject(message.spatialPartition, options); + return object; + }; + + /** + * Converts this Partition to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.Partition + * @instance + * @returns {Object.} JSON object + */ + Partition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Partition + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.Partition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Partition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.Partition"; + }; + + Partition.TemporalPartition = (function() { + + /** + * Properties of a TemporalPartition. + * @memberof google.cloud.visionai.v1alpha1.Partition + * @interface ITemporalPartition + * @property {google.protobuf.ITimestamp|null} [startTime] TemporalPartition startTime + * @property {google.protobuf.ITimestamp|null} [endTime] TemporalPartition endTime + */ + + /** + * Constructs a new TemporalPartition. + * @memberof google.cloud.visionai.v1alpha1.Partition + * @classdesc Represents a TemporalPartition. + * @implements ITemporalPartition + * @constructor + * @param {google.cloud.visionai.v1alpha1.Partition.ITemporalPartition=} [properties] Properties to set + */ + function TemporalPartition(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TemporalPartition startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.visionai.v1alpha1.Partition.TemporalPartition + * @instance + */ + TemporalPartition.prototype.startTime = null; + + /** + * TemporalPartition endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.visionai.v1alpha1.Partition.TemporalPartition + * @instance + */ + TemporalPartition.prototype.endTime = null; + + /** + * Creates a new TemporalPartition instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.Partition.TemporalPartition + * @static + * @param {google.cloud.visionai.v1alpha1.Partition.ITemporalPartition=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.Partition.TemporalPartition} TemporalPartition instance + */ + TemporalPartition.create = function create(properties) { + return new TemporalPartition(properties); + }; + + /** + * Encodes the specified TemporalPartition message. Does not implicitly {@link google.cloud.visionai.v1alpha1.Partition.TemporalPartition.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.Partition.TemporalPartition + * @static + * @param {google.cloud.visionai.v1alpha1.Partition.ITemporalPartition} message TemporalPartition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TemporalPartition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TemporalPartition message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.Partition.TemporalPartition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.Partition.TemporalPartition + * @static + * @param {google.cloud.visionai.v1alpha1.Partition.ITemporalPartition} message TemporalPartition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TemporalPartition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TemporalPartition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.Partition.TemporalPartition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.Partition.TemporalPartition} TemporalPartition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TemporalPartition.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.Partition.TemporalPartition(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TemporalPartition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.Partition.TemporalPartition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.Partition.TemporalPartition} TemporalPartition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TemporalPartition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TemporalPartition message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.Partition.TemporalPartition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TemporalPartition.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime, long + 1); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime, long + 1); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates a TemporalPartition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.Partition.TemporalPartition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.Partition.TemporalPartition} TemporalPartition + */ + TemporalPartition.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.Partition.TemporalPartition) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.Partition.TemporalPartition(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Partition.TemporalPartition.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime, long + 1); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.visionai.v1alpha1.Partition.TemporalPartition.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a TemporalPartition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.Partition.TemporalPartition + * @static + * @param {google.cloud.visionai.v1alpha1.Partition.TemporalPartition} message TemporalPartition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TemporalPartition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startTime = null; + object.endTime = null; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this TemporalPartition to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.Partition.TemporalPartition + * @instance + * @returns {Object.} JSON object + */ + TemporalPartition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TemporalPartition + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.Partition.TemporalPartition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TemporalPartition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.Partition.TemporalPartition"; + }; + + return TemporalPartition; + })(); + + Partition.SpatialPartition = (function() { + + /** + * Properties of a SpatialPartition. + * @memberof google.cloud.visionai.v1alpha1.Partition + * @interface ISpatialPartition + * @property {number|Long|null} [xMin] SpatialPartition xMin + * @property {number|Long|null} [yMin] SpatialPartition yMin + * @property {number|Long|null} [xMax] SpatialPartition xMax + * @property {number|Long|null} [yMax] SpatialPartition yMax + */ + + /** + * Constructs a new SpatialPartition. + * @memberof google.cloud.visionai.v1alpha1.Partition + * @classdesc Represents a SpatialPartition. + * @implements ISpatialPartition + * @constructor + * @param {google.cloud.visionai.v1alpha1.Partition.ISpatialPartition=} [properties] Properties to set + */ + function SpatialPartition(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpatialPartition xMin. + * @member {number|Long|null|undefined} xMin + * @memberof google.cloud.visionai.v1alpha1.Partition.SpatialPartition + * @instance + */ + SpatialPartition.prototype.xMin = null; + + /** + * SpatialPartition yMin. + * @member {number|Long|null|undefined} yMin + * @memberof google.cloud.visionai.v1alpha1.Partition.SpatialPartition + * @instance + */ + SpatialPartition.prototype.yMin = null; + + /** + * SpatialPartition xMax. + * @member {number|Long|null|undefined} xMax + * @memberof google.cloud.visionai.v1alpha1.Partition.SpatialPartition + * @instance + */ + SpatialPartition.prototype.xMax = null; + + /** + * SpatialPartition yMax. + * @member {number|Long|null|undefined} yMax + * @memberof google.cloud.visionai.v1alpha1.Partition.SpatialPartition + * @instance + */ + SpatialPartition.prototype.yMax = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SpatialPartition.prototype, "_xMin", { + get: $util.oneOfGetter($oneOfFields = ["xMin"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SpatialPartition.prototype, "_yMin", { + get: $util.oneOfGetter($oneOfFields = ["yMin"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SpatialPartition.prototype, "_xMax", { + get: $util.oneOfGetter($oneOfFields = ["xMax"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SpatialPartition.prototype, "_yMax", { + get: $util.oneOfGetter($oneOfFields = ["yMax"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SpatialPartition instance using the specified properties. + * @function create + * @memberof google.cloud.visionai.v1alpha1.Partition.SpatialPartition + * @static + * @param {google.cloud.visionai.v1alpha1.Partition.ISpatialPartition=} [properties] Properties to set + * @returns {google.cloud.visionai.v1alpha1.Partition.SpatialPartition} SpatialPartition instance + */ + SpatialPartition.create = function create(properties) { + return new SpatialPartition(properties); + }; + + /** + * Encodes the specified SpatialPartition message. Does not implicitly {@link google.cloud.visionai.v1alpha1.Partition.SpatialPartition.verify|verify} messages. + * @function encode + * @memberof google.cloud.visionai.v1alpha1.Partition.SpatialPartition + * @static + * @param {google.cloud.visionai.v1alpha1.Partition.ISpatialPartition} message SpatialPartition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpatialPartition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.xMin != null && Object.hasOwnProperty.call(message, "xMin")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.xMin); + if (message.yMin != null && Object.hasOwnProperty.call(message, "yMin")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.yMin); + if (message.xMax != null && Object.hasOwnProperty.call(message, "xMax")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.xMax); + if (message.yMax != null && Object.hasOwnProperty.call(message, "yMax")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.yMax); + return writer; + }; + + /** + * Encodes the specified SpatialPartition message, length delimited. Does not implicitly {@link google.cloud.visionai.v1alpha1.Partition.SpatialPartition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.visionai.v1alpha1.Partition.SpatialPartition + * @static + * @param {google.cloud.visionai.v1alpha1.Partition.ISpatialPartition} message SpatialPartition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpatialPartition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpatialPartition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.visionai.v1alpha1.Partition.SpatialPartition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.visionai.v1alpha1.Partition.SpatialPartition} SpatialPartition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpatialPartition.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.visionai.v1alpha1.Partition.SpatialPartition(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.xMin = reader.int64(); + break; + } + case 2: { + message.yMin = reader.int64(); + break; + } + case 3: { + message.xMax = reader.int64(); + break; + } + case 4: { + message.yMax = reader.int64(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SpatialPartition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.visionai.v1alpha1.Partition.SpatialPartition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.visionai.v1alpha1.Partition.SpatialPartition} SpatialPartition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpatialPartition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpatialPartition message. + * @function verify + * @memberof google.cloud.visionai.v1alpha1.Partition.SpatialPartition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpatialPartition.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.xMin != null && message.hasOwnProperty("xMin")) { + properties._xMin = 1; + if (!$util.isInteger(message.xMin) && !(message.xMin && $util.isInteger(message.xMin.low) && $util.isInteger(message.xMin.high))) + return "xMin: integer|Long expected"; + } + if (message.yMin != null && message.hasOwnProperty("yMin")) { + properties._yMin = 1; + if (!$util.isInteger(message.yMin) && !(message.yMin && $util.isInteger(message.yMin.low) && $util.isInteger(message.yMin.high))) + return "yMin: integer|Long expected"; + } + if (message.xMax != null && message.hasOwnProperty("xMax")) { + properties._xMax = 1; + if (!$util.isInteger(message.xMax) && !(message.xMax && $util.isInteger(message.xMax.low) && $util.isInteger(message.xMax.high))) + return "xMax: integer|Long expected"; + } + if (message.yMax != null && message.hasOwnProperty("yMax")) { + properties._yMax = 1; + if (!$util.isInteger(message.yMax) && !(message.yMax && $util.isInteger(message.yMax.low) && $util.isInteger(message.yMax.high))) + return "yMax: integer|Long expected"; + } + return null; + }; + + /** + * Creates a SpatialPartition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.visionai.v1alpha1.Partition.SpatialPartition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.visionai.v1alpha1.Partition.SpatialPartition} SpatialPartition + */ + SpatialPartition.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.visionai.v1alpha1.Partition.SpatialPartition) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.visionai.v1alpha1.Partition.SpatialPartition(); + if (object.xMin != null) + if ($util.Long) + (message.xMin = $util.Long.fromValue(object.xMin)).unsigned = false; + else if (typeof object.xMin === "string") + message.xMin = parseInt(object.xMin, 10); + else if (typeof object.xMin === "number") + message.xMin = object.xMin; + else if (typeof object.xMin === "object") + message.xMin = new $util.LongBits(object.xMin.low >>> 0, object.xMin.high >>> 0).toNumber(); + if (object.yMin != null) + if ($util.Long) + (message.yMin = $util.Long.fromValue(object.yMin)).unsigned = false; + else if (typeof object.yMin === "string") + message.yMin = parseInt(object.yMin, 10); + else if (typeof object.yMin === "number") + message.yMin = object.yMin; + else if (typeof object.yMin === "object") + message.yMin = new $util.LongBits(object.yMin.low >>> 0, object.yMin.high >>> 0).toNumber(); + if (object.xMax != null) + if ($util.Long) + (message.xMax = $util.Long.fromValue(object.xMax)).unsigned = false; + else if (typeof object.xMax === "string") + message.xMax = parseInt(object.xMax, 10); + else if (typeof object.xMax === "number") + message.xMax = object.xMax; + else if (typeof object.xMax === "object") + message.xMax = new $util.LongBits(object.xMax.low >>> 0, object.xMax.high >>> 0).toNumber(); + if (object.yMax != null) + if ($util.Long) + (message.yMax = $util.Long.fromValue(object.yMax)).unsigned = false; + else if (typeof object.yMax === "string") + message.yMax = parseInt(object.yMax, 10); + else if (typeof object.yMax === "number") + message.yMax = object.yMax; + else if (typeof object.yMax === "object") + message.yMax = new $util.LongBits(object.yMax.low >>> 0, object.yMax.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a SpatialPartition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.visionai.v1alpha1.Partition.SpatialPartition + * @static + * @param {google.cloud.visionai.v1alpha1.Partition.SpatialPartition} message SpatialPartition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpatialPartition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.xMin != null && message.hasOwnProperty("xMin")) { + if (typeof message.xMin === "number") + object.xMin = options.longs === String ? String(message.xMin) : message.xMin; + else + object.xMin = options.longs === String ? $util.Long.prototype.toString.call(message.xMin) : options.longs === Number ? new $util.LongBits(message.xMin.low >>> 0, message.xMin.high >>> 0).toNumber() : message.xMin; + if (options.oneofs) + object._xMin = "xMin"; + } + if (message.yMin != null && message.hasOwnProperty("yMin")) { + if (typeof message.yMin === "number") + object.yMin = options.longs === String ? String(message.yMin) : message.yMin; + else + object.yMin = options.longs === String ? $util.Long.prototype.toString.call(message.yMin) : options.longs === Number ? new $util.LongBits(message.yMin.low >>> 0, message.yMin.high >>> 0).toNumber() : message.yMin; + if (options.oneofs) + object._yMin = "yMin"; + } + if (message.xMax != null && message.hasOwnProperty("xMax")) { + if (typeof message.xMax === "number") + object.xMax = options.longs === String ? String(message.xMax) : message.xMax; + else + object.xMax = options.longs === String ? $util.Long.prototype.toString.call(message.xMax) : options.longs === Number ? new $util.LongBits(message.xMax.low >>> 0, message.xMax.high >>> 0).toNumber() : message.xMax; + if (options.oneofs) + object._xMax = "xMax"; + } + if (message.yMax != null && message.hasOwnProperty("yMax")) { + if (typeof message.yMax === "number") + object.yMax = options.longs === String ? String(message.yMax) : message.yMax; + else + object.yMax = options.longs === String ? $util.Long.prototype.toString.call(message.yMax) : options.longs === Number ? new $util.LongBits(message.yMax.low >>> 0, message.yMax.high >>> 0).toNumber() : message.yMax; + if (options.oneofs) + object._yMax = "yMax"; + } + return object; + }; + + /** + * Converts this SpatialPartition to JSON. + * @function toJSON + * @memberof google.cloud.visionai.v1alpha1.Partition.SpatialPartition + * @instance + * @returns {Object.} JSON object + */ + SpatialPartition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpatialPartition + * @function getTypeUrl + * @memberof google.cloud.visionai.v1alpha1.Partition.SpatialPartition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpatialPartition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.visionai.v1alpha1.Partition.SpatialPartition"; + }; + + return SpatialPartition; + })(); + + return Partition; + })(); + + return v1alpha1; + })(); + return visionai; })(); diff --git a/packages/google-cloud-visionai/protos/protos.json b/packages/google-cloud-visionai/protos/protos.json index b7c9bd43cce5..ea9e17e88dc1 100644 --- a/packages/google-cloud-visionai/protos/protos.json +++ b/packages/google-cloud-visionai/protos/protos.json @@ -13197,6 +13197,7873 @@ } } } + }, + "v1alpha1": { + "options": { + "csharp_namespace": "Google.Cloud.VisionAI.V1Alpha1", + "go_package": "cloud.google.com/go/visionai/apiv1alpha1/visionaipb;visionaipb", + "java_multiple_files": true, + "java_outer_classname": "WarehouseProto", + "java_package": "com.google.cloud.visionai.v1alpha1", + "php_namespace": "Google\\Cloud\\VisionAI\\V1alpha1", + "ruby_package": "Google::Cloud::VisionAI::V1alpha1" + }, + "nested": { + "StreamAnnotationType": { + "values": { + "STREAM_ANNOTATION_TYPE_UNSPECIFIED": 0, + "STREAM_ANNOTATION_TYPE_ACTIVE_ZONE": 1, + "STREAM_ANNOTATION_TYPE_CROSSING_LINE": 2 + } + }, + "PersonalProtectiveEquipmentDetectionOutput": { + "fields": { + "currentTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "detectedPersons": { + "rule": "repeated", + "type": "DetectedPerson", + "id": 2 + } + }, + "nested": { + "PersonEntity": { + "fields": { + "personEntityId": { + "type": "int64", + "id": 1 + } + } + }, + "PPEEntity": { + "fields": { + "ppeLabelId": { + "type": "int64", + "id": 1 + }, + "ppeLabelString": { + "type": "string", + "id": 2 + }, + "ppeSupercategoryLabelString": { + "type": "string", + "id": 3 + }, + "ppeEntityId": { + "type": "int64", + "id": 4 + } + } + }, + "NormalizedBoundingBox": { + "fields": { + "xmin": { + "type": "float", + "id": 1 + }, + "ymin": { + "type": "float", + "id": 2 + }, + "width": { + "type": "float", + "id": 3 + }, + "height": { + "type": "float", + "id": 4 + } + } + }, + "PersonIdentifiedBox": { + "fields": { + "boxId": { + "type": "int64", + "id": 1 + }, + "normalizedBoundingBox": { + "type": "NormalizedBoundingBox", + "id": 2 + }, + "confidenceScore": { + "type": "float", + "id": 3 + }, + "personEntity": { + "type": "PersonEntity", + "id": 4 + } + } + }, + "PPEIdentifiedBox": { + "fields": { + "boxId": { + "type": "int64", + "id": 1 + }, + "normalizedBoundingBox": { + "type": "NormalizedBoundingBox", + "id": 2 + }, + "confidenceScore": { + "type": "float", + "id": 3 + }, + "ppeEntity": { + "type": "PPEEntity", + "id": 4 + } + } + }, + "DetectedPerson": { + "oneofs": { + "_faceCoverageScore": { + "oneof": [ + "faceCoverageScore" + ] + }, + "_eyesCoverageScore": { + "oneof": [ + "eyesCoverageScore" + ] + }, + "_headCoverageScore": { + "oneof": [ + "headCoverageScore" + ] + }, + "_handsCoverageScore": { + "oneof": [ + "handsCoverageScore" + ] + }, + "_bodyCoverageScore": { + "oneof": [ + "bodyCoverageScore" + ] + }, + "_feetCoverageScore": { + "oneof": [ + "feetCoverageScore" + ] + } + }, + "fields": { + "personId": { + "type": "int64", + "id": 1 + }, + "detectedPersonIdentifiedBox": { + "type": "PersonIdentifiedBox", + "id": 2 + }, + "detectedPpeIdentifiedBoxes": { + "rule": "repeated", + "type": "PPEIdentifiedBox", + "id": 3 + }, + "faceCoverageScore": { + "type": "float", + "id": 4, + "options": { + "proto3_optional": true + } + }, + "eyesCoverageScore": { + "type": "float", + "id": 5, + "options": { + "proto3_optional": true + } + }, + "headCoverageScore": { + "type": "float", + "id": 6, + "options": { + "proto3_optional": true + } + }, + "handsCoverageScore": { + "type": "float", + "id": 7, + "options": { + "proto3_optional": true + } + }, + "bodyCoverageScore": { + "type": "float", + "id": 8, + "options": { + "proto3_optional": true + } + }, + "feetCoverageScore": { + "type": "float", + "id": 9, + "options": { + "proto3_optional": true + } + } + } + } + } + }, + "ObjectDetectionPredictionResult": { + "fields": { + "currentTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "identifiedBoxes": { + "rule": "repeated", + "type": "IdentifiedBox", + "id": 2 + } + }, + "nested": { + "Entity": { + "fields": { + "labelId": { + "type": "int64", + "id": 1 + }, + "labelString": { + "type": "string", + "id": 2 + } + } + }, + "IdentifiedBox": { + "fields": { + "boxId": { + "type": "int64", + "id": 1 + }, + "normalizedBoundingBox": { + "type": "NormalizedBoundingBox", + "id": 2 + }, + "confidenceScore": { + "type": "float", + "id": 3 + }, + "entity": { + "type": "Entity", + "id": 4 + } + }, + "nested": { + "NormalizedBoundingBox": { + "fields": { + "xmin": { + "type": "float", + "id": 1 + }, + "ymin": { + "type": "float", + "id": 2 + }, + "width": { + "type": "float", + "id": 3 + }, + "height": { + "type": "float", + "id": 4 + } + } + } + } + } + } + }, + "ImageObjectDetectionPredictionResult": { + "fields": { + "ids": { + "rule": "repeated", + "type": "int64", + "id": 1 + }, + "displayNames": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "confidences": { + "rule": "repeated", + "type": "float", + "id": 3 + }, + "bboxes": { + "rule": "repeated", + "type": "google.protobuf.ListValue", + "id": 4 + } + } + }, + "ClassificationPredictionResult": { + "fields": { + "ids": { + "rule": "repeated", + "type": "int64", + "id": 1 + }, + "displayNames": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "confidences": { + "rule": "repeated", + "type": "float", + "id": 3 + } + } + }, + "ImageSegmentationPredictionResult": { + "fields": { + "categoryMask": { + "type": "string", + "id": 1 + }, + "confidenceMask": { + "type": "string", + "id": 2 + } + } + }, + "VideoActionRecognitionPredictionResult": { + "fields": { + "segmentStartTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "segmentEndTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "actions": { + "rule": "repeated", + "type": "IdentifiedAction", + "id": 3 + } + }, + "nested": { + "IdentifiedAction": { + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "confidence": { + "type": "float", + "id": 3 + } + } + } + } + }, + "VideoObjectTrackingPredictionResult": { + "fields": { + "segmentStartTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "segmentEndTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "objects": { + "rule": "repeated", + "type": "DetectedObject", + "id": 3 + } + }, + "nested": { + "BoundingBox": { + "fields": { + "xMin": { + "type": "float", + "id": 1 + }, + "xMax": { + "type": "float", + "id": 2 + }, + "yMin": { + "type": "float", + "id": 3 + }, + "yMax": { + "type": "float", + "id": 4 + } + } + }, + "DetectedObject": { + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "boundingBox": { + "type": "BoundingBox", + "id": 3 + }, + "confidence": { + "type": "float", + "id": 4 + }, + "trackId": { + "type": "int64", + "id": 5 + } + } + } + } + }, + "VideoClassificationPredictionResult": { + "fields": { + "segmentStartTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "segmentEndTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "classifications": { + "rule": "repeated", + "type": "IdentifiedClassification", + "id": 3 + } + }, + "nested": { + "IdentifiedClassification": { + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "confidence": { + "type": "float", + "id": 3 + } + } + } + } + }, + "OccupancyCountingPredictionResult": { + "fields": { + "currentTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "identifiedBoxes": { + "rule": "repeated", + "type": "IdentifiedBox", + "id": 2 + }, + "stats": { + "type": "Stats", + "id": 3 + }, + "trackInfo": { + "rule": "repeated", + "type": "TrackInfo", + "id": 4 + }, + "dwellTimeInfo": { + "rule": "repeated", + "type": "DwellTimeInfo", + "id": 5 + } + }, + "nested": { + "Entity": { + "fields": { + "labelId": { + "type": "int64", + "id": 1 + }, + "labelString": { + "type": "string", + "id": 2 + } + } + }, + "IdentifiedBox": { + "fields": { + "boxId": { + "type": "int64", + "id": 1 + }, + "normalizedBoundingBox": { + "type": "NormalizedBoundingBox", + "id": 2 + }, + "score": { + "type": "float", + "id": 3 + }, + "entity": { + "type": "Entity", + "id": 4 + }, + "trackId": { + "type": "int64", + "id": 5 + } + }, + "nested": { + "NormalizedBoundingBox": { + "fields": { + "xmin": { + "type": "float", + "id": 1 + }, + "ymin": { + "type": "float", + "id": 2 + }, + "width": { + "type": "float", + "id": 3 + }, + "height": { + "type": "float", + "id": 4 + } + } + } + } + }, + "Stats": { + "fields": { + "fullFrameCount": { + "rule": "repeated", + "type": "ObjectCount", + "id": 1 + }, + "crossingLineCounts": { + "rule": "repeated", + "type": "CrossingLineCount", + "id": 2 + }, + "activeZoneCounts": { + "rule": "repeated", + "type": "ActiveZoneCount", + "id": 3 + } + }, + "nested": { + "ObjectCount": { + "fields": { + "entity": { + "type": "Entity", + "id": 1 + }, + "count": { + "type": "int32", + "id": 2 + } + } + }, + "AccumulatedObjectCount": { + "fields": { + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "objectCount": { + "type": "ObjectCount", + "id": 2 + } + } + }, + "CrossingLineCount": { + "fields": { + "annotation": { + "type": "StreamAnnotation", + "id": 1 + }, + "positiveDirectionCounts": { + "rule": "repeated", + "type": "ObjectCount", + "id": 2 + }, + "negativeDirectionCounts": { + "rule": "repeated", + "type": "ObjectCount", + "id": 3 + }, + "accumulatedPositiveDirectionCounts": { + "rule": "repeated", + "type": "AccumulatedObjectCount", + "id": 4 + }, + "accumulatedNegativeDirectionCounts": { + "rule": "repeated", + "type": "AccumulatedObjectCount", + "id": 5 + } + } + }, + "ActiveZoneCount": { + "fields": { + "annotation": { + "type": "StreamAnnotation", + "id": 1 + }, + "counts": { + "rule": "repeated", + "type": "ObjectCount", + "id": 2 + } + } + } + } + }, + "TrackInfo": { + "fields": { + "trackId": { + "type": "string", + "id": 1 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + }, + "DwellTimeInfo": { + "fields": { + "trackId": { + "type": "string", + "id": 1 + }, + "zoneId": { + "type": "string", + "id": 2 + }, + "dwellStartTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "dwellEndTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + } + } + } + } + }, + "StreamAnnotation": { + "oneofs": { + "annotationPayload": { + "oneof": [ + "activeZone", + "crossingLine" + ] + } + }, + "fields": { + "activeZone": { + "type": "NormalizedPolygon", + "id": 5 + }, + "crossingLine": { + "type": "NormalizedPolyline", + "id": 6 + }, + "id": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "sourceStream": { + "type": "string", + "id": 3 + }, + "type": { + "type": "StreamAnnotationType", + "id": 4 + } + } + }, + "StreamAnnotations": { + "fields": { + "streamAnnotations": { + "rule": "repeated", + "type": "StreamAnnotation", + "id": 1 + } + } + }, + "NormalizedPolygon": { + "fields": { + "normalizedVertices": { + "rule": "repeated", + "type": "NormalizedVertex", + "id": 1 + } + } + }, + "NormalizedPolyline": { + "fields": { + "normalizedVertices": { + "rule": "repeated", + "type": "NormalizedVertex", + "id": 1 + } + } + }, + "NormalizedVertex": { + "fields": { + "x": { + "type": "float", + "id": 1 + }, + "y": { + "type": "float", + "id": 2 + } + } + }, + "AppPlatformMetadata": { + "fields": { + "application": { + "type": "string", + "id": 1 + }, + "instanceId": { + "type": "string", + "id": 2 + }, + "node": { + "type": "string", + "id": 3 + }, + "processor": { + "type": "string", + "id": 4 + } + } + }, + "AppPlatformCloudFunctionRequest": { + "fields": { + "appPlatformMetadata": { + "type": "AppPlatformMetadata", + "id": 1 + }, + "annotations": { + "rule": "repeated", + "type": "StructedInputAnnotation", + "id": 2 + } + }, + "nested": { + "StructedInputAnnotation": { + "fields": { + "ingestionTimeMicros": { + "type": "int64", + "id": 1 + }, + "annotation": { + "type": "google.protobuf.Struct", + "id": 2 + } + } + } + } + }, + "AppPlatformCloudFunctionResponse": { + "fields": { + "annotations": { + "rule": "repeated", + "type": "StructedOutputAnnotation", + "id": 2 + }, + "annotationPassthrough": { + "type": "bool", + "id": 3 + }, + "events": { + "rule": "repeated", + "type": "AppPlatformEventBody", + "id": 4 + } + }, + "nested": { + "StructedOutputAnnotation": { + "fields": { + "annotation": { + "type": "google.protobuf.Struct", + "id": 1 + } + } + } + } + }, + "AppPlatformEventBody": { + "fields": { + "eventMessage": { + "type": "string", + "id": 1 + }, + "payload": { + "type": "google.protobuf.Struct", + "id": 2 + }, + "eventId": { + "type": "string", + "id": 3 + } + } + }, + "Cluster": { + "options": { + "(google.api.resource).type": "visionai.googleapis.com/Cluster", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/clusters/{cluster}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4 + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 5 + }, + "dataplaneServiceEndpoint": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "pscTarget": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "PROVISIONING": 1, + "RUNNING": 2, + "STOPPING": 3, + "ERROR": 4 + } + } + } + }, + "OperationMetadata": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "target": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "verb": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "statusMessage": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "requestedCancellation": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "apiVersion": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "GcsSource": { + "fields": { + "uris": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AttributeValue": { + "oneofs": { + "value": { + "oneof": [ + "i", + "f", + "b", + "s" + ] + } + }, + "fields": { + "i": { + "type": "int64", + "id": 1 + }, + "f": { + "type": "float", + "id": 2 + }, + "b": { + "type": "bool", + "id": 3 + }, + "s": { + "type": "bytes", + "id": 4 + } + } + }, + "AnalyzerDefinition": { + "fields": { + "analyzer": { + "type": "string", + "id": 1 + }, + "operator": { + "type": "string", + "id": 2 + }, + "inputs": { + "rule": "repeated", + "type": "StreamInput", + "id": 3 + }, + "attrs": { + "keyType": "string", + "type": "AttributeValue", + "id": 4 + }, + "debugOptions": { + "type": "DebugOptions", + "id": 5 + } + }, + "nested": { + "StreamInput": { + "fields": { + "input": { + "type": "string", + "id": 1 + } + } + }, + "DebugOptions": { + "fields": { + "environmentVariables": { + "keyType": "string", + "type": "string", + "id": 1 + } + } + } + } + }, + "AnalysisDefinition": { + "fields": { + "analyzers": { + "rule": "repeated", + "type": "AnalyzerDefinition", + "id": 1 + } + } + }, + "Analysis": { + "options": { + "(google.api.resource).type": "visionai.googleapis.com/Analysis", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/clusters/{cluster}/analyses/{analysis}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4 + }, + "analysisDefinition": { + "type": "AnalysisDefinition", + "id": 5 + }, + "inputStreamsMapping": { + "keyType": "string", + "type": "string", + "id": 6 + }, + "outputStreamsMapping": { + "keyType": "string", + "type": "string", + "id": 7 + } + } + }, + "LiveVideoAnalytics": { + "options": { + "(google.api.default_host)": "visionai.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListAnalyses": { + "requestType": "ListAnalysesRequest", + "responseType": "ListAnalysesResponse", + "options": { + "(google.api.http).get": "/v1alpha1/{parent=projects/*/locations/*/clusters/*}/analyses", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha1/{parent=projects/*/locations/*/clusters/*}/analyses" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetAnalysis": { + "requestType": "GetAnalysisRequest", + "responseType": "Analysis", + "options": { + "(google.api.http).get": "/v1alpha1/{name=projects/*/locations/*/clusters/*/analyses/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha1/{name=projects/*/locations/*/clusters/*/analyses/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateAnalysis": { + "requestType": "CreateAnalysisRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1alpha1/{parent=projects/*/locations/*/clusters/*}/analyses", + "(google.api.http).body": "analysis", + "(google.api.method_signature)": "parent,analysis,analysis_id", + "(google.longrunning.operation_info).response_type": "Analysis", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha1/{parent=projects/*/locations/*/clusters/*}/analyses", + "body": "analysis" + } + }, + { + "(google.api.method_signature)": "parent,analysis,analysis_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Analysis", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateAnalysis": { + "requestType": "UpdateAnalysisRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1alpha1/{analysis.name=projects/*/locations/*/clusters/*/analyses/*}", + "(google.api.http).body": "analysis", + "(google.api.method_signature)": "analysis,update_mask", + "(google.longrunning.operation_info).response_type": "Analysis", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1alpha1/{analysis.name=projects/*/locations/*/clusters/*/analyses/*}", + "body": "analysis" + } + }, + { + "(google.api.method_signature)": "analysis,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Analysis", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteAnalysis": { + "requestType": "DeleteAnalysisRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1alpha1/{name=projects/*/locations/*/clusters/*/analyses/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1alpha1/{name=projects/*/locations/*/clusters/*/analyses/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + } + } + }, + "ListAnalysesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "visionai.googleapis.com/Cluster" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListAnalysesResponse": { + "fields": { + "analyses": { + "rule": "repeated", + "type": "Analysis", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetAnalysisRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "visionai.googleapis.com/Analysis" + } + } + } + }, + "CreateAnalysisRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "visionai.googleapis.com/Cluster" + } + }, + "analysisId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "analysis": { + "type": "Analysis", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateAnalysisRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "analysis": { + "type": "Analysis", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteAnalysisRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "visionai.googleapis.com/Analysis" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "AppPlatform": { + "options": { + "(google.api.default_host)": "visionai.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListApplications": { + "requestType": "ListApplicationsRequest", + "responseType": "ListApplicationsResponse", + "options": { + "(google.api.http).get": "/v1alpha1/{parent=projects/*/locations/*}/applications", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha1/{parent=projects/*/locations/*}/applications" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetApplication": { + "requestType": "GetApplicationRequest", + "responseType": "Application", + "options": { + "(google.api.http).get": "/v1alpha1/{name=projects/*/locations/*/applications/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha1/{name=projects/*/locations/*/applications/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateApplication": { + "requestType": "CreateApplicationRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1alpha1/{parent=projects/*/locations/*}/applications", + "(google.api.http).body": "application", + "(google.api.method_signature)": "parent,application", + "(google.longrunning.operation_info).response_type": "Application", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha1/{parent=projects/*/locations/*}/applications", + "body": "application" + } + }, + { + "(google.api.method_signature)": "parent,application" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Application", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateApplication": { + "requestType": "UpdateApplicationRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1alpha1/{application.name=projects/*/locations/*/applications/*}", + "(google.api.http).body": "application", + "(google.api.method_signature)": "application,update_mask", + "(google.longrunning.operation_info).response_type": "Application", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1alpha1/{application.name=projects/*/locations/*/applications/*}", + "body": "application" + } + }, + { + "(google.api.method_signature)": "application,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Application", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteApplication": { + "requestType": "DeleteApplicationRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1alpha1/{name=projects/*/locations/*/applications/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1alpha1/{name=projects/*/locations/*/applications/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeployApplication": { + "requestType": "DeployApplicationRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1alpha1/{name=projects/*/locations/*/applications/*}:deploy", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "DeployApplicationResponse", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha1/{name=projects/*/locations/*/applications/*}:deploy", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "DeployApplicationResponse", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UndeployApplication": { + "requestType": "UndeployApplicationRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1alpha1/{name=projects/*/locations/*/applications/*}:undeploy", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "UndeployApplicationResponse", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha1/{name=projects/*/locations/*/applications/*}:undeploy", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "UndeployApplicationResponse", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "AddApplicationStreamInput": { + "requestType": "AddApplicationStreamInputRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1alpha1/{name=projects/*/locations/*/applications/*}:addStreamInput", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "AddApplicationStreamInputResponse", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha1/{name=projects/*/locations/*/applications/*}:addStreamInput", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "AddApplicationStreamInputResponse", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "RemoveApplicationStreamInput": { + "requestType": "RemoveApplicationStreamInputRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1alpha1/{name=projects/*/locations/*/applications/*}:removeStreamInput", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "RemoveApplicationStreamInputResponse", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha1/{name=projects/*/locations/*/applications/*}:removeStreamInput", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "RemoveApplicationStreamInputResponse", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateApplicationStreamInput": { + "requestType": "UpdateApplicationStreamInputRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1alpha1/{name=projects/*/locations/*/applications/*}:updateStreamInput", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "UpdateApplicationStreamInputResponse", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha1/{name=projects/*/locations/*/applications/*}:updateStreamInput", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "UpdateApplicationStreamInputResponse", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListInstances": { + "requestType": "ListInstancesRequest", + "responseType": "ListInstancesResponse", + "options": { + "(google.api.http).get": "/v1alpha1/{parent=projects/*/locations/*/applications/*}/instances", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha1/{parent=projects/*/locations/*/applications/*}/instances" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetInstance": { + "requestType": "GetInstanceRequest", + "responseType": "Instance", + "options": { + "(google.api.http).get": "/v1alpha1/{name=projects/*/locations/*/applications/*/instances/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha1/{name=projects/*/locations/*/applications/*/instances/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateApplicationInstances": { + "requestType": "CreateApplicationInstancesRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1alpha1/{name=projects/*/locations/*/applications/*}:createApplicationInstances", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "CreateApplicationInstancesResponse", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha1/{name=projects/*/locations/*/applications/*}:createApplicationInstances", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "CreateApplicationInstancesResponse", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteApplicationInstances": { + "requestType": "DeleteApplicationInstancesRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1alpha1/{name=projects/*/locations/*/applications/*}:deleteApplicationInstances", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "Instance", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha1/{name=projects/*/locations/*/applications/*}:deleteApplicationInstances", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Instance", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateApplicationInstances": { + "requestType": "UpdateApplicationInstancesRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1alpha1/{name=projects/*/locations/*/applications/*}:updateApplicationInstances", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name, application_instances", + "(google.longrunning.operation_info).response_type": "UpdateApplicationInstancesResponse", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha1/{name=projects/*/locations/*/applications/*}:updateApplicationInstances", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name, application_instances" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "UpdateApplicationInstancesResponse", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListDrafts": { + "requestType": "ListDraftsRequest", + "responseType": "ListDraftsResponse", + "options": { + "(google.api.http).get": "/v1alpha1/{parent=projects/*/locations/*/applications/*}/drafts", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha1/{parent=projects/*/locations/*/applications/*}/drafts" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetDraft": { + "requestType": "GetDraftRequest", + "responseType": "Draft", + "options": { + "(google.api.http).get": "/v1alpha1/{name=projects/*/locations/*/applications/*/drafts/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha1/{name=projects/*/locations/*/applications/*/drafts/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateDraft": { + "requestType": "CreateDraftRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1alpha1/{parent=projects/*/locations/*/applications/*}/drafts", + "(google.api.http).body": "draft", + "(google.api.method_signature)": "parent,draft,draft_id", + "(google.longrunning.operation_info).response_type": "Draft", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha1/{parent=projects/*/locations/*/applications/*}/drafts", + "body": "draft" + } + }, + { + "(google.api.method_signature)": "parent,draft,draft_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Draft", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateDraft": { + "requestType": "UpdateDraftRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1alpha1/{draft.name=projects/*/locations/*/applications/*/drafts/*}", + "(google.api.http).body": "draft", + "(google.api.method_signature)": "draft,update_mask", + "(google.longrunning.operation_info).response_type": "Draft", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1alpha1/{draft.name=projects/*/locations/*/applications/*/drafts/*}", + "body": "draft" + } + }, + { + "(google.api.method_signature)": "draft,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Draft", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteDraft": { + "requestType": "DeleteDraftRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1alpha1/{name=projects/*/locations/*/applications/*/drafts/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1alpha1/{name=projects/*/locations/*/applications/*/drafts/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListProcessors": { + "requestType": "ListProcessorsRequest", + "responseType": "ListProcessorsResponse", + "options": { + "(google.api.http).get": "/v1alpha1/{parent=projects/*/locations/*}/processors", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha1/{parent=projects/*/locations/*}/processors" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListPrebuiltProcessors": { + "requestType": "ListPrebuiltProcessorsRequest", + "responseType": "ListPrebuiltProcessorsResponse", + "options": { + "(google.api.http).post": "/v1alpha1/{parent=projects/*/locations/*}/processors:prebuilt", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha1/{parent=projects/*/locations/*}/processors:prebuilt", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetProcessor": { + "requestType": "GetProcessorRequest", + "responseType": "Processor", + "options": { + "(google.api.http).get": "/v1alpha1/{name=projects/*/locations/*/processors/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha1/{name=projects/*/locations/*/processors/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateProcessor": { + "requestType": "CreateProcessorRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1alpha1/{parent=projects/*/locations/*}/processors", + "(google.api.http).body": "processor", + "(google.api.method_signature)": "parent,processor,processor_id", + "(google.longrunning.operation_info).response_type": "Processor", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha1/{parent=projects/*/locations/*}/processors", + "body": "processor" + } + }, + { + "(google.api.method_signature)": "parent,processor,processor_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Processor", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateProcessor": { + "requestType": "UpdateProcessorRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1alpha1/{processor.name=projects/*/locations/*/processors/*}", + "(google.api.http).body": "processor", + "(google.api.method_signature)": "processor,update_mask", + "(google.longrunning.operation_info).response_type": "Processor", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1alpha1/{processor.name=projects/*/locations/*/processors/*}", + "body": "processor" + } + }, + { + "(google.api.method_signature)": "processor,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Processor", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteProcessor": { + "requestType": "DeleteProcessorRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1alpha1/{name=projects/*/locations/*/processors/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1alpha1/{name=projects/*/locations/*/processors/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + } + } + }, + "ModelType": { + "values": { + "MODEL_TYPE_UNSPECIFIED": 0, + "IMAGE_CLASSIFICATION": 1, + "OBJECT_DETECTION": 2, + "VIDEO_CLASSIFICATION": 3, + "VIDEO_OBJECT_TRACKING": 4, + "VIDEO_ACTION_RECOGNITION": 5, + "OCCUPANCY_COUNTING": 6, + "PERSON_BLUR": 7, + "VERTEX_CUSTOM": 8 + } + }, + "AcceleratorType": { + "values": { + "ACCELERATOR_TYPE_UNSPECIFIED": 0, + "NVIDIA_TESLA_K80": 1, + "NVIDIA_TESLA_P100": 2, + "NVIDIA_TESLA_V100": 3, + "NVIDIA_TESLA_P4": 4, + "NVIDIA_TESLA_T4": 5, + "NVIDIA_TESLA_A100": 8, + "TPU_V2": 6, + "TPU_V3": 7 + } + }, + "DeleteApplicationInstancesResponse": { + "fields": {} + }, + "CreateApplicationInstancesResponse": { + "fields": {} + }, + "UpdateApplicationInstancesResponse": { + "fields": {} + }, + "CreateApplicationInstancesRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "visionai.googleapis.com/Application" + } + }, + "applicationInstances": { + "rule": "repeated", + "type": "ApplicationInstance", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteApplicationInstancesRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "visionai.googleapis.com/Application" + } + }, + "instanceIds": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "visionai.googleapis.com/Instance" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeployApplicationResponse": { + "fields": {} + }, + "UndeployApplicationResponse": { + "fields": {} + }, + "RemoveApplicationStreamInputResponse": { + "fields": {} + }, + "AddApplicationStreamInputResponse": { + "fields": {} + }, + "UpdateApplicationStreamInputResponse": { + "fields": {} + }, + "ListApplicationsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "visionai.googleapis.com/Application" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListApplicationsResponse": { + "fields": { + "applications": { + "rule": "repeated", + "type": "Application", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetApplicationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "visionai.googleapis.com/Application" + } + } + } + }, + "CreateApplicationRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "visionai.googleapis.com/Application" + } + }, + "applicationId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "application": { + "type": "Application", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateApplicationRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "application": { + "type": "Application", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteApplicationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "visionai.googleapis.com/Application" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "force": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeployApplicationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "visionai.googleapis.com/Application" + } + }, + "validateOnly": { + "type": "bool", + "id": 2 + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enableMonitoring": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UndeployApplicationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "visionai.googleapis.com/Application" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ApplicationStreamInput": { + "fields": { + "streamWithAnnotation": { + "type": "StreamWithAnnotation", + "id": 1 + } + } + }, + "AddApplicationStreamInputRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "visionai.googleapis.com/Application" + } + }, + "applicationStreamInputs": { + "rule": "repeated", + "type": "ApplicationStreamInput", + "id": 2 + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateApplicationStreamInputRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "visionai.googleapis.com/Application" + } + }, + "applicationStreamInputs": { + "rule": "repeated", + "type": "ApplicationStreamInput", + "id": 2 + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowMissing": { + "type": "bool", + "id": 4 + } + } + }, + "RemoveApplicationStreamInputRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "visionai.googleapis.com/Application" + } + }, + "targetStreamInputs": { + "rule": "repeated", + "type": "TargetStreamInput", + "id": 2 + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "TargetStreamInput": { + "fields": { + "stream": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "visionai.googleapis.com/Stream" + } + } + } + } + } + }, + "ListInstancesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "visionai.googleapis.com/Instance" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListInstancesResponse": { + "fields": { + "instances": { + "rule": "repeated", + "type": "Instance", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "visionai.googleapis.com/Instance" + } + } + } + }, + "ListDraftsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "visionai.googleapis.com/Draft" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListDraftsResponse": { + "fields": { + "drafts": { + "rule": "repeated", + "type": "Draft", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetDraftRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "visionai.googleapis.com/Draft" + } + } + } + }, + "CreateDraftRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "visionai.googleapis.com/Draft" + } + }, + "draftId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "draft": { + "type": "Draft", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateDraftRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "draft": { + "type": "Draft", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowMissing": { + "type": "bool", + "id": 4 + } + } + }, + "UpdateApplicationInstancesRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "visionai.googleapis.com/Application" + } + }, + "applicationInstances": { + "rule": "repeated", + "type": "UpdateApplicationInstance", + "id": 2 + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowMissing": { + "type": "bool", + "id": 4 + } + }, + "nested": { + "UpdateApplicationInstance": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "instance": { + "type": "Instance", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instanceId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "DeleteDraftRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "visionai.googleapis.com/Draft" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListProcessorsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "visionai.googleapis.com/Processor" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListProcessorsResponse": { + "fields": { + "processors": { + "rule": "repeated", + "type": "Processor", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "ListPrebuiltProcessorsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "visionai.googleapis.com/Processor" + } + } + } + }, + "ListPrebuiltProcessorsResponse": { + "fields": { + "processors": { + "rule": "repeated", + "type": "Processor", + "id": 1 + } + } + }, + "GetProcessorRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "visionai.googleapis.com/Processor" + } + } + } + }, + "CreateProcessorRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "visionai.googleapis.com/Processor" + } + }, + "processorId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "processor": { + "type": "Processor", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateProcessorRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "processor": { + "type": "Processor", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteProcessorRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "visionai.googleapis.com/Processor" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Application": { + "options": { + "(google.api.resource).type": "visionai.googleapis.com/Application", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/applications/{application}", + "(google.api.resource).style": "DECLARATIVE_FRIENDLY" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4 + }, + "displayName": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 6 + }, + "applicationConfigs": { + "type": "ApplicationConfigs", + "id": 7 + }, + "runtimeInfo": { + "type": "ApplicationRuntimeInfo", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "ApplicationRuntimeInfo": { + "fields": { + "deployTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "globalOutputResources": { + "rule": "repeated", + "type": "GlobalOutputResource", + "id": 3 + }, + "monitoringConfig": { + "type": "MonitoringConfig", + "id": 4 + } + }, + "nested": { + "GlobalOutputResource": { + "fields": { + "outputResource": { + "type": "string", + "id": 1 + }, + "producerNode": { + "type": "string", + "id": 2 + }, + "key": { + "type": "string", + "id": 3 + } + } + }, + "MonitoringConfig": { + "fields": { + "enabled": { + "type": "bool", + "id": 1 + } + } + } + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATED": 1, + "DEPLOYING": 2, + "DEPLOYED": 3, + "UNDEPLOYING": 4, + "DELETED": 5, + "ERROR": 6, + "CREATING": 7, + "UPDATING": 8, + "DELETING": 9, + "FIXING": 10 + } + } + } + }, + "ApplicationConfigs": { + "fields": { + "nodes": { + "rule": "repeated", + "type": "Node", + "id": 1 + }, + "eventDeliveryConfig": { + "type": "EventDeliveryConfig", + "id": 3 + } + }, + "nested": { + "EventDeliveryConfig": { + "fields": { + "channel": { + "type": "string", + "id": 1 + }, + "minimalDeliveryInterval": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + } + } + }, + "Node": { + "oneofs": { + "streamOutputConfig": { + "oneof": [ + "outputAllOutputChannelsToStream" + ] + } + }, + "fields": { + "outputAllOutputChannelsToStream": { + "type": "bool", + "id": 6 + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "displayName": { + "type": "string", + "id": 2 + }, + "nodeConfig": { + "type": "ProcessorConfig", + "id": 3 + }, + "processor": { + "type": "string", + "id": 4 + }, + "parents": { + "rule": "repeated", + "type": "InputEdge", + "id": 5 + } + }, + "nested": { + "InputEdge": { + "fields": { + "parentNode": { + "type": "string", + "id": 1 + }, + "parentOutputChannel": { + "type": "string", + "id": 2 + }, + "connectedInputChannel": { + "type": "string", + "id": 3 + } + } + } + } + }, + "Draft": { + "options": { + "(google.api.resource).type": "visionai.googleapis.com/Draft", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/applications/{application}/drafts/{draft}", + "(google.api.resource).style": "DECLARATIVE_FRIENDLY" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 3 + }, + "displayName": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 5 + }, + "draftApplicationConfigs": { + "type": "ApplicationConfigs", + "id": 6 + } + } + }, + "Instance": { + "options": { + "(google.api.resource).type": "visionai.googleapis.com/Instance", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/applications/{application}/instances/{instance}", + "(google.api.resource).style": "DECLARATIVE_FRIENDLY" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 3 + }, + "displayName": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 5 + }, + "inputResources": { + "rule": "repeated", + "type": "InputResource", + "id": 6 + }, + "outputResources": { + "rule": "repeated", + "type": "OutputResource", + "id": 7 + }, + "state": { + "type": "State", + "id": 9 + } + }, + "nested": { + "InputResource": { + "oneofs": { + "inputResourceInformation": { + "oneof": [ + "inputResource", + "annotatedStream" + ] + } + }, + "fields": { + "inputResource": { + "type": "string", + "id": 1 + }, + "annotatedStream": { + "type": "StreamWithAnnotation", + "id": 4, + "options": { + "deprecated": true + } + }, + "consumerNode": { + "type": "string", + "id": 2 + }, + "inputResourceBinding": { + "type": "string", + "id": 3 + }, + "annotations": { + "type": "ResourceAnnotations", + "id": 5 + } + } + }, + "OutputResource": { + "fields": { + "outputResource": { + "type": "string", + "id": 1 + }, + "producerNode": { + "type": "string", + "id": 2 + }, + "outputResourceBinding": { + "type": "string", + "id": 4 + }, + "isTemporary": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "autogen": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "CREATED": 2, + "DEPLOYING": 3, + "DEPLOYED": 4, + "UNDEPLOYING": 5, + "DELETED": 6, + "ERROR": 7, + "UPDATING": 8, + "DELETING": 9, + "FIXING": 10 + } + } + } + }, + "ApplicationInstance": { + "fields": { + "instanceId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instance": { + "type": "Instance", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "Processor": { + "options": { + "(google.api.resource).type": "visionai.googleapis.com/Processor", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/processors/{processor}", + "(google.api.resource).style": "DECLARATIVE_FRIENDLY" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4 + }, + "displayName": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 10 + }, + "processorType": { + "type": "ProcessorType", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "modelType": { + "type": "ModelType", + "id": 13 + }, + "customProcessorSourceInfo": { + "type": "CustomProcessorSourceInfo", + "id": 7 + }, + "state": { + "type": "ProcessorState", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "processorIoSpec": { + "type": "ProcessorIOSpec", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "configurationTypeurl": { + "type": "string", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "supportedAnnotationTypes": { + "rule": "repeated", + "type": "StreamAnnotationType", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "supportsPostProcessing": { + "type": "bool", + "id": 17 + } + }, + "nested": { + "ProcessorType": { + "values": { + "PROCESSOR_TYPE_UNSPECIFIED": 0, + "PRETRAINED": 1, + "CUSTOM": 2, + "CONNECTOR": 3 + } + }, + "ProcessorState": { + "values": { + "PROCESSOR_STATE_UNSPECIFIED": 0, + "CREATING": 1, + "ACTIVE": 2, + "DELETING": 3, + "FAILED": 4 + } + } + } + }, + "ProcessorIOSpec": { + "fields": { + "graphInputChannelSpecs": { + "rule": "repeated", + "type": "GraphInputChannelSpec", + "id": 3 + }, + "graphOutputChannelSpecs": { + "rule": "repeated", + "type": "GraphOutputChannelSpec", + "id": 4 + }, + "instanceResourceInputBindingSpecs": { + "rule": "repeated", + "type": "InstanceResourceInputBindingSpec", + "id": 5 + }, + "instanceResourceOutputBindingSpecs": { + "rule": "repeated", + "type": "InstanceResourceOutputBindingSpec", + "id": 6 + } + }, + "nested": { + "GraphInputChannelSpec": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "dataType": { + "type": "DataType", + "id": 2 + }, + "acceptedDataTypeUris": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "required": { + "type": "bool", + "id": 3 + }, + "maxConnectionAllowed": { + "type": "int64", + "id": 4 + } + } + }, + "GraphOutputChannelSpec": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "dataType": { + "type": "DataType", + "id": 2 + }, + "dataTypeUri": { + "type": "string", + "id": 3 + } + } + }, + "InstanceResourceInputBindingSpec": { + "oneofs": { + "resourceType": { + "oneof": [ + "configTypeUri", + "resourceTypeUri" + ] + } + }, + "fields": { + "configTypeUri": { + "type": "string", + "id": 2 + }, + "resourceTypeUri": { + "type": "string", + "id": 3 + }, + "name": { + "type": "string", + "id": 1 + } + } + }, + "InstanceResourceOutputBindingSpec": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "resourceTypeUri": { + "type": "string", + "id": 2 + }, + "explicit": { + "type": "bool", + "id": 3 + } + } + }, + "DataType": { + "values": { + "DATA_TYPE_UNSPECIFIED": 0, + "VIDEO": 1, + "PROTO": 2 + } + } + } + }, + "CustomProcessorSourceInfo": { + "oneofs": { + "artifactPath": { + "oneof": [ + "vertexModel" + ] + } + }, + "fields": { + "vertexModel": { + "type": "string", + "id": 2 + }, + "sourceType": { + "type": "SourceType", + "id": 1 + }, + "additionalInfo": { + "keyType": "string", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "modelSchema": { + "type": "ModelSchema", + "id": 5 + } + }, + "nested": { + "ModelSchema": { + "fields": { + "instancesSchema": { + "type": "GcsSource", + "id": 1 + }, + "parametersSchema": { + "type": "GcsSource", + "id": 2 + }, + "predictionsSchema": { + "type": "GcsSource", + "id": 3 + } + } + }, + "SourceType": { + "values": { + "SOURCE_TYPE_UNSPECIFIED": 0, + "VERTEX_AUTOML": 1, + "VERTEX_CUSTOM": 2 + } + } + } + }, + "ProcessorConfig": { + "oneofs": { + "processorConfig": { + "oneof": [ + "videoStreamInputConfig", + "aiEnabledDevicesInputConfig", + "mediaWarehouseConfig", + "personBlurConfig", + "occupancyCountConfig", + "personVehicleDetectionConfig", + "vertexAutomlVisionConfig", + "vertexAutomlVideoConfig", + "vertexCustomConfig", + "generalObjectDetectionConfig", + "bigQueryConfig", + "personalProtectiveEquipmentDetectionConfig" + ] + } + }, + "fields": { + "videoStreamInputConfig": { + "type": "VideoStreamInputConfig", + "id": 9 + }, + "aiEnabledDevicesInputConfig": { + "type": "AIEnabledDevicesInputConfig", + "id": 20 + }, + "mediaWarehouseConfig": { + "type": "MediaWarehouseConfig", + "id": 10 + }, + "personBlurConfig": { + "type": "PersonBlurConfig", + "id": 11 + }, + "occupancyCountConfig": { + "type": "OccupancyCountConfig", + "id": 12 + }, + "personVehicleDetectionConfig": { + "type": "PersonVehicleDetectionConfig", + "id": 15 + }, + "vertexAutomlVisionConfig": { + "type": "VertexAutoMLVisionConfig", + "id": 13 + }, + "vertexAutomlVideoConfig": { + "type": "VertexAutoMLVideoConfig", + "id": 14 + }, + "vertexCustomConfig": { + "type": "VertexCustomConfig", + "id": 17 + }, + "generalObjectDetectionConfig": { + "type": "GeneralObjectDetectionConfig", + "id": 18 + }, + "bigQueryConfig": { + "type": "BigQueryConfig", + "id": 19 + }, + "personalProtectiveEquipmentDetectionConfig": { + "type": "PersonalProtectiveEquipmentDetectionConfig", + "id": 22 + } + } + }, + "StreamWithAnnotation": { + "fields": { + "stream": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "visionai.googleapis.com/Stream" + } + }, + "applicationAnnotations": { + "rule": "repeated", + "type": "StreamAnnotation", + "id": 2 + }, + "nodeAnnotations": { + "rule": "repeated", + "type": "NodeAnnotation", + "id": 3 + } + }, + "nested": { + "NodeAnnotation": { + "fields": { + "node": { + "type": "string", + "id": 1 + }, + "annotations": { + "rule": "repeated", + "type": "StreamAnnotation", + "id": 2 + } + } + } + } + }, + "ApplicationNodeAnnotation": { + "fields": { + "node": { + "type": "string", + "id": 1 + }, + "annotations": { + "rule": "repeated", + "type": "StreamAnnotation", + "id": 2 + } + } + }, + "ResourceAnnotations": { + "fields": { + "applicationAnnotations": { + "rule": "repeated", + "type": "StreamAnnotation", + "id": 1 + }, + "nodeAnnotations": { + "rule": "repeated", + "type": "ApplicationNodeAnnotation", + "id": 2 + } + } + }, + "VideoStreamInputConfig": { + "fields": { + "streams": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "deprecated": true + } + }, + "streamsWithAnnotation": { + "rule": "repeated", + "type": "StreamWithAnnotation", + "id": 2, + "options": { + "deprecated": true + } + } + } + }, + "AIEnabledDevicesInputConfig": { + "fields": {} + }, + "MediaWarehouseConfig": { + "fields": { + "corpus": { + "type": "string", + "id": 1 + }, + "region": { + "type": "string", + "id": 2, + "options": { + "deprecated": true + } + }, + "ttl": { + "type": "google.protobuf.Duration", + "id": 3 + } + } + }, + "PersonBlurConfig": { + "fields": { + "personBlurType": { + "type": "PersonBlurType", + "id": 1 + }, + "facesOnly": { + "type": "bool", + "id": 2 + } + }, + "nested": { + "PersonBlurType": { + "values": { + "PERSON_BLUR_TYPE_UNSPECIFIED": 0, + "FULL_OCCULUSION": 1, + "BLUR_FILTER": 2 + } + } + } + }, + "OccupancyCountConfig": { + "fields": { + "enablePeopleCounting": { + "type": "bool", + "id": 1 + }, + "enableVehicleCounting": { + "type": "bool", + "id": 2 + }, + "enableDwellingTimeTracking": { + "type": "bool", + "id": 3 + } + } + }, + "PersonVehicleDetectionConfig": { + "fields": { + "enablePeopleCounting": { + "type": "bool", + "id": 1 + }, + "enableVehicleCounting": { + "type": "bool", + "id": 2 + } + } + }, + "PersonalProtectiveEquipmentDetectionConfig": { + "fields": { + "enableFaceCoverageDetection": { + "type": "bool", + "id": 1 + }, + "enableHeadCoverageDetection": { + "type": "bool", + "id": 2 + }, + "enableHandsCoverageDetection": { + "type": "bool", + "id": 3 + } + } + }, + "GeneralObjectDetectionConfig": { + "fields": {} + }, + "BigQueryConfig": { + "fields": { + "table": { + "type": "string", + "id": 1 + }, + "cloudFunctionMapping": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "createDefaultTableIfNotExists": { + "type": "bool", + "id": 3 + } + } + }, + "VertexAutoMLVisionConfig": { + "fields": { + "confidenceThreshold": { + "type": "float", + "id": 1 + }, + "maxPredictions": { + "type": "int32", + "id": 2 + } + } + }, + "VertexAutoMLVideoConfig": { + "fields": { + "confidenceThreshold": { + "type": "float", + "id": 1 + }, + "blockedLabels": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "maxPredictions": { + "type": "int32", + "id": 3 + }, + "boundingBoxSizeLimit": { + "type": "float", + "id": 4 + } + } + }, + "VertexCustomConfig": { + "fields": { + "maxPredictionFps": { + "type": "int32", + "id": 1 + }, + "dedicatedResources": { + "type": "DedicatedResources", + "id": 2 + }, + "postProcessingCloudFunction": { + "type": "string", + "id": 3 + }, + "attachApplicationMetadata": { + "type": "bool", + "id": 4 + } + } + }, + "MachineSpec": { + "fields": { + "machineType": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "acceleratorType": { + "type": "AcceleratorType", + "id": 2, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "acceleratorCount": { + "type": "int32", + "id": 3 + } + } + }, + "AutoscalingMetricSpec": { + "fields": { + "metricName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "target": { + "type": "int32", + "id": 2 + } + } + }, + "DedicatedResources": { + "fields": { + "machineSpec": { + "type": "MachineSpec", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "minReplicaCount": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "maxReplicaCount": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "autoscalingMetricSpecs": { + "rule": "repeated", + "type": "AutoscalingMetricSpec", + "id": 4, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + } + } + }, + "GstreamerBufferDescriptor": { + "fields": { + "capsString": { + "type": "string", + "id": 1 + }, + "isKeyFrame": { + "type": "bool", + "id": 2 + }, + "ptsTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "dtsTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "duration": { + "type": "google.protobuf.Duration", + "id": 5 + } + } + }, + "RawImageDescriptor": { + "fields": { + "format": { + "type": "string", + "id": 1 + }, + "height": { + "type": "int32", + "id": 2 + }, + "width": { + "type": "int32", + "id": 3 + } + } + }, + "PacketType": { + "fields": { + "typeClass": { + "type": "string", + "id": 1 + }, + "typeDescriptor": { + "type": "TypeDescriptor", + "id": 2 + } + }, + "nested": { + "TypeDescriptor": { + "oneofs": { + "typeDetails": { + "oneof": [ + "gstreamerBufferDescriptor", + "rawImageDescriptor" + ] + } + }, + "fields": { + "gstreamerBufferDescriptor": { + "type": "GstreamerBufferDescriptor", + "id": 2 + }, + "rawImageDescriptor": { + "type": "RawImageDescriptor", + "id": 3 + }, + "type": { + "type": "string", + "id": 1 + } + } + } + } + }, + "ServerMetadata": { + "fields": { + "offset": { + "type": "int64", + "id": 1 + }, + "ingestTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + }, + "SeriesMetadata": { + "fields": { + "series": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "visionai.googleapis.com/Series" + } + } + } + }, + "PacketHeader": { + "fields": { + "captureTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + }, + "type": { + "type": "PacketType", + "id": 2, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "metadata": { + "type": "google.protobuf.Struct", + "id": 3, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + }, + "serverMetadata": { + "type": "ServerMetadata", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "seriesMetadata": { + "type": "SeriesMetadata", + "id": 5, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "flags": { + "type": "int32", + "id": 6, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "traceContext": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + } + } + }, + "Packet": { + "fields": { + "header": { + "type": "PacketHeader", + "id": 1 + }, + "payload": { + "type": "bytes", + "id": 2 + } + } + }, + "StreamingService": { + "options": { + "(google.api.default_host)": "visionai.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "SendPackets": { + "requestType": "SendPacketsRequest", + "requestStream": true, + "responseType": "SendPacketsResponse", + "responseStream": true + }, + "ReceivePackets": { + "requestType": "ReceivePacketsRequest", + "requestStream": true, + "responseType": "ReceivePacketsResponse", + "responseStream": true + }, + "ReceiveEvents": { + "requestType": "ReceiveEventsRequest", + "requestStream": true, + "responseType": "ReceiveEventsResponse", + "responseStream": true + }, + "AcquireLease": { + "requestType": "AcquireLeaseRequest", + "responseType": "Lease", + "options": { + "(google.api.http).post": "/v1alpha1/{series=projects/*/locations/*/clusters/*/series/*}:acquireLease", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha1/{series=projects/*/locations/*/clusters/*/series/*}:acquireLease", + "body": "*" + } + } + ] + }, + "RenewLease": { + "requestType": "RenewLeaseRequest", + "responseType": "Lease", + "options": { + "(google.api.http).post": "/v1alpha1/{series=projects/*/locations/*/clusters/*/series/*}:renewLease", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha1/{series=projects/*/locations/*/clusters/*/series/*}:renewLease", + "body": "*" + } + } + ] + }, + "ReleaseLease": { + "requestType": "ReleaseLeaseRequest", + "responseType": "ReleaseLeaseResponse", + "options": { + "(google.api.http).post": "/v1alpha1/{series=projects/*/locations/*/clusters/*/series/*}:releaseLease", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha1/{series=projects/*/locations/*/clusters/*/series/*}:releaseLease", + "body": "*" + } + } + ] + } + } + }, + "LeaseType": { + "values": { + "LEASE_TYPE_UNSPECIFIED": 0, + "LEASE_TYPE_READER": 1, + "LEASE_TYPE_WRITER": 2 + } + }, + "ReceiveEventsRequest": { + "oneofs": { + "request": { + "oneof": [ + "setupRequest", + "commitRequest" + ] + } + }, + "fields": { + "setupRequest": { + "type": "SetupRequest", + "id": 1 + }, + "commitRequest": { + "type": "CommitRequest", + "id": 2 + } + }, + "nested": { + "SetupRequest": { + "fields": { + "cluster": { + "type": "string", + "id": 1 + }, + "stream": { + "type": "string", + "id": 2 + }, + "receiver": { + "type": "string", + "id": 3 + }, + "controlledMode": { + "type": "ControlledMode", + "id": 4 + }, + "heartbeatInterval": { + "type": "google.protobuf.Duration", + "id": 5 + }, + "writesDoneGracePeriod": { + "type": "google.protobuf.Duration", + "id": 6 + } + } + } + } + }, + "EventUpdate": { + "fields": { + "stream": { + "type": "string", + "id": 1 + }, + "event": { + "type": "string", + "id": 2 + }, + "series": { + "type": "string", + "id": 3 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "offset": { + "type": "int64", + "id": 5 + } + } + }, + "ReceiveEventsControlResponse": { + "oneofs": { + "control": { + "oneof": [ + "heartbeat", + "writesDoneRequest" + ] + } + }, + "fields": { + "heartbeat": { + "type": "bool", + "id": 1 + }, + "writesDoneRequest": { + "type": "bool", + "id": 2 + } + } + }, + "ReceiveEventsResponse": { + "oneofs": { + "response": { + "oneof": [ + "eventUpdate", + "control" + ] + } + }, + "fields": { + "eventUpdate": { + "type": "EventUpdate", + "id": 1 + }, + "control": { + "type": "ReceiveEventsControlResponse", + "id": 2 + } + } + }, + "Lease": { + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "series": { + "type": "string", + "id": 2 + }, + "owner": { + "type": "string", + "id": 3 + }, + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "leaseType": { + "type": "LeaseType", + "id": 5 + } + } + }, + "AcquireLeaseRequest": { + "fields": { + "series": { + "type": "string", + "id": 1 + }, + "owner": { + "type": "string", + "id": 2 + }, + "term": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "leaseType": { + "type": "LeaseType", + "id": 4 + } + } + }, + "RenewLeaseRequest": { + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "series": { + "type": "string", + "id": 2 + }, + "owner": { + "type": "string", + "id": 3 + }, + "term": { + "type": "google.protobuf.Duration", + "id": 4 + } + } + }, + "ReleaseLeaseRequest": { + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "series": { + "type": "string", + "id": 2 + }, + "owner": { + "type": "string", + "id": 3 + } + } + }, + "ReleaseLeaseResponse": { + "fields": {} + }, + "RequestMetadata": { + "fields": { + "stream": { + "type": "string", + "id": 1 + }, + "event": { + "type": "string", + "id": 2 + }, + "series": { + "type": "string", + "id": 3 + }, + "leaseId": { + "type": "string", + "id": 4 + }, + "owner": { + "type": "string", + "id": 5 + }, + "leaseTerm": { + "type": "google.protobuf.Duration", + "id": 6 + } + } + }, + "SendPacketsRequest": { + "oneofs": { + "request": { + "oneof": [ + "packet", + "metadata" + ] + } + }, + "fields": { + "packet": { + "type": "Packet", + "id": 1 + }, + "metadata": { + "type": "RequestMetadata", + "id": 2 + } + } + }, + "SendPacketsResponse": { + "fields": {} + }, + "ReceivePacketsRequest": { + "oneofs": { + "request": { + "oneof": [ + "setupRequest", + "commitRequest" + ] + } + }, + "fields": { + "setupRequest": { + "type": "SetupRequest", + "id": 6 + }, + "commitRequest": { + "type": "CommitRequest", + "id": 7 + } + }, + "nested": { + "SetupRequest": { + "oneofs": { + "consumerMode": { + "oneof": [ + "eagerReceiveMode", + "controlledReceiveMode" + ] + } + }, + "fields": { + "eagerReceiveMode": { + "type": "EagerMode", + "id": 3 + }, + "controlledReceiveMode": { + "type": "ControlledMode", + "id": 4 + }, + "metadata": { + "type": "RequestMetadata", + "id": 1 + }, + "receiver": { + "type": "string", + "id": 2 + }, + "heartbeatInterval": { + "type": "google.protobuf.Duration", + "id": 5 + }, + "writesDoneGracePeriod": { + "type": "google.protobuf.Duration", + "id": 6 + } + } + } + } + }, + "ReceivePacketsControlResponse": { + "oneofs": { + "control": { + "oneof": [ + "heartbeat", + "writesDoneRequest" + ] + } + }, + "fields": { + "heartbeat": { + "type": "bool", + "id": 1 + }, + "writesDoneRequest": { + "type": "bool", + "id": 2 + } + } + }, + "ReceivePacketsResponse": { + "oneofs": { + "response": { + "oneof": [ + "packet", + "control" + ] + } + }, + "fields": { + "packet": { + "type": "Packet", + "id": 1 + }, + "control": { + "type": "ReceivePacketsControlResponse", + "id": 3 + } + } + }, + "EagerMode": { + "fields": {} + }, + "ControlledMode": { + "oneofs": { + "startingOffset": { + "oneof": [ + "startingLogicalOffset" + ] + } + }, + "fields": { + "startingLogicalOffset": { + "type": "string", + "id": 1 + }, + "fallbackStartingOffset": { + "type": "string", + "id": 2 + } + } + }, + "CommitRequest": { + "fields": { + "offset": { + "type": "int64", + "id": 1 + } + } + }, + "Stream": { + "options": { + "(google.api.resource).type": "visionai.googleapis.com/Stream", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/clusters/{cluster}/streams/{stream}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4 + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 5 + }, + "displayName": { + "type": "string", + "id": 6 + }, + "enableHlsPlayback": { + "type": "bool", + "id": 7 + }, + "mediaWarehouseAsset": { + "type": "string", + "id": 8 + } + } + }, + "Event": { + "options": { + "(google.api.resource).type": "visionai.googleapis.com/Event", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/clusters/{cluster}/events/{event}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4 + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 5 + }, + "alignmentClock": { + "type": "Clock", + "id": 6 + }, + "gracePeriod": { + "type": "google.protobuf.Duration", + "id": 7 + } + }, + "nested": { + "Clock": { + "values": { + "CLOCK_UNSPECIFIED": 0, + "CAPTURE": 1, + "INGEST": 2 + } + } + } + }, + "Series": { + "options": { + "(google.api.resource).type": "visionai.googleapis.com/Series", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/clusters/{cluster}/series/{series}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4 + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 5 + }, + "stream": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "visionai.googleapis.com/Stream" + } + }, + "event": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "visionai.googleapis.com/Event" + } + } + } + }, + "Channel": { + "options": { + "(google.api.resource).type": "visionai.googleapis.com/Channel", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/clusters/{cluster}/channels/{channel}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4 + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 5 + }, + "stream": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "visionai.googleapis.com/Stream" + } + }, + "event": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "visionai.googleapis.com/Event" + } + } + } + }, + "StreamsService": { + "options": { + "(google.api.default_host)": "visionai.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListClusters": { + "requestType": "ListClustersRequest", + "responseType": "ListClustersResponse", + "options": { + "(google.api.http).get": "/v1alpha1/{parent=projects/*/locations/*}/clusters", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha1/{parent=projects/*/locations/*}/clusters" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetCluster": { + "requestType": "GetClusterRequest", + "responseType": "Cluster", + "options": { + "(google.api.http).get": "/v1alpha1/{name=projects/*/locations/*/clusters/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha1/{name=projects/*/locations/*/clusters/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateCluster": { + "requestType": "CreateClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1alpha1/{parent=projects/*/locations/*}/clusters", + "(google.api.http).body": "cluster", + "(google.api.method_signature)": "parent,cluster,cluster_id", + "(google.longrunning.operation_info).response_type": "Cluster", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha1/{parent=projects/*/locations/*}/clusters", + "body": "cluster" + } + }, + { + "(google.api.method_signature)": "parent,cluster,cluster_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Cluster", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateCluster": { + "requestType": "UpdateClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1alpha1/{cluster.name=projects/*/locations/*/clusters/*}", + "(google.api.http).body": "cluster", + "(google.api.method_signature)": "cluster,update_mask", + "(google.longrunning.operation_info).response_type": "Cluster", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1alpha1/{cluster.name=projects/*/locations/*/clusters/*}", + "body": "cluster" + } + }, + { + "(google.api.method_signature)": "cluster,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Cluster", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteCluster": { + "requestType": "DeleteClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1alpha1/{name=projects/*/locations/*/clusters/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1alpha1/{name=projects/*/locations/*/clusters/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListStreams": { + "requestType": "ListStreamsRequest", + "responseType": "ListStreamsResponse", + "options": { + "(google.api.http).get": "/v1alpha1/{parent=projects/*/locations/*/clusters/*}/streams", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha1/{parent=projects/*/locations/*/clusters/*}/streams" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetStream": { + "requestType": "GetStreamRequest", + "responseType": "Stream", + "options": { + "(google.api.http).get": "/v1alpha1/{name=projects/*/locations/*/clusters/*/streams/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha1/{name=projects/*/locations/*/clusters/*/streams/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateStream": { + "requestType": "CreateStreamRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1alpha1/{parent=projects/*/locations/*/clusters/*}/streams", + "(google.api.http).body": "stream", + "(google.api.method_signature)": "parent,stream,stream_id", + "(google.longrunning.operation_info).response_type": "Stream", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha1/{parent=projects/*/locations/*/clusters/*}/streams", + "body": "stream" + } + }, + { + "(google.api.method_signature)": "parent,stream,stream_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Stream", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateStream": { + "requestType": "UpdateStreamRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1alpha1/{stream.name=projects/*/locations/*/clusters/*/streams/*}", + "(google.api.http).body": "stream", + "(google.api.method_signature)": "stream,update_mask", + "(google.longrunning.operation_info).response_type": "Stream", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1alpha1/{stream.name=projects/*/locations/*/clusters/*/streams/*}", + "body": "stream" + } + }, + { + "(google.api.method_signature)": "stream,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Stream", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteStream": { + "requestType": "DeleteStreamRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1alpha1/{name=projects/*/locations/*/clusters/*/streams/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1alpha1/{name=projects/*/locations/*/clusters/*/streams/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "GenerateStreamHlsToken": { + "requestType": "GenerateStreamHlsTokenRequest", + "responseType": "GenerateStreamHlsTokenResponse", + "options": { + "(google.api.http).post": "/v1alpha1/{stream=projects/*/locations/*/clusters/*/streams/*}:generateStreamHlsToken", + "(google.api.http).body": "*", + "(google.api.method_signature)": "stream" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha1/{stream=projects/*/locations/*/clusters/*/streams/*}:generateStreamHlsToken", + "body": "*" + } + }, + { + "(google.api.method_signature)": "stream" + } + ] + }, + "ListEvents": { + "requestType": "ListEventsRequest", + "responseType": "ListEventsResponse", + "options": { + "(google.api.http).get": "/v1alpha1/{parent=projects/*/locations/*/clusters/*}/events", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha1/{parent=projects/*/locations/*/clusters/*}/events" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetEvent": { + "requestType": "GetEventRequest", + "responseType": "Event", + "options": { + "(google.api.http).get": "/v1alpha1/{name=projects/*/locations/*/clusters/*/events/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha1/{name=projects/*/locations/*/clusters/*/events/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateEvent": { + "requestType": "CreateEventRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1alpha1/{parent=projects/*/locations/*/clusters/*}/events", + "(google.api.http).body": "event", + "(google.api.method_signature)": "parent,event,event_id", + "(google.longrunning.operation_info).response_type": "Event", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha1/{parent=projects/*/locations/*/clusters/*}/events", + "body": "event" + } + }, + { + "(google.api.method_signature)": "parent,event,event_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Event", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateEvent": { + "requestType": "UpdateEventRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1alpha1/{event.name=projects/*/locations/*/clusters/*/events/*}", + "(google.api.http).body": "event", + "(google.api.method_signature)": "event,update_mask", + "(google.longrunning.operation_info).response_type": "Event", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1alpha1/{event.name=projects/*/locations/*/clusters/*/events/*}", + "body": "event" + } + }, + { + "(google.api.method_signature)": "event,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Event", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteEvent": { + "requestType": "DeleteEventRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1alpha1/{name=projects/*/locations/*/clusters/*/events/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1alpha1/{name=projects/*/locations/*/clusters/*/events/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListSeries": { + "requestType": "ListSeriesRequest", + "responseType": "ListSeriesResponse", + "options": { + "(google.api.http).get": "/v1alpha1/{parent=projects/*/locations/*/clusters/*}/series", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha1/{parent=projects/*/locations/*/clusters/*}/series" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetSeries": { + "requestType": "GetSeriesRequest", + "responseType": "Series", + "options": { + "(google.api.http).get": "/v1alpha1/{name=projects/*/locations/*/clusters/*/series/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha1/{name=projects/*/locations/*/clusters/*/series/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateSeries": { + "requestType": "CreateSeriesRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1alpha1/{parent=projects/*/locations/*/clusters/*}/series", + "(google.api.http).body": "series", + "(google.api.method_signature)": "parent,series,series_id", + "(google.longrunning.operation_info).response_type": "Series", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha1/{parent=projects/*/locations/*/clusters/*}/series", + "body": "series" + } + }, + { + "(google.api.method_signature)": "parent,series,series_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Series", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateSeries": { + "requestType": "UpdateSeriesRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1alpha1/{series.name=projects/*/locations/*/clusters/*/series/*}", + "(google.api.http).body": "series", + "(google.api.method_signature)": "series,update_mask", + "(google.longrunning.operation_info).response_type": "Series", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1alpha1/{series.name=projects/*/locations/*/clusters/*/series/*}", + "body": "series" + } + }, + { + "(google.api.method_signature)": "series,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Series", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteSeries": { + "requestType": "DeleteSeriesRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1alpha1/{name=projects/*/locations/*/clusters/*/series/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1alpha1/{name=projects/*/locations/*/clusters/*/series/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "MaterializeChannel": { + "requestType": "MaterializeChannelRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1alpha1/{parent=projects/*/locations/*/clusters/*}/channels", + "(google.api.http).body": "channel", + "(google.api.method_signature)": "parent,channel,channel_id", + "(google.longrunning.operation_info).response_type": "Channel", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha1/{parent=projects/*/locations/*/clusters/*}/channels", + "body": "channel" + } + }, + { + "(google.api.method_signature)": "parent,channel,channel_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Channel", + "metadata_type": "OperationMetadata" + } + } + ] + } + } + }, + "ListClustersRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListClustersResponse": { + "fields": { + "clusters": { + "rule": "repeated", + "type": "Cluster", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetClusterRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "visionai.googleapis.com/Cluster" + } + } + } + }, + "CreateClusterRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "visionai.googleapis.com/Cluster" + } + }, + "clusterId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "cluster": { + "type": "Cluster", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateClusterRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "cluster": { + "type": "Cluster", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteClusterRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "visionai.googleapis.com/Cluster" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListStreamsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "visionai.googleapis.com/Cluster" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListStreamsResponse": { + "fields": { + "streams": { + "rule": "repeated", + "type": "Stream", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetStreamRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "visionai.googleapis.com/Stream" + } + } + } + }, + "CreateStreamRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "visionai.googleapis.com/Cluster" + } + }, + "streamId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "stream": { + "type": "Stream", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateStreamRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "stream": { + "type": "Stream", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteStreamRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "visionai.googleapis.com/Stream" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GetStreamThumbnailResponse": { + "fields": {} + }, + "GenerateStreamHlsTokenRequest": { + "fields": { + "stream": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GenerateStreamHlsTokenResponse": { + "fields": { + "token": { + "type": "string", + "id": 1 + }, + "expirationTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + }, + "ListEventsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "visionai.googleapis.com/Cluster" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListEventsResponse": { + "fields": { + "events": { + "rule": "repeated", + "type": "Event", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetEventRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "visionai.googleapis.com/Event" + } + } + } + }, + "CreateEventRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "visionai.googleapis.com/Cluster" + } + }, + "eventId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "event": { + "type": "Event", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateEventRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "event": { + "type": "Event", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteEventRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "visionai.googleapis.com/Event" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListSeriesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "visionai.googleapis.com/Cluster" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListSeriesResponse": { + "fields": { + "series": { + "rule": "repeated", + "type": "Series", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetSeriesRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "visionai.googleapis.com/Series" + } + } + } + }, + "CreateSeriesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "visionai.googleapis.com/Cluster" + } + }, + "seriesId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "series": { + "type": "Series", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateSeriesRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "series": { + "type": "Series", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteSeriesRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "visionai.googleapis.com/Series" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "MaterializeChannelRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "visionai.googleapis.com/Cluster" + } + }, + "channelId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "channel": { + "type": "Channel", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Warehouse": { + "options": { + "(google.api.default_host)": "visionai.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateAsset": { + "requestType": "CreateAssetRequest", + "responseType": "Asset", + "options": { + "(google.api.http).post": "/v1alpha1/{parent=projects/*/locations/*/corpora/*}/assets", + "(google.api.http).body": "asset", + "(google.api.method_signature)": "parent,asset,asset_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha1/{parent=projects/*/locations/*/corpora/*}/assets", + "body": "asset" + } + }, + { + "(google.api.method_signature)": "parent,asset,asset_id" + } + ] + }, + "UpdateAsset": { + "requestType": "UpdateAssetRequest", + "responseType": "Asset", + "options": { + "(google.api.http).patch": "/v1alpha1/{asset.name=projects/*/locations/*/corpora/*/assets/*}", + "(google.api.http).body": "asset", + "(google.api.method_signature)": "asset,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1alpha1/{asset.name=projects/*/locations/*/corpora/*/assets/*}", + "body": "asset" + } + }, + { + "(google.api.method_signature)": "asset,update_mask" + } + ] + }, + "GetAsset": { + "requestType": "GetAssetRequest", + "responseType": "Asset", + "options": { + "(google.api.http).get": "/v1alpha1/{name=projects/*/locations/*/corpora/*/assets/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha1/{name=projects/*/locations/*/corpora/*/assets/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListAssets": { + "requestType": "ListAssetsRequest", + "responseType": "ListAssetsResponse", + "options": { + "(google.api.http).get": "/v1alpha1/{parent=projects/*/locations/*/corpora/*}/assets", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha1/{parent=projects/*/locations/*/corpora/*}/assets" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "DeleteAsset": { + "requestType": "DeleteAssetRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1alpha1/{name=projects/*/locations/*/corpora/*/assets/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "DeleteAssetMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1alpha1/{name=projects/*/locations/*/corpora/*/assets/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "DeleteAssetMetadata" + } + } + ] + }, + "CreateCorpus": { + "requestType": "CreateCorpusRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1alpha1/{parent=projects/*/locations/*}/corpora", + "(google.api.http).body": "corpus", + "(google.api.method_signature)": "parent,corpus", + "(google.longrunning.operation_info).response_type": "Corpus", + "(google.longrunning.operation_info).metadata_type": "CreateCorpusMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha1/{parent=projects/*/locations/*}/corpora", + "body": "corpus" + } + }, + { + "(google.api.method_signature)": "parent,corpus" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Corpus", + "metadata_type": "CreateCorpusMetadata" + } + } + ] + }, + "GetCorpus": { + "requestType": "GetCorpusRequest", + "responseType": "Corpus", + "options": { + "(google.api.http).get": "/v1alpha1/{name=projects/*/locations/*/corpora/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha1/{name=projects/*/locations/*/corpora/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateCorpus": { + "requestType": "UpdateCorpusRequest", + "responseType": "Corpus", + "options": { + "(google.api.http).patch": "/v1alpha1/{corpus.name=projects/*/locations/*/corpora/*}", + "(google.api.http).body": "corpus", + "(google.api.method_signature)": "corpus,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1alpha1/{corpus.name=projects/*/locations/*/corpora/*}", + "body": "corpus" + } + }, + { + "(google.api.method_signature)": "corpus,update_mask" + } + ] + }, + "ListCorpora": { + "requestType": "ListCorporaRequest", + "responseType": "ListCorporaResponse", + "options": { + "(google.api.http).get": "/v1alpha1/{parent=projects/*/locations/*}/corpora", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha1/{parent=projects/*/locations/*}/corpora" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "DeleteCorpus": { + "requestType": "DeleteCorpusRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1alpha1/{name=projects/*/locations/*/corpora/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1alpha1/{name=projects/*/locations/*/corpora/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateDataSchema": { + "requestType": "CreateDataSchemaRequest", + "responseType": "DataSchema", + "options": { + "(google.api.http).post": "/v1alpha1/{parent=projects/*/locations/*/corpora/*}/dataSchemas", + "(google.api.http).body": "data_schema", + "(google.api.method_signature)": "parent,data_schema" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha1/{parent=projects/*/locations/*/corpora/*}/dataSchemas", + "body": "data_schema" + } + }, + { + "(google.api.method_signature)": "parent,data_schema" + } + ] + }, + "UpdateDataSchema": { + "requestType": "UpdateDataSchemaRequest", + "responseType": "DataSchema", + "options": { + "(google.api.http).patch": "/v1alpha1/{data_schema.name=projects/*/locations/*/corpora/*/dataSchemas/*}", + "(google.api.http).body": "data_schema", + "(google.api.method_signature)": "data_schema,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1alpha1/{data_schema.name=projects/*/locations/*/corpora/*/dataSchemas/*}", + "body": "data_schema" + } + }, + { + "(google.api.method_signature)": "data_schema,update_mask" + } + ] + }, + "GetDataSchema": { + "requestType": "GetDataSchemaRequest", + "responseType": "DataSchema", + "options": { + "(google.api.http).get": "/v1alpha1/{name=projects/*/locations/*/corpora/*/dataSchemas/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha1/{name=projects/*/locations/*/corpora/*/dataSchemas/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteDataSchema": { + "requestType": "DeleteDataSchemaRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1alpha1/{name=projects/*/locations/*/corpora/*/dataSchemas/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1alpha1/{name=projects/*/locations/*/corpora/*/dataSchemas/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListDataSchemas": { + "requestType": "ListDataSchemasRequest", + "responseType": "ListDataSchemasResponse", + "options": { + "(google.api.http).get": "/v1alpha1/{parent=projects/*/locations/*/corpora/*}/dataSchemas", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha1/{parent=projects/*/locations/*/corpora/*}/dataSchemas" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "CreateAnnotation": { + "requestType": "CreateAnnotationRequest", + "responseType": "Annotation", + "options": { + "(google.api.http).post": "/v1alpha1/{parent=projects/*/locations/*/corpora/*/assets/*}/annotations", + "(google.api.http).body": "annotation", + "(google.api.method_signature)": "parent,annotation,annotation_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha1/{parent=projects/*/locations/*/corpora/*/assets/*}/annotations", + "body": "annotation" + } + }, + { + "(google.api.method_signature)": "parent,annotation,annotation_id" + } + ] + }, + "GetAnnotation": { + "requestType": "GetAnnotationRequest", + "responseType": "Annotation", + "options": { + "(google.api.http).get": "/v1alpha1/{name=projects/*/locations/*/corpora/*/assets/*/annotations/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha1/{name=projects/*/locations/*/corpora/*/assets/*/annotations/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListAnnotations": { + "requestType": "ListAnnotationsRequest", + "responseType": "ListAnnotationsResponse", + "options": { + "(google.api.http).get": "/v1alpha1/{parent=projects/*/locations/*/corpora/*/assets/*}/annotations", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha1/{parent=projects/*/locations/*/corpora/*/assets/*}/annotations" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdateAnnotation": { + "requestType": "UpdateAnnotationRequest", + "responseType": "Annotation", + "options": { + "(google.api.http).patch": "/v1alpha1/{annotation.name=projects/*/locations/*/corpora/*/assets/*/annotations/*}", + "(google.api.http).body": "annotation", + "(google.api.method_signature)": "annotation,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1alpha1/{annotation.name=projects/*/locations/*/corpora/*/assets/*/annotations/*}", + "body": "annotation" + } + }, + { + "(google.api.method_signature)": "annotation,update_mask" + } + ] + }, + "DeleteAnnotation": { + "requestType": "DeleteAnnotationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1alpha1/{name=projects/*/locations/*/corpora/*/assets/*/annotations/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1alpha1/{name=projects/*/locations/*/corpora/*/assets/*/annotations/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "IngestAsset": { + "requestType": "IngestAssetRequest", + "requestStream": true, + "responseType": "IngestAssetResponse", + "responseStream": true + }, + "ClipAsset": { + "requestType": "ClipAssetRequest", + "responseType": "ClipAssetResponse", + "options": { + "(google.api.http).post": "/v1alpha1/{name=projects/*/locations/*/corpora/*/assets/*}:clip", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha1/{name=projects/*/locations/*/corpora/*/assets/*}:clip", + "body": "*" + } + } + ] + }, + "GenerateHlsUri": { + "requestType": "GenerateHlsUriRequest", + "responseType": "GenerateHlsUriResponse", + "options": { + "(google.api.http).post": "/v1alpha1/{name=projects/*/locations/*/corpora/*/assets/*}:generateHlsUri", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha1/{name=projects/*/locations/*/corpora/*/assets/*}:generateHlsUri", + "body": "*" + } + } + ] + }, + "CreateSearchConfig": { + "requestType": "CreateSearchConfigRequest", + "responseType": "SearchConfig", + "options": { + "(google.api.http).post": "/v1alpha1/{parent=projects/*/locations/*/corpora/*}/searchConfigs", + "(google.api.http).body": "search_config", + "(google.api.method_signature)": "parent,search_config,search_config_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha1/{parent=projects/*/locations/*/corpora/*}/searchConfigs", + "body": "search_config" + } + }, + { + "(google.api.method_signature)": "parent,search_config,search_config_id" + } + ] + }, + "UpdateSearchConfig": { + "requestType": "UpdateSearchConfigRequest", + "responseType": "SearchConfig", + "options": { + "(google.api.http).patch": "/v1alpha1/{search_config.name=projects/*/locations/*/corpora/*/searchConfigs/*}", + "(google.api.http).body": "search_config", + "(google.api.method_signature)": "search_config,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1alpha1/{search_config.name=projects/*/locations/*/corpora/*/searchConfigs/*}", + "body": "search_config" + } + }, + { + "(google.api.method_signature)": "search_config,update_mask" + } + ] + }, + "GetSearchConfig": { + "requestType": "GetSearchConfigRequest", + "responseType": "SearchConfig", + "options": { + "(google.api.http).get": "/v1alpha1/{name=projects/*/locations/*/corpora/*/searchConfigs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha1/{name=projects/*/locations/*/corpora/*/searchConfigs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteSearchConfig": { + "requestType": "DeleteSearchConfigRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1alpha1/{name=projects/*/locations/*/corpora/*/searchConfigs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1alpha1/{name=projects/*/locations/*/corpora/*/searchConfigs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListSearchConfigs": { + "requestType": "ListSearchConfigsRequest", + "responseType": "ListSearchConfigsResponse", + "options": { + "(google.api.http).get": "/v1alpha1/{parent=projects/*/locations/*/corpora/*}/searchConfigs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha1/{parent=projects/*/locations/*/corpora/*}/searchConfigs" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "SearchAssets": { + "requestType": "SearchAssetsRequest", + "responseType": "SearchAssetsResponse", + "options": { + "(google.api.http).post": "/v1alpha1/{corpus=projects/*/locations/*/corpora/*}:searchAssets", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha1/{corpus=projects/*/locations/*/corpora/*}:searchAssets", + "body": "*" + } + } + ] + } + } + }, + "FacetBucketType": { + "values": { + "FACET_BUCKET_TYPE_UNSPECIFIED": 0, + "FACET_BUCKET_TYPE_VALUE": 1, + "FACET_BUCKET_TYPE_DATETIME": 2, + "FACET_BUCKET_TYPE_FIXED_RANGE": 3, + "FACET_BUCKET_TYPE_CUSTOM_RANGE": 4 + } + }, + "CreateAssetRequest": { + "oneofs": { + "_assetId": { + "oneof": [ + "assetId" + ] + } + }, + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "visionai.googleapis.com/Corpus" + } + }, + "asset": { + "type": "Asset", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "assetId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "GetAssetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "visionai.googleapis.com/Asset" + } + } + } + }, + "ListAssetsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "visionai.googleapis.com/Asset" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListAssetsResponse": { + "fields": { + "assets": { + "rule": "repeated", + "type": "Asset", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "UpdateAssetRequest": { + "fields": { + "asset": { + "type": "Asset", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "DeleteAssetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "visionai.googleapis.com/Asset" + } + } + } + }, + "Asset": { + "options": { + "(google.api.resource).type": "visionai.googleapis.com/Asset", + "(google.api.resource).pattern": "projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "ttl": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "CreateCorpusRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "corpus": { + "type": "Corpus", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "CreateCorpusMetadata": { + "fields": {} + }, + "Corpus": { + "options": { + "(google.api.resource).type": "visionai.googleapis.com/Corpus", + "(google.api.resource).pattern": "projects/{project_number}/locations/{location}/corpora/{corpus}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "defaultTtl": { + "type": "google.protobuf.Duration", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetCorpusRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "visionai.googleapis.com/Corpus" + } + } + } + }, + "UpdateCorpusRequest": { + "fields": { + "corpus": { + "type": "Corpus", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "ListCorporaRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListCorporaResponse": { + "fields": { + "corpora": { + "rule": "repeated", + "type": "Corpus", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DeleteCorpusRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "visionai.googleapis.com/Corpus" + } + } + } + }, + "CreateDataSchemaRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "visionai.googleapis.com/Corpus" + } + }, + "dataSchema": { + "type": "DataSchema", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DataSchema": { + "options": { + "(google.api.resource).type": "visionai.googleapis.com/DataSchema", + "(google.api.resource).pattern": "projects/{project_number}/locations/{location}/corpora/{corpus}/dataSchemas/{data_schema}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "key": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "schemaDetails": { + "type": "DataSchemaDetails", + "id": 3 + } + } + }, + "DataSchemaDetails": { + "fields": { + "type": { + "type": "DataType", + "id": 1 + }, + "protoAnyConfig": { + "type": "ProtoAnyConfig", + "id": 6 + }, + "granularity": { + "type": "Granularity", + "id": 5 + }, + "searchStrategy": { + "type": "SearchStrategy", + "id": 7 + } + }, + "nested": { + "ProtoAnyConfig": { + "fields": { + "typeUri": { + "type": "string", + "id": 1 + } + } + }, + "SearchStrategy": { + "fields": { + "searchStrategyType": { + "type": "SearchStrategyType", + "id": 1 + } + }, + "nested": { + "SearchStrategyType": { + "values": { + "NO_SEARCH": 0, + "EXACT_SEARCH": 1, + "SMART_SEARCH": 2 + } + } + } + }, + "DataType": { + "values": { + "DATA_TYPE_UNSPECIFIED": 0, + "INTEGER": 1, + "FLOAT": 2, + "STRING": 3, + "DATETIME": 5, + "GEO_COORDINATE": 7, + "PROTO_ANY": 8, + "BOOLEAN": 9 + } + }, + "Granularity": { + "values": { + "GRANULARITY_UNSPECIFIED": 0, + "GRANULARITY_ASSET_LEVEL": 1, + "GRANULARITY_PARTITION_LEVEL": 2 + } + } + } + }, + "UpdateDataSchemaRequest": { + "fields": { + "dataSchema": { + "type": "DataSchema", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "GetDataSchemaRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "visionai.googleapis.com/DataSchema" + } + } + } + }, + "DeleteDataSchemaRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "visionai.googleapis.com/DataSchema" + } + } + } + }, + "ListDataSchemasRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "visionai.googleapis.com/DataSchema" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListDataSchemasResponse": { + "fields": { + "dataSchemas": { + "rule": "repeated", + "type": "DataSchema", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CreateAnnotationRequest": { + "oneofs": { + "_annotationId": { + "oneof": [ + "annotationId" + ] + } + }, + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "visionai.googleapis.com/Asset" + } + }, + "annotation": { + "type": "Annotation", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "annotationId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "Annotation": { + "options": { + "(google.api.resource).type": "visionai.googleapis.com/Annotation", + "(google.api.resource).pattern": "projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "userSpecifiedAnnotation": { + "type": "UserSpecifiedAnnotation", + "id": 2 + } + } + }, + "UserSpecifiedAnnotation": { + "fields": { + "key": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "value": { + "type": "AnnotationValue", + "id": 2 + }, + "partition": { + "type": "Partition", + "id": 3 + } + } + }, + "GeoCoordinate": { + "fields": { + "latitude": { + "type": "double", + "id": 1 + }, + "longitude": { + "type": "double", + "id": 2 + } + } + }, + "AnnotationValue": { + "oneofs": { + "value": { + "oneof": [ + "intValue", + "floatValue", + "strValue", + "datetimeValue", + "geoCoordinate", + "protoAnyValue", + "boolValue", + "customizedStructDataValue" + ] + } + }, + "fields": { + "intValue": { + "type": "int64", + "id": 1 + }, + "floatValue": { + "type": "float", + "id": 2 + }, + "strValue": { + "type": "string", + "id": 3 + }, + "datetimeValue": { + "type": "string", + "id": 5 + }, + "geoCoordinate": { + "type": "GeoCoordinate", + "id": 7 + }, + "protoAnyValue": { + "type": "google.protobuf.Any", + "id": 8 + }, + "boolValue": { + "type": "bool", + "id": 9 + }, + "customizedStructDataValue": { + "type": "google.protobuf.Struct", + "id": 10 + } + } + }, + "ListAnnotationsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "visionai.googleapis.com/Asset" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + } + } + }, + "ListAnnotationsResponse": { + "fields": { + "annotations": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetAnnotationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "visionai.googleapis.com/Annotation" + } + } + } + }, + "UpdateAnnotationRequest": { + "fields": { + "annotation": { + "type": "Annotation", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "DeleteAnnotationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "visionai.googleapis.com/Annotation" + } + } + } + }, + "CreateSearchConfigRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "visionai.googleapis.com/SearchConfig" + } + }, + "searchConfig": { + "type": "SearchConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "searchConfigId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateSearchConfigRequest": { + "fields": { + "searchConfig": { + "type": "SearchConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "GetSearchConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "visionai.googleapis.com/SearchConfig" + } + } + } + }, + "DeleteSearchConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "visionai.googleapis.com/SearchConfig" + } + } + } + }, + "ListSearchConfigsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "visionai.googleapis.com/SearchConfig" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListSearchConfigsResponse": { + "fields": { + "searchConfigs": { + "rule": "repeated", + "type": "SearchConfig", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "SearchConfig": { + "options": { + "(google.api.resource).type": "visionai.googleapis.com/SearchConfig", + "(google.api.resource).pattern": "projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "facetProperty": { + "type": "FacetProperty", + "id": 2 + }, + "searchCriteriaProperty": { + "type": "SearchCriteriaProperty", + "id": 3 + } + } + }, + "FacetProperty": { + "oneofs": { + "rangeFacetConfig": { + "oneof": [ + "fixedRangeBucketSpec", + "customRangeBucketSpec", + "datetimeBucketSpec" + ] + } + }, + "fields": { + "fixedRangeBucketSpec": { + "type": "FixedRangeBucketSpec", + "id": 5 + }, + "customRangeBucketSpec": { + "type": "CustomRangeBucketSpec", + "id": 6 + }, + "datetimeBucketSpec": { + "type": "DateTimeBucketSpec", + "id": 7 + }, + "mappedFields": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "resultSize": { + "type": "int64", + "id": 3 + }, + "bucketType": { + "type": "FacetBucketType", + "id": 4 + } + }, + "nested": { + "FixedRangeBucketSpec": { + "fields": { + "bucketStart": { + "type": "FacetValue", + "id": 1 + }, + "bucketGranularity": { + "type": "FacetValue", + "id": 2 + }, + "bucketCount": { + "type": "int32", + "id": 3 + } + } + }, + "CustomRangeBucketSpec": { + "fields": { + "endpoints": { + "rule": "repeated", + "type": "FacetValue", + "id": 1 + } + } + }, + "DateTimeBucketSpec": { + "fields": { + "granularity": { + "type": "Granularity", + "id": 1 + } + }, + "nested": { + "Granularity": { + "values": { + "GRANULARITY_UNSPECIFIED": 0, + "YEAR": 1, + "MONTH": 2, + "DAY": 3 + } + } + } + } + } + }, + "SearchCriteriaProperty": { + "fields": { + "mappedFields": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "FacetValue": { + "oneofs": { + "value": { + "oneof": [ + "stringValue", + "integerValue", + "datetimeValue" + ] + } + }, + "fields": { + "stringValue": { + "type": "string", + "id": 1 + }, + "integerValue": { + "type": "int64", + "id": 2 + }, + "datetimeValue": { + "type": "google.type.DateTime", + "id": 3 + } + } + }, + "FacetBucket": { + "oneofs": { + "bucketValue": { + "oneof": [ + "value", + "range" + ] + } + }, + "fields": { + "value": { + "type": "FacetValue", + "id": 2 + }, + "range": { + "type": "Range", + "id": 4 + }, + "selected": { + "type": "bool", + "id": 3 + } + }, + "nested": { + "Range": { + "fields": { + "start": { + "type": "FacetValue", + "id": 1 + }, + "end": { + "type": "FacetValue", + "id": 2 + } + } + } + } + }, + "FacetGroup": { + "fields": { + "facetId": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "buckets": { + "rule": "repeated", + "type": "FacetBucket", + "id": 3 + }, + "bucketType": { + "type": "FacetBucketType", + "id": 4 + }, + "fetchMatchedAnnotations": { + "type": "bool", + "id": 5 + } + } + }, + "IngestAssetRequest": { + "oneofs": { + "streamingRequest": { + "oneof": [ + "config", + "timeIndexedData" + ] + } + }, + "fields": { + "config": { + "type": "Config", + "id": 1 + }, + "timeIndexedData": { + "type": "TimeIndexedData", + "id": 2 + } + }, + "nested": { + "Config": { + "oneofs": { + "dataType": { + "oneof": [ + "videoType" + ] + } + }, + "fields": { + "videoType": { + "type": "VideoType", + "id": 2 + }, + "asset": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "visionai.googleapis.com/Asset" + } + } + }, + "nested": { + "VideoType": { + "fields": { + "containerFormat": { + "type": "ContainerFormat", + "id": 1 + } + }, + "nested": { + "ContainerFormat": { + "values": { + "CONTAINER_FORMAT_UNSPECIFIED": 0, + "CONTAINER_FORMAT_MP4": 1 + } + } + } + } + } + }, + "TimeIndexedData": { + "fields": { + "data": { + "type": "bytes", + "id": 1 + }, + "temporalPartition": { + "type": "Partition.TemporalPartition", + "id": 2 + } + } + } + } + }, + "IngestAssetResponse": { + "fields": { + "successfullyIngestedPartition": { + "type": "Partition.TemporalPartition", + "id": 1 + } + } + }, + "ClipAssetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "visionai.googleapis.com/Asset" + } + }, + "temporalPartition": { + "type": "Partition.TemporalPartition", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ClipAssetResponse": { + "fields": { + "timeIndexedUris": { + "rule": "repeated", + "type": "TimeIndexedUri", + "id": 1 + } + }, + "nested": { + "TimeIndexedUri": { + "fields": { + "temporalPartition": { + "type": "Partition.TemporalPartition", + "id": 1 + }, + "uri": { + "type": "string", + "id": 2 + } + } + } + } + }, + "GenerateHlsUriRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "visionai.googleapis.com/Asset" + } + }, + "temporalPartitions": { + "rule": "repeated", + "type": "Partition.TemporalPartition", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GenerateHlsUriResponse": { + "fields": { + "uri": { + "type": "string", + "id": 1 + }, + "temporalPartitions": { + "rule": "repeated", + "type": "Partition.TemporalPartition", + "id": 2 + } + } + }, + "SearchAssetsRequest": { + "fields": { + "corpus": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "visionai.googleapis.com/Corpus" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "contentTimeRanges": { + "type": "DateTimeRangeArray", + "id": 5 + }, + "criteria": { + "rule": "repeated", + "type": "Criteria", + "id": 4 + }, + "facetSelections": { + "rule": "repeated", + "type": "FacetGroup", + "id": 6 + }, + "resultAnnotationKeys": { + "rule": "repeated", + "type": "string", + "id": 8 + } + } + }, + "DeleteAssetMetadata": { + "fields": {} + }, + "AnnotationMatchingResult": { + "fields": { + "criteria": { + "type": "Criteria", + "id": 1 + }, + "matchedAnnotations": { + "rule": "repeated", + "type": "Annotation", + "id": 2 + }, + "status": { + "type": "google.rpc.Status", + "id": 3 + } + } + }, + "SearchResultItem": { + "fields": { + "asset": { + "type": "string", + "id": 1 + }, + "segments": { + "rule": "repeated", + "type": "Partition.TemporalPartition", + "id": 2, + "options": { + "deprecated": true + } + }, + "segment": { + "type": "Partition.TemporalPartition", + "id": 5 + }, + "requestedAnnotations": { + "rule": "repeated", + "type": "Annotation", + "id": 3 + }, + "annotationMatchingResults": { + "rule": "repeated", + "type": "AnnotationMatchingResult", + "id": 4 + } + } + }, + "SearchAssetsResponse": { + "fields": { + "searchResultItems": { + "rule": "repeated", + "type": "SearchResultItem", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "facetResults": { + "rule": "repeated", + "type": "FacetGroup", + "id": 3 + } + } + }, + "IntRange": { + "oneofs": { + "_start": { + "oneof": [ + "start" + ] + }, + "_end": { + "oneof": [ + "end" + ] + } + }, + "fields": { + "start": { + "type": "int64", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "end": { + "type": "int64", + "id": 2, + "options": { + "proto3_optional": true + } + } + } + }, + "FloatRange": { + "oneofs": { + "_start": { + "oneof": [ + "start" + ] + }, + "_end": { + "oneof": [ + "end" + ] + } + }, + "fields": { + "start": { + "type": "float", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "end": { + "type": "float", + "id": 2, + "options": { + "proto3_optional": true + } + } + } + }, + "StringArray": { + "fields": { + "txtValues": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "IntRangeArray": { + "fields": { + "intRanges": { + "rule": "repeated", + "type": "IntRange", + "id": 1 + } + } + }, + "FloatRangeArray": { + "fields": { + "floatRanges": { + "rule": "repeated", + "type": "FloatRange", + "id": 1 + } + } + }, + "DateTimeRange": { + "fields": { + "start": { + "type": "google.type.DateTime", + "id": 1 + }, + "end": { + "type": "google.type.DateTime", + "id": 2 + } + } + }, + "DateTimeRangeArray": { + "fields": { + "dateTimeRanges": { + "rule": "repeated", + "type": "DateTimeRange", + "id": 1 + } + } + }, + "CircleArea": { + "fields": { + "latitude": { + "type": "double", + "id": 1 + }, + "longitude": { + "type": "double", + "id": 2 + }, + "radiusMeter": { + "type": "double", + "id": 3 + } + } + }, + "GeoLocationArray": { + "fields": { + "circleAreas": { + "rule": "repeated", + "type": "CircleArea", + "id": 1 + } + } + }, + "BoolValue": { + "fields": { + "value": { + "type": "bool", + "id": 1 + } + } + }, + "Criteria": { + "oneofs": { + "value": { + "oneof": [ + "textArray", + "intRangeArray", + "floatRangeArray", + "dateTimeRangeArray", + "geoLocationArray", + "boolValue" + ] + } + }, + "fields": { + "textArray": { + "type": "StringArray", + "id": 2 + }, + "intRangeArray": { + "type": "IntRangeArray", + "id": 3 + }, + "floatRangeArray": { + "type": "FloatRangeArray", + "id": 4 + }, + "dateTimeRangeArray": { + "type": "DateTimeRangeArray", + "id": 5 + }, + "geoLocationArray": { + "type": "GeoLocationArray", + "id": 6 + }, + "boolValue": { + "type": "BoolValue", + "id": 7 + }, + "field": { + "type": "string", + "id": 1 + }, + "fetchMatchedAnnotations": { + "type": "bool", + "id": 8 + } + } + }, + "Partition": { + "fields": { + "temporalPartition": { + "type": "TemporalPartition", + "id": 1 + }, + "spatialPartition": { + "type": "SpatialPartition", + "id": 2 + } + }, + "nested": { + "TemporalPartition": { + "fields": { + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + }, + "SpatialPartition": { + "oneofs": { + "_xMin": { + "oneof": [ + "xMin" + ] + }, + "_yMin": { + "oneof": [ + "yMin" + ] + }, + "_xMax": { + "oneof": [ + "xMax" + ] + }, + "_yMax": { + "oneof": [ + "yMax" + ] + } + }, + "fields": { + "xMin": { + "type": "int64", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "yMin": { + "type": "int64", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "xMax": { + "type": "int64", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "yMax": { + "type": "int64", + "id": 4, + "options": { + "proto3_optional": true + } + } + } + } + } + } + } } } } diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.add_application_stream_input.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.add_application_stream_input.js new file mode 100644 index 000000000000..eb70f18db820 --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.add_application_stream_input.js @@ -0,0 +1,83 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START visionai_v1alpha1_generated_AppPlatform_AddApplicationStreamInput_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. the name of the application to retrieve. + * Format: + * "projects/{project}/locations/{location}/applications/{application}" + */ + // const name = 'abc123' + /** + * The stream inputs to add, the stream resource name is the key of each + * StreamInput, and it must be unique within each application. + */ + // const applicationStreamInputs = [1,2,3,4] + /** + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Visionai library + const {AppPlatformClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new AppPlatformClient(); + + async function callAddApplicationStreamInput() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await visionaiClient.addApplicationStreamInput(request); + const [response] = await operation.promise(); + console.log(response); + } + + callAddApplicationStreamInput(); + // [END visionai_v1alpha1_generated_AppPlatform_AddApplicationStreamInput_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.create_application.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.create_application.js new file mode 100644 index 000000000000..043fb431da8e --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.create_application.js @@ -0,0 +1,86 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, applicationId, application) { + // [START visionai_v1alpha1_generated_AppPlatform_CreateApplication_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Value for parent. + */ + // const parent = 'abc123' + /** + * Required. Id of the requesting object. + */ + // const applicationId = 'abc123' + /** + * Required. The resource being created. + */ + // const application = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Visionai library + const {AppPlatformClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new AppPlatformClient(); + + async function callCreateApplication() { + // Construct request + const request = { + parent, + applicationId, + application, + }; + + // Run request + const [operation] = await visionaiClient.createApplication(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateApplication(); + // [END visionai_v1alpha1_generated_AppPlatform_CreateApplication_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.create_application_instances.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.create_application_instances.js new file mode 100644 index 000000000000..35170822a5cf --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.create_application_instances.js @@ -0,0 +1,83 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name, applicationInstances) { + // [START visionai_v1alpha1_generated_AppPlatform_CreateApplicationInstances_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. the name of the application to retrieve. + * Format: + * "projects/{project}/locations/{location}/applications/{application}" + */ + // const name = 'abc123' + /** + * Required. The resources being created. + */ + // const applicationInstances = [1,2,3,4] + /** + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Visionai library + const {AppPlatformClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new AppPlatformClient(); + + async function callCreateApplicationInstances() { + // Construct request + const request = { + name, + applicationInstances, + }; + + // Run request + const [operation] = await visionaiClient.createApplicationInstances(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateApplicationInstances(); + // [END visionai_v1alpha1_generated_AppPlatform_CreateApplicationInstances_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.create_draft.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.create_draft.js new file mode 100644 index 000000000000..1e68478e9239 --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.create_draft.js @@ -0,0 +1,86 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, draftId, draft) { + // [START visionai_v1alpha1_generated_AppPlatform_CreateDraft_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Value for parent. + */ + // const parent = 'abc123' + /** + * Required. Id of the requesting object. + */ + // const draftId = 'abc123' + /** + * Required. The resource being created. + */ + // const draft = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Visionai library + const {AppPlatformClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new AppPlatformClient(); + + async function callCreateDraft() { + // Construct request + const request = { + parent, + draftId, + draft, + }; + + // Run request + const [operation] = await visionaiClient.createDraft(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateDraft(); + // [END visionai_v1alpha1_generated_AppPlatform_CreateDraft_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.create_processor.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.create_processor.js new file mode 100644 index 000000000000..4e8b3dccdfbe --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.create_processor.js @@ -0,0 +1,86 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, processorId, processor) { + // [START visionai_v1alpha1_generated_AppPlatform_CreateProcessor_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Value for parent. + */ + // const parent = 'abc123' + /** + * Required. Id of the requesting object. + */ + // const processorId = 'abc123' + /** + * Required. The resource being created. + */ + // const processor = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Visionai library + const {AppPlatformClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new AppPlatformClient(); + + async function callCreateProcessor() { + // Construct request + const request = { + parent, + processorId, + processor, + }; + + // Run request + const [operation] = await visionaiClient.createProcessor(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateProcessor(); + // [END visionai_v1alpha1_generated_AppPlatform_CreateProcessor_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.delete_application.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.delete_application.js new file mode 100644 index 000000000000..0e60f09ac765 --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.delete_application.js @@ -0,0 +1,82 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START visionai_v1alpha1_generated_AppPlatform_DeleteApplication_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the resource. + */ + // const name = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. If set to true, any instances and drafts from this application will also be + * deleted. (Otherwise, the request will only work if the application has no + * instances and drafts.) + */ + // const force = true + + // Imports the Visionai library + const {AppPlatformClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new AppPlatformClient(); + + async function callDeleteApplication() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await visionaiClient.deleteApplication(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteApplication(); + // [END visionai_v1alpha1_generated_AppPlatform_DeleteApplication_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.delete_application_instances.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.delete_application_instances.js new file mode 100644 index 000000000000..0ed97afb002d --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.delete_application_instances.js @@ -0,0 +1,83 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name, instanceIds) { + // [START visionai_v1alpha1_generated_AppPlatform_DeleteApplicationInstances_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. the name of the application to retrieve. + * Format: + * "projects/{project}/locations/{location}/applications/{application}" + */ + // const name = 'abc123' + /** + * Required. Id of the requesting object. + */ + // const instanceIds = ['abc','def'] + /** + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Visionai library + const {AppPlatformClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new AppPlatformClient(); + + async function callDeleteApplicationInstances() { + // Construct request + const request = { + name, + instanceIds, + }; + + // Run request + const [operation] = await visionaiClient.deleteApplicationInstances(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteApplicationInstances(); + // [END visionai_v1alpha1_generated_AppPlatform_DeleteApplicationInstances_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.delete_draft.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.delete_draft.js new file mode 100644 index 000000000000..9436060912a3 --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.delete_draft.js @@ -0,0 +1,76 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START visionai_v1alpha1_generated_AppPlatform_DeleteDraft_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the resource. + */ + // const name = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Visionai library + const {AppPlatformClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new AppPlatformClient(); + + async function callDeleteDraft() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await visionaiClient.deleteDraft(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteDraft(); + // [END visionai_v1alpha1_generated_AppPlatform_DeleteDraft_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.delete_processor.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.delete_processor.js new file mode 100644 index 000000000000..bed9aa6d4844 --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.delete_processor.js @@ -0,0 +1,76 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START visionai_v1alpha1_generated_AppPlatform_DeleteProcessor_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the resource + */ + // const name = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Visionai library + const {AppPlatformClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new AppPlatformClient(); + + async function callDeleteProcessor() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await visionaiClient.deleteProcessor(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteProcessor(); + // [END visionai_v1alpha1_generated_AppPlatform_DeleteProcessor_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.deploy_application.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.deploy_application.js new file mode 100644 index 000000000000..af04d0aaf8c7 --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.deploy_application.js @@ -0,0 +1,87 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START visionai_v1alpha1_generated_AppPlatform_DeployApplication_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. the name of the application to retrieve. + * Format: + * "projects/{project}/locations/{location}/applications/{application}" + */ + // const name = 'abc123' + /** + * If set, validate the request and preview the application graph, but do not + * actually deploy it. + */ + // const validateOnly = true + /** + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. Whether or not to enable monitoring for the application on deployment. + */ + // const enableMonitoring = true + + // Imports the Visionai library + const {AppPlatformClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new AppPlatformClient(); + + async function callDeployApplication() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await visionaiClient.deployApplication(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeployApplication(); + // [END visionai_v1alpha1_generated_AppPlatform_DeployApplication_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.get_application.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.get_application.js new file mode 100644 index 000000000000..5131d9b73481 --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.get_application.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START visionai_v1alpha1_generated_AppPlatform_GetApplication_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the resource. + */ + // const name = 'abc123' + + // Imports the Visionai library + const {AppPlatformClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new AppPlatformClient(); + + async function callGetApplication() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await visionaiClient.getApplication(request); + console.log(response); + } + + callGetApplication(); + // [END visionai_v1alpha1_generated_AppPlatform_GetApplication_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.get_draft.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.get_draft.js new file mode 100644 index 000000000000..6d1b4c437989 --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.get_draft.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START visionai_v1alpha1_generated_AppPlatform_GetDraft_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the resource. + */ + // const name = 'abc123' + + // Imports the Visionai library + const {AppPlatformClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new AppPlatformClient(); + + async function callGetDraft() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await visionaiClient.getDraft(request); + console.log(response); + } + + callGetDraft(); + // [END visionai_v1alpha1_generated_AppPlatform_GetDraft_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.get_instance.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.get_instance.js new file mode 100644 index 000000000000..6db4fa142952 --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.get_instance.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START visionai_v1alpha1_generated_AppPlatform_GetInstance_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the resource. + */ + // const name = 'abc123' + + // Imports the Visionai library + const {AppPlatformClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new AppPlatformClient(); + + async function callGetInstance() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await visionaiClient.getInstance(request); + console.log(response); + } + + callGetInstance(); + // [END visionai_v1alpha1_generated_AppPlatform_GetInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.get_processor.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.get_processor.js new file mode 100644 index 000000000000..35c8aba831ef --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.get_processor.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START visionai_v1alpha1_generated_AppPlatform_GetProcessor_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the resource. + */ + // const name = 'abc123' + + // Imports the Visionai library + const {AppPlatformClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new AppPlatformClient(); + + async function callGetProcessor() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await visionaiClient.getProcessor(request); + console.log(response); + } + + callGetProcessor(); + // [END visionai_v1alpha1_generated_AppPlatform_GetProcessor_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.list_applications.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.list_applications.js new file mode 100644 index 000000000000..26d0b9507b77 --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.list_applications.js @@ -0,0 +1,80 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START visionai_v1alpha1_generated_AppPlatform_ListApplications_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent value for ListApplicationsRequest. + */ + // const parent = 'abc123' + /** + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + */ + // const pageSize = 1234 + /** + * A token identifying a page of results the server should return. + */ + // const pageToken = 'abc123' + /** + * Filtering results. + */ + // const filter = 'abc123' + /** + * Hint for how to order the results. + */ + // const orderBy = 'abc123' + + // Imports the Visionai library + const {AppPlatformClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new AppPlatformClient(); + + async function callListApplications() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = visionaiClient.listApplicationsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListApplications(); + // [END visionai_v1alpha1_generated_AppPlatform_ListApplications_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.list_drafts.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.list_drafts.js new file mode 100644 index 000000000000..927d97e7d5b9 --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.list_drafts.js @@ -0,0 +1,80 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START visionai_v1alpha1_generated_AppPlatform_ListDrafts_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent value for ListDraftsRequest. + */ + // const parent = 'abc123' + /** + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + */ + // const pageSize = 1234 + /** + * A token identifying a page of results the server should return. + */ + // const pageToken = 'abc123' + /** + * Filtering results. + */ + // const filter = 'abc123' + /** + * Hint for how to order the results. + */ + // const orderBy = 'abc123' + + // Imports the Visionai library + const {AppPlatformClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new AppPlatformClient(); + + async function callListDrafts() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = visionaiClient.listDraftsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListDrafts(); + // [END visionai_v1alpha1_generated_AppPlatform_ListDrafts_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.list_instances.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.list_instances.js new file mode 100644 index 000000000000..43200186e2be --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.list_instances.js @@ -0,0 +1,80 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START visionai_v1alpha1_generated_AppPlatform_ListInstances_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent value for ListInstancesRequest. + */ + // const parent = 'abc123' + /** + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + */ + // const pageSize = 1234 + /** + * A token identifying a page of results the server should return. + */ + // const pageToken = 'abc123' + /** + * Filtering results. + */ + // const filter = 'abc123' + /** + * Hint for how to order the results. + */ + // const orderBy = 'abc123' + + // Imports the Visionai library + const {AppPlatformClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new AppPlatformClient(); + + async function callListInstances() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = visionaiClient.listInstancesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListInstances(); + // [END visionai_v1alpha1_generated_AppPlatform_ListInstances_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.list_prebuilt_processors.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.list_prebuilt_processors.js new file mode 100644 index 000000000000..3b88f7191196 --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.list_prebuilt_processors.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START visionai_v1alpha1_generated_AppPlatform_ListPrebuiltProcessors_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent path. + */ + // const parent = 'abc123' + + // Imports the Visionai library + const {AppPlatformClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new AppPlatformClient(); + + async function callListPrebuiltProcessors() { + // Construct request + const request = { + parent, + }; + + // Run request + const response = await visionaiClient.listPrebuiltProcessors(request); + console.log(response); + } + + callListPrebuiltProcessors(); + // [END visionai_v1alpha1_generated_AppPlatform_ListPrebuiltProcessors_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.list_processors.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.list_processors.js new file mode 100644 index 000000000000..0b9ec740c875 --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.list_processors.js @@ -0,0 +1,80 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START visionai_v1alpha1_generated_AppPlatform_ListProcessors_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent value for ListProcessorsRequest. + */ + // const parent = 'abc123' + /** + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + */ + // const pageSize = 1234 + /** + * A token identifying a page of results the server should return. + */ + // const pageToken = 'abc123' + /** + * Filtering results. + */ + // const filter = 'abc123' + /** + * Hint for how to order the results. + */ + // const orderBy = 'abc123' + + // Imports the Visionai library + const {AppPlatformClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new AppPlatformClient(); + + async function callListProcessors() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = visionaiClient.listProcessorsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListProcessors(); + // [END visionai_v1alpha1_generated_AppPlatform_ListProcessors_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.remove_application_stream_input.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.remove_application_stream_input.js new file mode 100644 index 000000000000..c49f03c8bd3d --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.remove_application_stream_input.js @@ -0,0 +1,82 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START visionai_v1alpha1_generated_AppPlatform_RemoveApplicationStreamInput_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. the name of the application to retrieve. + * Format: + * "projects/{project}/locations/{location}/applications/{application}" + */ + // const name = 'abc123' + /** + * The target stream to remove. + */ + // const targetStreamInputs = [1,2,3,4] + /** + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Visionai library + const {AppPlatformClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new AppPlatformClient(); + + async function callRemoveApplicationStreamInput() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await visionaiClient.removeApplicationStreamInput(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRemoveApplicationStreamInput(); + // [END visionai_v1alpha1_generated_AppPlatform_RemoveApplicationStreamInput_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.undeploy_application.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.undeploy_application.js new file mode 100644 index 000000000000..980bfd913819 --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.undeploy_application.js @@ -0,0 +1,78 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START visionai_v1alpha1_generated_AppPlatform_UndeployApplication_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. the name of the application to retrieve. + * Format: + * "projects/{project}/locations/{location}/applications/{application}" + */ + // const name = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Visionai library + const {AppPlatformClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new AppPlatformClient(); + + async function callUndeployApplication() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await visionaiClient.undeployApplication(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUndeployApplication(); + // [END visionai_v1alpha1_generated_AppPlatform_UndeployApplication_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.update_application.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.update_application.js new file mode 100644 index 000000000000..5d4f667df3bb --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.update_application.js @@ -0,0 +1,84 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(application) { + // [START visionai_v1alpha1_generated_AppPlatform_UpdateApplication_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * Application resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + */ + // const updateMask = {} + /** + * Required. The resource being updated. + */ + // const application = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Visionai library + const {AppPlatformClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new AppPlatformClient(); + + async function callUpdateApplication() { + // Construct request + const request = { + application, + }; + + // Run request + const [operation] = await visionaiClient.updateApplication(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateApplication(); + // [END visionai_v1alpha1_generated_AppPlatform_UpdateApplication_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.update_application_instances.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.update_application_instances.js new file mode 100644 index 000000000000..fcf6a3a37268 --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.update_application_instances.js @@ -0,0 +1,86 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START visionai_v1alpha1_generated_AppPlatform_UpdateApplicationInstances_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. the name of the application to retrieve. + * Format: + * "projects/{project}/locations/{location}/applications/{application}" + */ + // const name = 'abc123' + /** + */ + // const applicationInstances = [1,2,3,4] + /** + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * If true, Update Request will create one resource if the target resource + * doesn't exist, this time, the field_mask will be ignored. + */ + // const allowMissing = true + + // Imports the Visionai library + const {AppPlatformClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new AppPlatformClient(); + + async function callUpdateApplicationInstances() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await visionaiClient.updateApplicationInstances(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateApplicationInstances(); + // [END visionai_v1alpha1_generated_AppPlatform_UpdateApplicationInstances_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.update_application_stream_input.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.update_application_stream_input.js new file mode 100644 index 000000000000..55d80ebdffce --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.update_application_stream_input.js @@ -0,0 +1,88 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START visionai_v1alpha1_generated_AppPlatform_UpdateApplicationStreamInput_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. the name of the application to retrieve. + * Format: + * "projects/{project}/locations/{location}/applications/{application}" + */ + // const name = 'abc123' + /** + * The stream inputs to update, the stream resource name is the key of each + * StreamInput, and it must be unique within each application. + */ + // const applicationStreamInputs = [1,2,3,4] + /** + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * If true, UpdateApplicationStreamInput will insert stream input to + * application even if the target stream is not included in the application. + */ + // const allowMissing = true + + // Imports the Visionai library + const {AppPlatformClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new AppPlatformClient(); + + async function callUpdateApplicationStreamInput() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await visionaiClient.updateApplicationStreamInput(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateApplicationStreamInput(); + // [END visionai_v1alpha1_generated_AppPlatform_UpdateApplicationStreamInput_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.update_draft.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.update_draft.js new file mode 100644 index 000000000000..e284ea36a994 --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.update_draft.js @@ -0,0 +1,89 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(draft) { + // [START visionai_v1alpha1_generated_AppPlatform_UpdateDraft_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * Draft resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + */ + // const updateMask = {} + /** + * Required. The resource being updated. + */ + // const draft = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * If true, UpdateDraftRequest will create one resource if the target resource + * doesn't exist, this time, the field_mask will be ignored. + */ + // const allowMissing = true + + // Imports the Visionai library + const {AppPlatformClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new AppPlatformClient(); + + async function callUpdateDraft() { + // Construct request + const request = { + draft, + }; + + // Run request + const [operation] = await visionaiClient.updateDraft(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateDraft(); + // [END visionai_v1alpha1_generated_AppPlatform_UpdateDraft_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.update_processor.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.update_processor.js new file mode 100644 index 000000000000..5d36d1e3107c --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/app_platform.update_processor.js @@ -0,0 +1,84 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(processor) { + // [START visionai_v1alpha1_generated_AppPlatform_UpdateProcessor_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * Processor resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + */ + // const updateMask = {} + /** + * Required. The resource being updated. + */ + // const processor = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Visionai library + const {AppPlatformClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new AppPlatformClient(); + + async function callUpdateProcessor() { + // Construct request + const request = { + processor, + }; + + // Run request + const [operation] = await visionaiClient.updateProcessor(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateProcessor(); + // [END visionai_v1alpha1_generated_AppPlatform_UpdateProcessor_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/live_video_analytics.create_analysis.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/live_video_analytics.create_analysis.js new file mode 100644 index 000000000000..1dd2cb78cbb3 --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/live_video_analytics.create_analysis.js @@ -0,0 +1,86 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, analysisId, analysis) { + // [START visionai_v1alpha1_generated_LiveVideoAnalytics_CreateAnalysis_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Value for parent. + */ + // const parent = 'abc123' + /** + * Required. Id of the requesting object. + */ + // const analysisId = 'abc123' + /** + * Required. The resource being created. + */ + // const analysis = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Visionai library + const {LiveVideoAnalyticsClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new LiveVideoAnalyticsClient(); + + async function callCreateAnalysis() { + // Construct request + const request = { + parent, + analysisId, + analysis, + }; + + // Run request + const [operation] = await visionaiClient.createAnalysis(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateAnalysis(); + // [END visionai_v1alpha1_generated_LiveVideoAnalytics_CreateAnalysis_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/live_video_analytics.delete_analysis.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/live_video_analytics.delete_analysis.js new file mode 100644 index 000000000000..e19679193e5b --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/live_video_analytics.delete_analysis.js @@ -0,0 +1,76 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START visionai_v1alpha1_generated_LiveVideoAnalytics_DeleteAnalysis_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the resource. + */ + // const name = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Visionai library + const {LiveVideoAnalyticsClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new LiveVideoAnalyticsClient(); + + async function callDeleteAnalysis() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await visionaiClient.deleteAnalysis(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteAnalysis(); + // [END visionai_v1alpha1_generated_LiveVideoAnalytics_DeleteAnalysis_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/live_video_analytics.get_analysis.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/live_video_analytics.get_analysis.js new file mode 100644 index 000000000000..98c2dd00b41e --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/live_video_analytics.get_analysis.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START visionai_v1alpha1_generated_LiveVideoAnalytics_GetAnalysis_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the resource. + */ + // const name = 'abc123' + + // Imports the Visionai library + const {LiveVideoAnalyticsClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new LiveVideoAnalyticsClient(); + + async function callGetAnalysis() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await visionaiClient.getAnalysis(request); + console.log(response); + } + + callGetAnalysis(); + // [END visionai_v1alpha1_generated_LiveVideoAnalytics_GetAnalysis_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/live_video_analytics.list_analyses.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/live_video_analytics.list_analyses.js new file mode 100644 index 000000000000..c2ad267212e9 --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/live_video_analytics.list_analyses.js @@ -0,0 +1,80 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START visionai_v1alpha1_generated_LiveVideoAnalytics_ListAnalyses_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent value for ListAnalysesRequest + */ + // const parent = 'abc123' + /** + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + */ + // const pageSize = 1234 + /** + * A token identifying a page of results the server should return. + */ + // const pageToken = 'abc123' + /** + * Filtering results + */ + // const filter = 'abc123' + /** + * Hint for how to order the results + */ + // const orderBy = 'abc123' + + // Imports the Visionai library + const {LiveVideoAnalyticsClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new LiveVideoAnalyticsClient(); + + async function callListAnalyses() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = visionaiClient.listAnalysesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListAnalyses(); + // [END visionai_v1alpha1_generated_LiveVideoAnalytics_ListAnalyses_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/live_video_analytics.update_analysis.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/live_video_analytics.update_analysis.js new file mode 100644 index 000000000000..a2a863983e20 --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/live_video_analytics.update_analysis.js @@ -0,0 +1,85 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(updateMask, analysis) { + // [START visionai_v1alpha1_generated_LiveVideoAnalytics_UpdateAnalysis_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * Analysis resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + */ + // const updateMask = {} + /** + * Required. The resource being updated. + */ + // const analysis = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Visionai library + const {LiveVideoAnalyticsClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new LiveVideoAnalyticsClient(); + + async function callUpdateAnalysis() { + // Construct request + const request = { + updateMask, + analysis, + }; + + // Run request + const [operation] = await visionaiClient.updateAnalysis(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateAnalysis(); + // [END visionai_v1alpha1_generated_LiveVideoAnalytics_UpdateAnalysis_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/streaming_service.acquire_lease.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/streaming_service.acquire_lease.js new file mode 100644 index 000000000000..331ae962dad0 --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/streaming_service.acquire_lease.js @@ -0,0 +1,72 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START visionai_v1alpha1_generated_StreamingService_AcquireLease_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The series name. + */ + // const series = 'abc123' + /** + * The owner name. + */ + // const owner = 'abc123' + /** + * The lease term. + */ + // const term = {} + /** + * The lease type. + */ + // const leaseType = {} + + // Imports the Visionai library + const {StreamingServiceClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new StreamingServiceClient(); + + async function callAcquireLease() { + // Construct request + const request = { + }; + + // Run request + const response = await visionaiClient.acquireLease(request); + console.log(response); + } + + callAcquireLease(); + // [END visionai_v1alpha1_generated_StreamingService_AcquireLease_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/streaming_service.receive_events.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/streaming_service.receive_events.js new file mode 100644 index 000000000000..e7073e706974 --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/streaming_service.receive_events.js @@ -0,0 +1,68 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START visionai_v1alpha1_generated_StreamingService_ReceiveEvents_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The setup request to setup the RPC connection. + */ + // const setupRequest = {} + /** + * This request checkpoints the consumer's read progress. + */ + // const commitRequest = {} + + // Imports the Visionai library + const {StreamingServiceClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new StreamingServiceClient(); + + async function callReceiveEvents() { + // Construct request + const request = { + }; + + // Run request + const stream = await visionaiClient.receiveEvents(); + stream.on('data', (response) => { console.log(response) }); + stream.on('error', (err) => { throw(err) }); + stream.on('end', () => { /* API call completed */ }); + stream.write(request); + stream.end(); + } + + callReceiveEvents(); + // [END visionai_v1alpha1_generated_StreamingService_ReceiveEvents_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/streaming_service.receive_packets.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/streaming_service.receive_packets.js new file mode 100644 index 000000000000..01b47f813842 --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/streaming_service.receive_packets.js @@ -0,0 +1,69 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START visionai_v1alpha1_generated_StreamingService_ReceivePackets_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The request to setup the initial state of session. + * The client must send and only send this as the first message. + */ + // const setupRequest = {} + /** + * This request checkpoints the consumer's read progress. + */ + // const commitRequest = {} + + // Imports the Visionai library + const {StreamingServiceClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new StreamingServiceClient(); + + async function callReceivePackets() { + // Construct request + const request = { + }; + + // Run request + const stream = await visionaiClient.receivePackets(); + stream.on('data', (response) => { console.log(response) }); + stream.on('error', (err) => { throw(err) }); + stream.on('end', () => { /* API call completed */ }); + stream.write(request); + stream.end(); + } + + callReceivePackets(); + // [END visionai_v1alpha1_generated_StreamingService_ReceivePackets_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/streaming_service.release_lease.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/streaming_service.release_lease.js new file mode 100644 index 000000000000..6366f4e09376 --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/streaming_service.release_lease.js @@ -0,0 +1,68 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START visionai_v1alpha1_generated_StreamingService_ReleaseLease_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Lease id. + */ + // const id = 'abc123' + /** + * Series name. + */ + // const series = 'abc123' + /** + * Lease owner. + */ + // const owner = 'abc123' + + // Imports the Visionai library + const {StreamingServiceClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new StreamingServiceClient(); + + async function callReleaseLease() { + // Construct request + const request = { + }; + + // Run request + const response = await visionaiClient.releaseLease(request); + console.log(response); + } + + callReleaseLease(); + // [END visionai_v1alpha1_generated_StreamingService_ReleaseLease_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/streaming_service.renew_lease.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/streaming_service.renew_lease.js new file mode 100644 index 000000000000..202f541a9a03 --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/streaming_service.renew_lease.js @@ -0,0 +1,72 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START visionai_v1alpha1_generated_StreamingService_RenewLease_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Lease id. + */ + // const id = 'abc123' + /** + * Series name. + */ + // const series = 'abc123' + /** + * Lease owner. + */ + // const owner = 'abc123' + /** + * Lease term. + */ + // const term = {} + + // Imports the Visionai library + const {StreamingServiceClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new StreamingServiceClient(); + + async function callRenewLease() { + // Construct request + const request = { + }; + + // Run request + const response = await visionaiClient.renewLease(request); + console.log(response); + } + + callRenewLease(); + // [END visionai_v1alpha1_generated_StreamingService_RenewLease_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/streaming_service.send_packets.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/streaming_service.send_packets.js new file mode 100644 index 000000000000..c647663474b5 --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/streaming_service.send_packets.js @@ -0,0 +1,68 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START visionai_v1alpha1_generated_StreamingService_SendPackets_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Packets sent over the streaming rpc. + */ + // const packet = {} + /** + * The first message of the streaming rpc including the request metadata. + */ + // const metadata = {} + + // Imports the Visionai library + const {StreamingServiceClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new StreamingServiceClient(); + + async function callSendPackets() { + // Construct request + const request = { + }; + + // Run request + const stream = await visionaiClient.sendPackets(); + stream.on('data', (response) => { console.log(response) }); + stream.on('error', (err) => { throw(err) }); + stream.on('end', () => { /* API call completed */ }); + stream.write(request); + stream.end(); + } + + callSendPackets(); + // [END visionai_v1alpha1_generated_StreamingService_SendPackets_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.create_cluster.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.create_cluster.js new file mode 100644 index 000000000000..94bb02b067c4 --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.create_cluster.js @@ -0,0 +1,86 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, clusterId, cluster) { + // [START visionai_v1alpha1_generated_StreamsService_CreateCluster_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Value for parent. + */ + // const parent = 'abc123' + /** + * Required. Id of the requesting object. + */ + // const clusterId = 'abc123' + /** + * Required. The resource being created. + */ + // const cluster = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Visionai library + const {StreamsServiceClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new StreamsServiceClient(); + + async function callCreateCluster() { + // Construct request + const request = { + parent, + clusterId, + cluster, + }; + + // Run request + const [operation] = await visionaiClient.createCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateCluster(); + // [END visionai_v1alpha1_generated_StreamsService_CreateCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.create_event.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.create_event.js new file mode 100644 index 000000000000..b5674f4ddd19 --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.create_event.js @@ -0,0 +1,86 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, eventId, event) { + // [START visionai_v1alpha1_generated_StreamsService_CreateEvent_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Value for parent. + */ + // const parent = 'abc123' + /** + * Required. Id of the requesting object. + */ + // const eventId = 'abc123' + /** + * Required. The resource being created. + */ + // const event = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Visionai library + const {StreamsServiceClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new StreamsServiceClient(); + + async function callCreateEvent() { + // Construct request + const request = { + parent, + eventId, + event, + }; + + // Run request + const [operation] = await visionaiClient.createEvent(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateEvent(); + // [END visionai_v1alpha1_generated_StreamsService_CreateEvent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.create_series.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.create_series.js new file mode 100644 index 000000000000..9e4cb3aedb55 --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.create_series.js @@ -0,0 +1,86 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, seriesId, series) { + // [START visionai_v1alpha1_generated_StreamsService_CreateSeries_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Value for parent. + */ + // const parent = 'abc123' + /** + * Required. Id of the requesting object. + */ + // const seriesId = 'abc123' + /** + * Required. The resource being created. + */ + // const series = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Visionai library + const {StreamsServiceClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new StreamsServiceClient(); + + async function callCreateSeries() { + // Construct request + const request = { + parent, + seriesId, + series, + }; + + // Run request + const [operation] = await visionaiClient.createSeries(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateSeries(); + // [END visionai_v1alpha1_generated_StreamsService_CreateSeries_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.create_stream.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.create_stream.js new file mode 100644 index 000000000000..8b8487d7e4c0 --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.create_stream.js @@ -0,0 +1,86 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, streamId, stream) { + // [START visionai_v1alpha1_generated_StreamsService_CreateStream_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Value for parent. + */ + // const parent = 'abc123' + /** + * Required. Id of the requesting object. + */ + // const streamId = 'abc123' + /** + * Required. The resource being created. + */ + // const stream = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Visionai library + const {StreamsServiceClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new StreamsServiceClient(); + + async function callCreateStream() { + // Construct request + const request = { + parent, + streamId, + stream, + }; + + // Run request + const [operation] = await visionaiClient.createStream(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateStream(); + // [END visionai_v1alpha1_generated_StreamsService_CreateStream_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.delete_cluster.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.delete_cluster.js new file mode 100644 index 000000000000..0d056dcb5eee --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.delete_cluster.js @@ -0,0 +1,76 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START visionai_v1alpha1_generated_StreamsService_DeleteCluster_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the resource + */ + // const name = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Visionai library + const {StreamsServiceClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new StreamsServiceClient(); + + async function callDeleteCluster() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await visionaiClient.deleteCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteCluster(); + // [END visionai_v1alpha1_generated_StreamsService_DeleteCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.delete_event.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.delete_event.js new file mode 100644 index 000000000000..33fbe85ac3a0 --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.delete_event.js @@ -0,0 +1,76 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START visionai_v1alpha1_generated_StreamsService_DeleteEvent_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the resource. + */ + // const name = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Visionai library + const {StreamsServiceClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new StreamsServiceClient(); + + async function callDeleteEvent() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await visionaiClient.deleteEvent(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteEvent(); + // [END visionai_v1alpha1_generated_StreamsService_DeleteEvent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.delete_series.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.delete_series.js new file mode 100644 index 000000000000..4fffb5687d88 --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.delete_series.js @@ -0,0 +1,76 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START visionai_v1alpha1_generated_StreamsService_DeleteSeries_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the resource. + */ + // const name = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Visionai library + const {StreamsServiceClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new StreamsServiceClient(); + + async function callDeleteSeries() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await visionaiClient.deleteSeries(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteSeries(); + // [END visionai_v1alpha1_generated_StreamsService_DeleteSeries_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.delete_stream.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.delete_stream.js new file mode 100644 index 000000000000..eea98a46e268 --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.delete_stream.js @@ -0,0 +1,76 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START visionai_v1alpha1_generated_StreamsService_DeleteStream_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the resource. + */ + // const name = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Visionai library + const {StreamsServiceClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new StreamsServiceClient(); + + async function callDeleteStream() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await visionaiClient.deleteStream(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteStream(); + // [END visionai_v1alpha1_generated_StreamsService_DeleteStream_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.generate_stream_hls_token.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.generate_stream_hls_token.js new file mode 100644 index 000000000000..b97bcde3247b --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.generate_stream_hls_token.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(stream) { + // [START visionai_v1alpha1_generated_StreamsService_GenerateStreamHlsToken_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the stream. + */ + // const stream = 'abc123' + + // Imports the Visionai library + const {StreamsServiceClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new StreamsServiceClient(); + + async function callGenerateStreamHlsToken() { + // Construct request + const request = { + stream, + }; + + // Run request + const response = await visionaiClient.generateStreamHlsToken(request); + console.log(response); + } + + callGenerateStreamHlsToken(); + // [END visionai_v1alpha1_generated_StreamsService_GenerateStreamHlsToken_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.get_cluster.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.get_cluster.js new file mode 100644 index 000000000000..e87586523fbf --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.get_cluster.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START visionai_v1alpha1_generated_StreamsService_GetCluster_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the resource. + */ + // const name = 'abc123' + + // Imports the Visionai library + const {StreamsServiceClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new StreamsServiceClient(); + + async function callGetCluster() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await visionaiClient.getCluster(request); + console.log(response); + } + + callGetCluster(); + // [END visionai_v1alpha1_generated_StreamsService_GetCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.get_event.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.get_event.js new file mode 100644 index 000000000000..dc57d7a1ccf9 --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.get_event.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START visionai_v1alpha1_generated_StreamsService_GetEvent_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the resource. + */ + // const name = 'abc123' + + // Imports the Visionai library + const {StreamsServiceClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new StreamsServiceClient(); + + async function callGetEvent() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await visionaiClient.getEvent(request); + console.log(response); + } + + callGetEvent(); + // [END visionai_v1alpha1_generated_StreamsService_GetEvent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.get_series.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.get_series.js new file mode 100644 index 000000000000..9939f62478f1 --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.get_series.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START visionai_v1alpha1_generated_StreamsService_GetSeries_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the resource. + */ + // const name = 'abc123' + + // Imports the Visionai library + const {StreamsServiceClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new StreamsServiceClient(); + + async function callGetSeries() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await visionaiClient.getSeries(request); + console.log(response); + } + + callGetSeries(); + // [END visionai_v1alpha1_generated_StreamsService_GetSeries_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.get_stream.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.get_stream.js new file mode 100644 index 000000000000..9eb2b2508624 --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.get_stream.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START visionai_v1alpha1_generated_StreamsService_GetStream_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the resource. + */ + // const name = 'abc123' + + // Imports the Visionai library + const {StreamsServiceClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new StreamsServiceClient(); + + async function callGetStream() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await visionaiClient.getStream(request); + console.log(response); + } + + callGetStream(); + // [END visionai_v1alpha1_generated_StreamsService_GetStream_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.list_clusters.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.list_clusters.js new file mode 100644 index 000000000000..e3e207771e66 --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.list_clusters.js @@ -0,0 +1,80 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START visionai_v1alpha1_generated_StreamsService_ListClusters_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent value for ListClustersRequest. + */ + // const parent = 'abc123' + /** + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + */ + // const pageSize = 1234 + /** + * A token identifying a page of results the server should return. + */ + // const pageToken = 'abc123' + /** + * Filtering results. + */ + // const filter = 'abc123' + /** + * Hint for how to order the results. + */ + // const orderBy = 'abc123' + + // Imports the Visionai library + const {StreamsServiceClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new StreamsServiceClient(); + + async function callListClusters() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = visionaiClient.listClustersAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListClusters(); + // [END visionai_v1alpha1_generated_StreamsService_ListClusters_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.list_events.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.list_events.js new file mode 100644 index 000000000000..aa25d02daf93 --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.list_events.js @@ -0,0 +1,80 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START visionai_v1alpha1_generated_StreamsService_ListEvents_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent value for ListEventsRequest. + */ + // const parent = 'abc123' + /** + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + */ + // const pageSize = 1234 + /** + * A token identifying a page of results the server should return. + */ + // const pageToken = 'abc123' + /** + * Filtering results. + */ + // const filter = 'abc123' + /** + * Hint for how to order the results. + */ + // const orderBy = 'abc123' + + // Imports the Visionai library + const {StreamsServiceClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new StreamsServiceClient(); + + async function callListEvents() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = visionaiClient.listEventsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListEvents(); + // [END visionai_v1alpha1_generated_StreamsService_ListEvents_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.list_series.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.list_series.js new file mode 100644 index 000000000000..e3dfabd16099 --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.list_series.js @@ -0,0 +1,80 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START visionai_v1alpha1_generated_StreamsService_ListSeries_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent value for ListSeriesRequest. + */ + // const parent = 'abc123' + /** + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + */ + // const pageSize = 1234 + /** + * A token identifying a page of results the server should return. + */ + // const pageToken = 'abc123' + /** + * Filtering results. + */ + // const filter = 'abc123' + /** + * Hint for how to order the results. + */ + // const orderBy = 'abc123' + + // Imports the Visionai library + const {StreamsServiceClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new StreamsServiceClient(); + + async function callListSeries() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = visionaiClient.listSeriesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListSeries(); + // [END visionai_v1alpha1_generated_StreamsService_ListSeries_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.list_streams.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.list_streams.js new file mode 100644 index 000000000000..b66e7409038b --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.list_streams.js @@ -0,0 +1,80 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START visionai_v1alpha1_generated_StreamsService_ListStreams_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent value for ListStreamsRequest. + */ + // const parent = 'abc123' + /** + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + */ + // const pageSize = 1234 + /** + * A token identifying a page of results the server should return. + */ + // const pageToken = 'abc123' + /** + * Filtering results. + */ + // const filter = 'abc123' + /** + * Hint for how to order the results. + */ + // const orderBy = 'abc123' + + // Imports the Visionai library + const {StreamsServiceClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new StreamsServiceClient(); + + async function callListStreams() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = visionaiClient.listStreamsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListStreams(); + // [END visionai_v1alpha1_generated_StreamsService_ListStreams_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.materialize_channel.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.materialize_channel.js new file mode 100644 index 000000000000..d5cb79acf340 --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.materialize_channel.js @@ -0,0 +1,86 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, channelId, channel) { + // [START visionai_v1alpha1_generated_StreamsService_MaterializeChannel_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Value for parent. + */ + // const parent = 'abc123' + /** + * Required. Id of the channel. + */ + // const channelId = 'abc123' + /** + * Required. The resource being created. + */ + // const channel = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Visionai library + const {StreamsServiceClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new StreamsServiceClient(); + + async function callMaterializeChannel() { + // Construct request + const request = { + parent, + channelId, + channel, + }; + + // Run request + const [operation] = await visionaiClient.materializeChannel(request); + const [response] = await operation.promise(); + console.log(response); + } + + callMaterializeChannel(); + // [END visionai_v1alpha1_generated_StreamsService_MaterializeChannel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.update_cluster.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.update_cluster.js new file mode 100644 index 000000000000..e6853cbadb32 --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.update_cluster.js @@ -0,0 +1,85 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(updateMask, cluster) { + // [START visionai_v1alpha1_generated_StreamsService_UpdateCluster_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * Cluster resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + */ + // const updateMask = {} + /** + * Required. The resource being updated + */ + // const cluster = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Visionai library + const {StreamsServiceClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new StreamsServiceClient(); + + async function callUpdateCluster() { + // Construct request + const request = { + updateMask, + cluster, + }; + + // Run request + const [operation] = await visionaiClient.updateCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateCluster(); + // [END visionai_v1alpha1_generated_StreamsService_UpdateCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.update_event.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.update_event.js new file mode 100644 index 000000000000..aee99fa91cbb --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.update_event.js @@ -0,0 +1,85 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(updateMask, event) { + // [START visionai_v1alpha1_generated_StreamsService_UpdateEvent_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * Event resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + */ + // const updateMask = {} + /** + * Required. The resource being updated. + */ + // const event = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Visionai library + const {StreamsServiceClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new StreamsServiceClient(); + + async function callUpdateEvent() { + // Construct request + const request = { + updateMask, + event, + }; + + // Run request + const [operation] = await visionaiClient.updateEvent(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateEvent(); + // [END visionai_v1alpha1_generated_StreamsService_UpdateEvent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.update_series.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.update_series.js new file mode 100644 index 000000000000..e7e61107569e --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.update_series.js @@ -0,0 +1,85 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(updateMask, series) { + // [START visionai_v1alpha1_generated_StreamsService_UpdateSeries_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Field mask is used to specify the fields to be overwritten in the Series + * resource by the update. The fields specified in the update_mask are + * relative to the resource, not the full request. A field will be overwritten + * if it is in the mask. If the user does not provide a mask then all fields + * will be overwritten. + */ + // const updateMask = {} + /** + * Required. The resource being updated + */ + // const series = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Visionai library + const {StreamsServiceClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new StreamsServiceClient(); + + async function callUpdateSeries() { + // Construct request + const request = { + updateMask, + series, + }; + + // Run request + const [operation] = await visionaiClient.updateSeries(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateSeries(); + // [END visionai_v1alpha1_generated_StreamsService_UpdateSeries_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.update_stream.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.update_stream.js new file mode 100644 index 000000000000..248ac1e444a8 --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/streams_service.update_stream.js @@ -0,0 +1,85 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(updateMask, stream) { + // [START visionai_v1alpha1_generated_StreamsService_UpdateStream_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * Stream resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + */ + // const updateMask = {} + /** + * Required. The resource being updated. + */ + // const stream = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Visionai library + const {StreamsServiceClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new StreamsServiceClient(); + + async function callUpdateStream() { + // Construct request + const request = { + updateMask, + stream, + }; + + // Run request + const [operation] = await visionaiClient.updateStream(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateStream(); + // [END visionai_v1alpha1_generated_StreamsService_UpdateStream_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.clip_asset.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.clip_asset.js new file mode 100644 index 000000000000..2231bbdc5004 --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.clip_asset.js @@ -0,0 +1,68 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name, temporalPartition) { + // [START visionai_v1alpha1_generated_Warehouse_ClipAsset_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the asset to request clips for. + * Form: + * 'projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}' + */ + // const name = 'abc123' + /** + * Required. The time range to request clips for. + */ + // const temporalPartition = {} + + // Imports the Visionai library + const {WarehouseClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new WarehouseClient(); + + async function callClipAsset() { + // Construct request + const request = { + name, + temporalPartition, + }; + + // Run request + const response = await visionaiClient.clipAsset(request); + console.log(response); + } + + callClipAsset(); + // [END visionai_v1alpha1_generated_Warehouse_ClipAsset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.create_annotation.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.create_annotation.js new file mode 100644 index 000000000000..fb1d3e16a54f --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.create_annotation.js @@ -0,0 +1,76 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, annotation) { + // [START visionai_v1alpha1_generated_Warehouse_CreateAnnotation_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource where this annotation will be created. + * Format: projects/* /locations/* /corpora/* /assets/* + */ + // const parent = 'abc123' + /** + * Required. The annotation to create. + */ + // const annotation = {} + /** + * Optional. The ID to use for the annotation, which will become the final component of + * the annotation's resource name if user choose to specify. Otherwise, + * annotation id will be generated by system. + * This value should be up to 63 characters, and valid characters + * are /[a-z][0-9]-/. The first character must be a letter, the last could be + * a letter or a number. + */ + // const annotationId = 'abc123' + + // Imports the Visionai library + const {WarehouseClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new WarehouseClient(); + + async function callCreateAnnotation() { + // Construct request + const request = { + parent, + annotation, + }; + + // Run request + const response = await visionaiClient.createAnnotation(request); + console.log(response); + } + + callCreateAnnotation(); + // [END visionai_v1alpha1_generated_Warehouse_CreateAnnotation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.create_asset.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.create_asset.js new file mode 100644 index 000000000000..bf4acde97242 --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.create_asset.js @@ -0,0 +1,76 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, asset) { + // [START visionai_v1alpha1_generated_Warehouse_CreateAsset_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource where this asset will be created. + * Format: projects/* /locations/* /corpora/* + */ + // const parent = 'abc123' + /** + * Required. The asset to create. + */ + // const asset = {} + /** + * Optional. The ID to use for the asset, which will become the final component of + * the asset's resource name if user choose to specify. Otherwise, asset id + * will be generated by system. + * This value should be up to 63 characters, and valid characters + * are /[a-z][0-9]-/. The first character must be a letter, the last could be + * a letter or a number. + */ + // const assetId = 'abc123' + + // Imports the Visionai library + const {WarehouseClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new WarehouseClient(); + + async function callCreateAsset() { + // Construct request + const request = { + parent, + asset, + }; + + // Run request + const response = await visionaiClient.createAsset(request); + console.log(response); + } + + callCreateAsset(); + // [END visionai_v1alpha1_generated_Warehouse_CreateAsset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.create_corpus.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.create_corpus.js new file mode 100644 index 000000000000..c9c27292bcdd --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.create_corpus.js @@ -0,0 +1,67 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, corpus) { + // [START visionai_v1alpha1_generated_Warehouse_CreateCorpus_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Form: `projects/{project_number}/locations/{location_id}` + */ + // const parent = 'abc123' + /** + * Required. The corpus to be created. + */ + // const corpus = {} + + // Imports the Visionai library + const {WarehouseClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new WarehouseClient(); + + async function callCreateCorpus() { + // Construct request + const request = { + parent, + corpus, + }; + + // Run request + const [operation] = await visionaiClient.createCorpus(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateCorpus(); + // [END visionai_v1alpha1_generated_Warehouse_CreateCorpus_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.create_data_schema.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.create_data_schema.js new file mode 100644 index 000000000000..9cceaaa8a518 --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.create_data_schema.js @@ -0,0 +1,67 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, dataSchema) { + // [START visionai_v1alpha1_generated_Warehouse_CreateDataSchema_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource where this data schema will be created. + * Format: projects/* /locations/* /corpora/* + */ + // const parent = 'abc123' + /** + * Required. The data schema to create. + */ + // const dataSchema = {} + + // Imports the Visionai library + const {WarehouseClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new WarehouseClient(); + + async function callCreateDataSchema() { + // Construct request + const request = { + parent, + dataSchema, + }; + + // Run request + const response = await visionaiClient.createDataSchema(request); + console.log(response); + } + + callCreateDataSchema(); + // [END visionai_v1alpha1_generated_Warehouse_CreateDataSchema_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.create_search_config.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.create_search_config.js new file mode 100644 index 000000000000..cde0fe268885 --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.create_search_config.js @@ -0,0 +1,75 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, searchConfig, searchConfigId) { + // [START visionai_v1alpha1_generated_Warehouse_CreateSearchConfig_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource where this search configuration will be created. + * Format: projects/* /locations/* /corpora/* + */ + // const parent = 'abc123' + /** + * Required. The search config to create. + */ + // const searchConfig = {} + /** + * Required. ID to use for the new search config. Will become the final component of the + * SearchConfig's resource name. This value should be up to 63 characters, and + * valid characters are /[a-z][0-9]-_/. The first character must be a letter, + * the last could be a letter or a number. + */ + // const searchConfigId = 'abc123' + + // Imports the Visionai library + const {WarehouseClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new WarehouseClient(); + + async function callCreateSearchConfig() { + // Construct request + const request = { + parent, + searchConfig, + searchConfigId, + }; + + // Run request + const response = await visionaiClient.createSearchConfig(request); + console.log(response); + } + + callCreateSearchConfig(); + // [END visionai_v1alpha1_generated_Warehouse_CreateSearchConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.delete_annotation.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.delete_annotation.js new file mode 100644 index 000000000000..cd4c4f2073e7 --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.delete_annotation.js @@ -0,0 +1,63 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START visionai_v1alpha1_generated_Warehouse_DeleteAnnotation_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the annotation to delete. + * Format: + * projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation} + */ + // const name = 'abc123' + + // Imports the Visionai library + const {WarehouseClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new WarehouseClient(); + + async function callDeleteAnnotation() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await visionaiClient.deleteAnnotation(request); + console.log(response); + } + + callDeleteAnnotation(); + // [END visionai_v1alpha1_generated_Warehouse_DeleteAnnotation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.delete_asset.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.delete_asset.js new file mode 100644 index 000000000000..7e5e5c036ede --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.delete_asset.js @@ -0,0 +1,64 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START visionai_v1alpha1_generated_Warehouse_DeleteAsset_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the asset to delete. + * Format: + * projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset} + */ + // const name = 'abc123' + + // Imports the Visionai library + const {WarehouseClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new WarehouseClient(); + + async function callDeleteAsset() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await visionaiClient.deleteAsset(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteAsset(); + // [END visionai_v1alpha1_generated_Warehouse_DeleteAsset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.delete_corpus.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.delete_corpus.js new file mode 100644 index 000000000000..b13316f2c647 --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.delete_corpus.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START visionai_v1alpha1_generated_Warehouse_DeleteCorpus_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the corpus to delete. + */ + // const name = 'abc123' + + // Imports the Visionai library + const {WarehouseClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new WarehouseClient(); + + async function callDeleteCorpus() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await visionaiClient.deleteCorpus(request); + console.log(response); + } + + callDeleteCorpus(); + // [END visionai_v1alpha1_generated_Warehouse_DeleteCorpus_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.delete_data_schema.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.delete_data_schema.js new file mode 100644 index 000000000000..2596f967604b --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.delete_data_schema.js @@ -0,0 +1,63 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START visionai_v1alpha1_generated_Warehouse_DeleteDataSchema_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the data schema to delete. + * Format: + * projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/dataSchemas/{data_schema_id} + */ + // const name = 'abc123' + + // Imports the Visionai library + const {WarehouseClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new WarehouseClient(); + + async function callDeleteDataSchema() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await visionaiClient.deleteDataSchema(request); + console.log(response); + } + + callDeleteDataSchema(); + // [END visionai_v1alpha1_generated_Warehouse_DeleteDataSchema_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.delete_search_config.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.delete_search_config.js new file mode 100644 index 000000000000..6537071a1a15 --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.delete_search_config.js @@ -0,0 +1,63 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START visionai_v1alpha1_generated_Warehouse_DeleteSearchConfig_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the search configuration to delete. + * Format: + * projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config} + */ + // const name = 'abc123' + + // Imports the Visionai library + const {WarehouseClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new WarehouseClient(); + + async function callDeleteSearchConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await visionaiClient.deleteSearchConfig(request); + console.log(response); + } + + callDeleteSearchConfig(); + // [END visionai_v1alpha1_generated_Warehouse_DeleteSearchConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.generate_hls_uri.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.generate_hls_uri.js new file mode 100644 index 000000000000..b7c2a64129cd --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.generate_hls_uri.js @@ -0,0 +1,68 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name, temporalPartitions) { + // [START visionai_v1alpha1_generated_Warehouse_GenerateHlsUri_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the asset to request clips for. + * Form: + * 'projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}' + */ + // const name = 'abc123' + /** + * Required. The time range to request clips for. + */ + // const temporalPartitions = [1,2,3,4] + + // Imports the Visionai library + const {WarehouseClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new WarehouseClient(); + + async function callGenerateHlsUri() { + // Construct request + const request = { + name, + temporalPartitions, + }; + + // Run request + const response = await visionaiClient.generateHlsUri(request); + console.log(response); + } + + callGenerateHlsUri(); + // [END visionai_v1alpha1_generated_Warehouse_GenerateHlsUri_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.get_annotation.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.get_annotation.js new file mode 100644 index 000000000000..ea6eff69c606 --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.get_annotation.js @@ -0,0 +1,63 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START visionai_v1alpha1_generated_Warehouse_GetAnnotation_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the annotation to retrieve. + * Format: + * projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation} + */ + // const name = 'abc123' + + // Imports the Visionai library + const {WarehouseClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new WarehouseClient(); + + async function callGetAnnotation() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await visionaiClient.getAnnotation(request); + console.log(response); + } + + callGetAnnotation(); + // [END visionai_v1alpha1_generated_Warehouse_GetAnnotation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.get_asset.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.get_asset.js new file mode 100644 index 000000000000..944d596b6df3 --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.get_asset.js @@ -0,0 +1,63 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START visionai_v1alpha1_generated_Warehouse_GetAsset_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the asset to retrieve. + * Format: + * projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset} + */ + // const name = 'abc123' + + // Imports the Visionai library + const {WarehouseClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new WarehouseClient(); + + async function callGetAsset() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await visionaiClient.getAsset(request); + console.log(response); + } + + callGetAsset(); + // [END visionai_v1alpha1_generated_Warehouse_GetAsset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.get_corpus.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.get_corpus.js new file mode 100644 index 000000000000..22582a4d952f --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.get_corpus.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START visionai_v1alpha1_generated_Warehouse_GetCorpus_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the corpus to retrieve. + */ + // const name = 'abc123' + + // Imports the Visionai library + const {WarehouseClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new WarehouseClient(); + + async function callGetCorpus() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await visionaiClient.getCorpus(request); + console.log(response); + } + + callGetCorpus(); + // [END visionai_v1alpha1_generated_Warehouse_GetCorpus_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.get_data_schema.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.get_data_schema.js new file mode 100644 index 000000000000..1b26ceb392b6 --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.get_data_schema.js @@ -0,0 +1,63 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START visionai_v1alpha1_generated_Warehouse_GetDataSchema_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the data schema to retrieve. + * Format: + * projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/dataSchemas/{data_schema_id} + */ + // const name = 'abc123' + + // Imports the Visionai library + const {WarehouseClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new WarehouseClient(); + + async function callGetDataSchema() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await visionaiClient.getDataSchema(request); + console.log(response); + } + + callGetDataSchema(); + // [END visionai_v1alpha1_generated_Warehouse_GetDataSchema_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.get_search_config.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.get_search_config.js new file mode 100644 index 000000000000..2ed0449eba7a --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.get_search_config.js @@ -0,0 +1,63 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START visionai_v1alpha1_generated_Warehouse_GetSearchConfig_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the search configuration to retrieve. + * Format: + * projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config} + */ + // const name = 'abc123' + + // Imports the Visionai library + const {WarehouseClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new WarehouseClient(); + + async function callGetSearchConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await visionaiClient.getSearchConfig(request); + console.log(response); + } + + callGetSearchConfig(); + // [END visionai_v1alpha1_generated_Warehouse_GetSearchConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.ingest_asset.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.ingest_asset.js new file mode 100644 index 000000000000..9d5b26940b0f --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.ingest_asset.js @@ -0,0 +1,70 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START visionai_v1alpha1_generated_Warehouse_IngestAsset_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Provides information for the data and the asset resource name that the + * data belongs to. The first `IngestAssetRequest` message must only contain + * a `Config` message. + */ + // const config = {} + /** + * Data to be ingested. + */ + // const timeIndexedData = {} + + // Imports the Visionai library + const {WarehouseClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new WarehouseClient(); + + async function callIngestAsset() { + // Construct request + const request = { + }; + + // Run request + const stream = await visionaiClient.ingestAsset(); + stream.on('data', (response) => { console.log(response) }); + stream.on('error', (err) => { throw(err) }); + stream.on('end', () => { /* API call completed */ }); + stream.write(request); + stream.end(); + } + + callIngestAsset(); + // [END visionai_v1alpha1_generated_Warehouse_IngestAsset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.list_annotations.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.list_annotations.js new file mode 100644 index 000000000000..de1242b401a3 --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.list_annotations.js @@ -0,0 +1,90 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START visionai_v1alpha1_generated_Warehouse_ListAnnotations_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The parent, which owns this collection of annotations. + * Format: + * projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset} + */ + // const parent = 'abc123' + /** + * The maximum number of annotations to return. The service may return fewer + * than this value. If unspecified, at most 50 annotations will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListAnnotations` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListAnnotations` must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * The filter applied to the returned list. + * We only support filtering for the following fields: + * `partition.temporal_partition.start_time`, + * `partition.temporal_partition.end_time`, and `key`. + * Timestamps are specified in the RFC-3339 format, and only one restriction + * may be applied per field, joined by conjunctions. + * Format: + * "partition.temporal_partition.start_time > "2012-04-21T11:30:00-04:00" AND + * partition.temporal_partition.end_time < "2012-04-22T11:30:00-04:00" AND + * key = "example_key"" + */ + // const filter = 'abc123' + + // Imports the Visionai library + const {WarehouseClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new WarehouseClient(); + + async function callListAnnotations() { + // Construct request + const request = { + }; + + // Run request + const iterable = visionaiClient.listAnnotationsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListAnnotations(); + // [END visionai_v1alpha1_generated_Warehouse_ListAnnotations_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.list_assets.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.list_assets.js new file mode 100644 index 000000000000..dac63b2b7c01 --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.list_assets.js @@ -0,0 +1,79 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START visionai_v1alpha1_generated_Warehouse_ListAssets_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent, which owns this collection of assets. + * Format: + * projects/{project_number}/locations/{location}/corpora/{corpus} + */ + // const parent = 'abc123' + /** + * The maximum number of assets to return. The service may return fewer than + * this value. + * If unspecified, at most 50 assets will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListAssets` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListAssets` must match + * the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Visionai library + const {WarehouseClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new WarehouseClient(); + + async function callListAssets() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = visionaiClient.listAssetsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListAssets(); + // [END visionai_v1alpha1_generated_Warehouse_ListAssets_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.list_corpora.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.list_corpora.js new file mode 100644 index 000000000000..7ce84c6ff874 --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.list_corpora.js @@ -0,0 +1,77 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START visionai_v1alpha1_generated_Warehouse_ListCorpora_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the project from which to list corpora. + */ + // const parent = 'abc123' + /** + * Requested page size. API may return fewer results than requested. + * If negative, INVALID_ARGUMENT error will be returned. + * If unspecified or 0, API will pick a default size, which is 10. + * If the requested page size is larger than the maximum size, API will pick + * use the maximum size, which is 20. + */ + // const pageSize = 1234 + /** + * A token identifying a page of results for the server to return. + * Typically obtained via ListCorpora.next_page_token of the previous + * Warehouse.ListCorpora google.cloud.visionai.v1alpha1.Warehouse.ListCorpora call. + */ + // const pageToken = 'abc123' + + // Imports the Visionai library + const {WarehouseClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new WarehouseClient(); + + async function callListCorpora() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = visionaiClient.listCorporaAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListCorpora(); + // [END visionai_v1alpha1_generated_Warehouse_ListCorpora_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.list_data_schemas.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.list_data_schemas.js new file mode 100644 index 000000000000..3b84807e1f2a --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.list_data_schemas.js @@ -0,0 +1,78 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START visionai_v1alpha1_generated_Warehouse_ListDataSchemas_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent, which owns this collection of data schemas. + * Format: + * projects/{project_number}/locations/{location_id}/corpora/{corpus_id} + */ + // const parent = 'abc123' + /** + * The maximum number of data schemas to return. The service may return fewer + * than this value. If unspecified, at most 50 data schemas will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListDataSchemas` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListDataSchemas` must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Visionai library + const {WarehouseClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new WarehouseClient(); + + async function callListDataSchemas() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = visionaiClient.listDataSchemasAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListDataSchemas(); + // [END visionai_v1alpha1_generated_Warehouse_ListDataSchemas_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.list_search_configs.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.list_search_configs.js new file mode 100644 index 000000000000..144106bf7e24 --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.list_search_configs.js @@ -0,0 +1,79 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START visionai_v1alpha1_generated_Warehouse_ListSearchConfigs_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent, which owns this collection of search configurations. + * Format: + * projects/{project_number}/locations/{location}/corpora/{corpus} + */ + // const parent = 'abc123' + /** + * The maximum number of search configurations to return. The service may + * return fewer than this value. If unspecified, a page size of 50 will be + * used. The maximum value is 1000; values above 1000 will be coerced to 1000. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListSearchConfigs` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to + * `ListSearchConfigs` must match the call that provided the page + * token. + */ + // const pageToken = 'abc123' + + // Imports the Visionai library + const {WarehouseClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new WarehouseClient(); + + async function callListSearchConfigs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = visionaiClient.listSearchConfigsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListSearchConfigs(); + // [END visionai_v1alpha1_generated_Warehouse_ListSearchConfigs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.search_assets.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.search_assets.js new file mode 100644 index 000000000000..d718a33d006b --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.search_assets.js @@ -0,0 +1,99 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(corpus) { + // [START visionai_v1alpha1_generated_Warehouse_SearchAssets_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent corpus to search. + * Form: `projects/{project_id}/locations/{location_id}/corpora/{corpus_id}' + */ + // const corpus = 'abc123' + /** + * The number of results to be returned in this page. If it's 0, the server + * will decide the appropriate page_size. + */ + // const pageSize = 1234 + /** + * The continuation token to fetch the next page. If empty, it means it is + * fetching the first page. + */ + // const pageToken = 'abc123' + /** + * Time ranges that matching video content must fall within. If no ranges are + * provided, there will be no time restriction. This field is treated just + * like the criteria below, but defined separately for convenience as it is + * used frequently. Note that if the end_time is in the future, it will be + * clamped to the time the request was received. + */ + // const contentTimeRanges = {} + /** + * Criteria applied to search results. + */ + // const criteria = [1,2,3,4] + /** + * Stores most recent facet selection state. Only facet groups with user's + * selection will be presented here. Selection state is either selected or + * unselected. Only selected facet buckets will be used as search criteria. + */ + // const facetSelections = [1,2,3,4] + /** + * A list of annotation keys to specify the annotations to be retrieved and + * returned with each search result. + * Annotation granularity must be GRANULARITY_ASSET_LEVEL and its search + * strategy must not be NO_SEARCH. + */ + // const resultAnnotationKeys = ['abc','def'] + + // Imports the Visionai library + const {WarehouseClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new WarehouseClient(); + + async function callSearchAssets() { + // Construct request + const request = { + corpus, + }; + + // Run request + const iterable = visionaiClient.searchAssetsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callSearchAssets(); + // [END visionai_v1alpha1_generated_Warehouse_SearchAssets_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.update_annotation.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.update_annotation.js new file mode 100644 index 000000000000..026ac2ca9b4e --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.update_annotation.js @@ -0,0 +1,68 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(annotation) { + // [START visionai_v1alpha1_generated_Warehouse_UpdateAnnotation_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The annotation to update. + * The annotation's `name` field is used to identify the annotation to be + * updated. Format: + * projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation} + */ + // const annotation = {} + /** + * The list of fields to be updated. + */ + // const updateMask = {} + + // Imports the Visionai library + const {WarehouseClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new WarehouseClient(); + + async function callUpdateAnnotation() { + // Construct request + const request = { + annotation, + }; + + // Run request + const response = await visionaiClient.updateAnnotation(request); + console.log(response); + } + + callUpdateAnnotation(); + // [END visionai_v1alpha1_generated_Warehouse_UpdateAnnotation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.update_asset.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.update_asset.js new file mode 100644 index 000000000000..fb72c6801478 --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.update_asset.js @@ -0,0 +1,68 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(asset) { + // [START visionai_v1alpha1_generated_Warehouse_UpdateAsset_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The asset to update. + * The asset's `name` field is used to identify the asset to be updated. + * Format: + * projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset} + */ + // const asset = {} + /** + * The list of fields to be updated. + */ + // const updateMask = {} + + // Imports the Visionai library + const {WarehouseClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new WarehouseClient(); + + async function callUpdateAsset() { + // Construct request + const request = { + asset, + }; + + // Run request + const response = await visionaiClient.updateAsset(request); + console.log(response); + } + + callUpdateAsset(); + // [END visionai_v1alpha1_generated_Warehouse_UpdateAsset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.update_corpus.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.update_corpus.js new file mode 100644 index 000000000000..7cc67445dc9f --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.update_corpus.js @@ -0,0 +1,65 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(corpus) { + // [START visionai_v1alpha1_generated_Warehouse_UpdateCorpus_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The corpus which replaces the resource on the server. + */ + // const corpus = {} + /** + * The list of fields to be updated. + */ + // const updateMask = {} + + // Imports the Visionai library + const {WarehouseClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new WarehouseClient(); + + async function callUpdateCorpus() { + // Construct request + const request = { + corpus, + }; + + // Run request + const response = await visionaiClient.updateCorpus(request); + console.log(response); + } + + callUpdateCorpus(); + // [END visionai_v1alpha1_generated_Warehouse_UpdateCorpus_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.update_data_schema.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.update_data_schema.js new file mode 100644 index 000000000000..2705f474c07a --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.update_data_schema.js @@ -0,0 +1,67 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(dataSchema) { + // [START visionai_v1alpha1_generated_Warehouse_UpdateDataSchema_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The data schema's `name` field is used to identify the data schema to be + * updated. Format: + * projects/{project_number}/locations/{location}/corpora/{corpus}/dataSchemas/{data_schema} + */ + // const dataSchema = {} + /** + * The list of fields to be updated. + */ + // const updateMask = {} + + // Imports the Visionai library + const {WarehouseClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new WarehouseClient(); + + async function callUpdateDataSchema() { + // Construct request + const request = { + dataSchema, + }; + + // Run request + const response = await visionaiClient.updateDataSchema(request); + console.log(response); + } + + callUpdateDataSchema(); + // [END visionai_v1alpha1_generated_Warehouse_UpdateDataSchema_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.update_search_config.js b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.update_search_config.js new file mode 100644 index 000000000000..1e0baac9ff1d --- /dev/null +++ b/packages/google-cloud-visionai/samples/generated/v1alpha1/warehouse.update_search_config.js @@ -0,0 +1,69 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(searchConfig) { + // [START visionai_v1alpha1_generated_Warehouse_UpdateSearchConfig_async] + /** + * This snippet 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. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The search configuration to update. + * The search configuration's `name` field is used to identify the resource to + * be updated. Format: + * projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config} + */ + // const searchConfig = {} + /** + * The list of fields to be updated. If left unset, all field paths will be + * updated/overwritten. + */ + // const updateMask = {} + + // Imports the Visionai library + const {WarehouseClient} = require('@google-cloud/visionai').v1alpha1; + + // Instantiates a client + const visionaiClient = new WarehouseClient(); + + async function callUpdateSearchConfig() { + // Construct request + const request = { + searchConfig, + }; + + // Run request + const response = await visionaiClient.updateSearchConfig(request); + console.log(response); + } + + callUpdateSearchConfig(); + // [END visionai_v1alpha1_generated_Warehouse_UpdateSearchConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-visionai/src/index.ts b/packages/google-cloud-visionai/src/index.ts index 16ed458ea2e9..8db11950eaf8 100644 --- a/packages/google-cloud-visionai/src/index.ts +++ b/packages/google-cloud-visionai/src/index.ts @@ -17,6 +17,7 @@ // ** All changes to this file may be overwritten. ** import * as v1 from './v1'; +import * as v1alpha1 from './v1alpha1'; const AppPlatformClient = v1.AppPlatformClient; type AppPlatformClient = v1.AppPlatformClient; @@ -31,7 +32,7 @@ type StreamsServiceClient = v1.StreamsServiceClient; const WarehouseClient = v1.WarehouseClient; type WarehouseClient = v1.WarehouseClient; -export {v1, AppPlatformClient, HealthCheckServiceClient, LiveVideoAnalyticsClient, StreamingServiceClient, StreamsServiceClient, WarehouseClient}; -export default {v1, AppPlatformClient, HealthCheckServiceClient, LiveVideoAnalyticsClient, StreamingServiceClient, StreamsServiceClient, WarehouseClient}; +export {v1, v1alpha1, AppPlatformClient, HealthCheckServiceClient, LiveVideoAnalyticsClient, StreamingServiceClient, StreamsServiceClient, WarehouseClient}; +export default {v1, v1alpha1, AppPlatformClient, HealthCheckServiceClient, LiveVideoAnalyticsClient, StreamingServiceClient, StreamsServiceClient, WarehouseClient}; import * as protos from '../protos/protos'; export {protos}; diff --git a/packages/google-cloud-visionai/src/v1alpha1/app_platform_client.ts b/packages/google-cloud-visionai/src/v1alpha1/app_platform_client.ts new file mode 100644 index 000000000000..4adab6f098c5 --- /dev/null +++ b/packages/google-cloud-visionai/src/v1alpha1/app_platform_client.ts @@ -0,0 +1,7165 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + GrpcClientOptions, + LROperation, + PaginationCallback, + GaxCall, + IamClient, + IamProtos, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import { Transform } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1alpha1/app_platform_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './app_platform_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service describing handlers for resources + * @class + * @memberof v1alpha1 + */ +export class AppPlatformClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: { [method: string]: gax.CallSettings }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('visionai'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + iamClient: IamClient; + locationsClient: LocationsClient; + pathTemplates: { [name: string]: gax.PathTemplate }; + operationsClient: gax.OperationsClient; + appPlatformStub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of AppPlatformClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new AppPlatformClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof AppPlatformClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'visionai.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts, + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + analysisPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}/analyses/{analysis}', + ), + annotationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation}', + ), + applicationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/applications/{application}', + ), + assetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}', + ), + channelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}/channels/{channel}', + ), + clusterPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}', + ), + corpusPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project_number}/locations/{location}/corpora/{corpus}', + ), + dataSchemaPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project_number}/locations/{location}/corpora/{corpus}/dataSchemas/{data_schema}', + ), + draftPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/applications/{application}/drafts/{draft}', + ), + eventPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}/events/{event}', + ), + instancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/applications/{application}/instances/{instance}', + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}', + ), + processorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/processors/{processor}', + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}', + ), + searchConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config}', + ), + seriesPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}/series/{series}', + ), + streamPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}/streams/{stream}', + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listApplications: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'applications', + ), + listInstances: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'instances', + ), + listDrafts: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'drafts', + ), + listProcessors: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'processors', + ), + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/v1alpha1/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v1alpha1/{name=projects/*}/locations', + }, + { + selector: 'google.iam.v1.IAMPolicy.GetIamPolicy', + get: '/v1alpha1/{resource=projects/*/locations/*/clusters/*}:getIamPolicy', + additional_bindings: [ + { + get: '/v1alpha1/{resource=projects/*/locations/*/clusters/*/streams/*}:getIamPolicy', + }, + { + get: '/v1alpha1/{resource=projects/*/locations/*/clusters/*/events/*}:getIamPolicy', + }, + { + get: '/v1alpha1/{resource=projects/*/locations/*/clusters/*/series/*}:getIamPolicy', + }, + { + get: '/v1alpha1/{resource=projects/*/locations/*/operators/*}:getIamPolicy', + }, + { + get: '/v1alpha1/{resource=projects/*/locations/*/operators/*/versions/*}:getIamPolicy', + }, + { + get: '/v1alpha1/{resource=projects/*/locations/*/clusters/*/analyses/*}:getIamPolicy', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.SetIamPolicy', + post: '/v1alpha1/{resource=projects/*/locations/*/clusters/*}:setIamPolicy', + body: '*', + additional_bindings: [ + { + post: '/v1alpha1/{resource=projects/*/locations/*/clusters/*/streams/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1alpha1/{resource=projects/*/locations/*/clusters/*/events/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1alpha1/{resource=projects/*/locations/*/clusters/*/series/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1alpha1/{resource=projects/*/locations/*/operators/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1alpha1/{resource=projects/*/locations/*/operators/*/versions/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1alpha1/{resource=projects/*/locations/*/clusters/*/analyses/*}:setIamPolicy', + body: '*', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.TestIamPermissions', + post: '/v1alpha1/{resource=projects/*/locations/*/clusters/*}:testIamPermissions', + body: '*', + additional_bindings: [ + { + post: '/v1alpha1/{resource=projects/*/locations/*/clusters/*/streams/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1alpha1/{resource=projects/*/locations/*/clusters/*/events/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1alpha1/{resource=projects/*/locations/*/clusters/*/series/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1alpha1/{resource=projects/*/locations/*/operators/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1alpha1/{resource=projects/*/locations/*/operators/*/versions/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1alpha1/{resource=projects/*/locations/*/clusters/*/analyses/*}:testIamPermissions', + body: '*', + }, + ], + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1alpha1/{name=projects/*/locations/*/operations/*}:cancel', + body: '*', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1alpha1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1alpha1/{name=projects/*/locations/*/operations/*}', + additional_bindings: [ + { + get: '/v1alpha1/{name=projects/*/locations/*/warehouseOperations/*}', + }, + { + get: '/v1alpha1/{name=projects/*/locations/*/corpora/*/assets/*/operations/*}', + }, + ], + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1alpha1/{name=projects/*/locations/*}/operations', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const createApplicationResponse = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.Application', + ) as gax.protobuf.Type; + const createApplicationMetadata = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.OperationMetadata', + ) as gax.protobuf.Type; + const updateApplicationResponse = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.Application', + ) as gax.protobuf.Type; + const updateApplicationMetadata = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.OperationMetadata', + ) as gax.protobuf.Type; + const deleteApplicationResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty', + ) as gax.protobuf.Type; + const deleteApplicationMetadata = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.OperationMetadata', + ) as gax.protobuf.Type; + const deployApplicationResponse = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.DeployApplicationResponse', + ) as gax.protobuf.Type; + const deployApplicationMetadata = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.OperationMetadata', + ) as gax.protobuf.Type; + const undeployApplicationResponse = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.UndeployApplicationResponse', + ) as gax.protobuf.Type; + const undeployApplicationMetadata = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.OperationMetadata', + ) as gax.protobuf.Type; + const addApplicationStreamInputResponse = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.AddApplicationStreamInputResponse', + ) as gax.protobuf.Type; + const addApplicationStreamInputMetadata = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.OperationMetadata', + ) as gax.protobuf.Type; + const removeApplicationStreamInputResponse = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputResponse', + ) as gax.protobuf.Type; + const removeApplicationStreamInputMetadata = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.OperationMetadata', + ) as gax.protobuf.Type; + const updateApplicationStreamInputResponse = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputResponse', + ) as gax.protobuf.Type; + const updateApplicationStreamInputMetadata = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.OperationMetadata', + ) as gax.protobuf.Type; + const createApplicationInstancesResponse = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.CreateApplicationInstancesResponse', + ) as gax.protobuf.Type; + const createApplicationInstancesMetadata = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.OperationMetadata', + ) as gax.protobuf.Type; + const deleteApplicationInstancesResponse = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.Instance', + ) as gax.protobuf.Type; + const deleteApplicationInstancesMetadata = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.OperationMetadata', + ) as gax.protobuf.Type; + const updateApplicationInstancesResponse = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.UpdateApplicationInstancesResponse', + ) as gax.protobuf.Type; + const updateApplicationInstancesMetadata = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.OperationMetadata', + ) as gax.protobuf.Type; + const createDraftResponse = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.Draft', + ) as gax.protobuf.Type; + const createDraftMetadata = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.OperationMetadata', + ) as gax.protobuf.Type; + const updateDraftResponse = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.Draft', + ) as gax.protobuf.Type; + const updateDraftMetadata = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.OperationMetadata', + ) as gax.protobuf.Type; + const deleteDraftResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty', + ) as gax.protobuf.Type; + const deleteDraftMetadata = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.OperationMetadata', + ) as gax.protobuf.Type; + const createProcessorResponse = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.Processor', + ) as gax.protobuf.Type; + const createProcessorMetadata = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.OperationMetadata', + ) as gax.protobuf.Type; + const updateProcessorResponse = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.Processor', + ) as gax.protobuf.Type; + const updateProcessorMetadata = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.OperationMetadata', + ) as gax.protobuf.Type; + const deleteProcessorResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty', + ) as gax.protobuf.Type; + const deleteProcessorMetadata = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.OperationMetadata', + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createApplication: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createApplicationResponse.decode.bind(createApplicationResponse), + createApplicationMetadata.decode.bind(createApplicationMetadata), + ), + updateApplication: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateApplicationResponse.decode.bind(updateApplicationResponse), + updateApplicationMetadata.decode.bind(updateApplicationMetadata), + ), + deleteApplication: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteApplicationResponse.decode.bind(deleteApplicationResponse), + deleteApplicationMetadata.decode.bind(deleteApplicationMetadata), + ), + deployApplication: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deployApplicationResponse.decode.bind(deployApplicationResponse), + deployApplicationMetadata.decode.bind(deployApplicationMetadata), + ), + undeployApplication: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + undeployApplicationResponse.decode.bind(undeployApplicationResponse), + undeployApplicationMetadata.decode.bind(undeployApplicationMetadata), + ), + addApplicationStreamInput: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + addApplicationStreamInputResponse.decode.bind( + addApplicationStreamInputResponse, + ), + addApplicationStreamInputMetadata.decode.bind( + addApplicationStreamInputMetadata, + ), + ), + removeApplicationStreamInput: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + removeApplicationStreamInputResponse.decode.bind( + removeApplicationStreamInputResponse, + ), + removeApplicationStreamInputMetadata.decode.bind( + removeApplicationStreamInputMetadata, + ), + ), + updateApplicationStreamInput: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateApplicationStreamInputResponse.decode.bind( + updateApplicationStreamInputResponse, + ), + updateApplicationStreamInputMetadata.decode.bind( + updateApplicationStreamInputMetadata, + ), + ), + createApplicationInstances: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createApplicationInstancesResponse.decode.bind( + createApplicationInstancesResponse, + ), + createApplicationInstancesMetadata.decode.bind( + createApplicationInstancesMetadata, + ), + ), + deleteApplicationInstances: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteApplicationInstancesResponse.decode.bind( + deleteApplicationInstancesResponse, + ), + deleteApplicationInstancesMetadata.decode.bind( + deleteApplicationInstancesMetadata, + ), + ), + updateApplicationInstances: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateApplicationInstancesResponse.decode.bind( + updateApplicationInstancesResponse, + ), + updateApplicationInstancesMetadata.decode.bind( + updateApplicationInstancesMetadata, + ), + ), + createDraft: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createDraftResponse.decode.bind(createDraftResponse), + createDraftMetadata.decode.bind(createDraftMetadata), + ), + updateDraft: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateDraftResponse.decode.bind(updateDraftResponse), + updateDraftMetadata.decode.bind(updateDraftMetadata), + ), + deleteDraft: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteDraftResponse.decode.bind(deleteDraftResponse), + deleteDraftMetadata.decode.bind(deleteDraftMetadata), + ), + createProcessor: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createProcessorResponse.decode.bind(createProcessorResponse), + createProcessorMetadata.decode.bind(createProcessorMetadata), + ), + updateProcessor: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateProcessorResponse.decode.bind(updateProcessorResponse), + updateProcessorMetadata.decode.bind(updateProcessorMetadata), + ), + deleteProcessor: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteProcessorResponse.decode.bind(deleteProcessorResponse), + deleteProcessorMetadata.decode.bind(deleteProcessorMetadata), + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.visionai.v1alpha1.AppPlatform', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + { 'x-goog-api-client': clientHeader.join(' ') }, + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.appPlatformStub) { + return this.appPlatformStub; + } + + // Put together the "service stub" for + // google.cloud.visionai.v1alpha1.AppPlatform. + this.appPlatformStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.visionai.v1alpha1.AppPlatform', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.visionai.v1alpha1.AppPlatform, + this._opts, + this._providedCustomServicePath, + ) as Promise<{ [method: string]: Function }>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const appPlatformStubMethods = [ + 'listApplications', + 'getApplication', + 'createApplication', + 'updateApplication', + 'deleteApplication', + 'deployApplication', + 'undeployApplication', + 'addApplicationStreamInput', + 'removeApplicationStreamInput', + 'updateApplicationStreamInput', + 'listInstances', + 'getInstance', + 'createApplicationInstances', + 'deleteApplicationInstances', + 'updateApplicationInstances', + 'listDrafts', + 'getDraft', + 'createDraft', + 'updateDraft', + 'deleteDraft', + 'listProcessors', + 'listPrebuiltProcessors', + 'getProcessor', + 'createProcessor', + 'updateProcessor', + 'deleteProcessor', + ]; + for (const methodName of appPlatformStubMethods) { + const callPromise = this.appPlatformStub.then( + (stub) => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + }, + ); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback, + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.appPlatformStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'visionai.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'visionai.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return ['https://www.googleapis.com/auth/cloud-platform']; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback, + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /** + * Gets details of a single Application. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.visionai.v1alpha1.Application|Application}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/app_platform.get_application.js + * region_tag:visionai_v1alpha1_generated_AppPlatform_GetApplication_async + */ + getApplication( + request?: protos.google.cloud.visionai.v1alpha1.IGetApplicationRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IApplication, + protos.google.cloud.visionai.v1alpha1.IGetApplicationRequest | undefined, + {} | undefined, + ] + >; + getApplication( + request: protos.google.cloud.visionai.v1alpha1.IGetApplicationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.IApplication, + | protos.google.cloud.visionai.v1alpha1.IGetApplicationRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getApplication( + request: protos.google.cloud.visionai.v1alpha1.IGetApplicationRequest, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.IApplication, + | protos.google.cloud.visionai.v1alpha1.IGetApplicationRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getApplication( + request?: protos.google.cloud.visionai.v1alpha1.IGetApplicationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.visionai.v1alpha1.IApplication, + | protos.google.cloud.visionai.v1alpha1.IGetApplicationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.visionai.v1alpha1.IApplication, + | protos.google.cloud.visionai.v1alpha1.IGetApplicationRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IApplication, + protos.google.cloud.visionai.v1alpha1.IGetApplicationRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('getApplication request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.visionai.v1alpha1.IApplication, + | protos.google.cloud.visionai.v1alpha1.IGetApplicationRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getApplication response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getApplication(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.visionai.v1alpha1.IApplication, + ( + | protos.google.cloud.visionai.v1alpha1.IGetApplicationRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getApplication response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Gets details of a single Instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.visionai.v1alpha1.Instance|Instance}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/app_platform.get_instance.js + * region_tag:visionai_v1alpha1_generated_AppPlatform_GetInstance_async + */ + getInstance( + request?: protos.google.cloud.visionai.v1alpha1.IGetInstanceRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IInstance, + protos.google.cloud.visionai.v1alpha1.IGetInstanceRequest | undefined, + {} | undefined, + ] + >; + getInstance( + request: protos.google.cloud.visionai.v1alpha1.IGetInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.IInstance, + | protos.google.cloud.visionai.v1alpha1.IGetInstanceRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getInstance( + request: protos.google.cloud.visionai.v1alpha1.IGetInstanceRequest, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.IInstance, + | protos.google.cloud.visionai.v1alpha1.IGetInstanceRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getInstance( + request?: protos.google.cloud.visionai.v1alpha1.IGetInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.visionai.v1alpha1.IInstance, + | protos.google.cloud.visionai.v1alpha1.IGetInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.visionai.v1alpha1.IInstance, + | protos.google.cloud.visionai.v1alpha1.IGetInstanceRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IInstance, + protos.google.cloud.visionai.v1alpha1.IGetInstanceRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('getInstance request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.visionai.v1alpha1.IInstance, + | protos.google.cloud.visionai.v1alpha1.IGetInstanceRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getInstance response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getInstance(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.visionai.v1alpha1.IInstance, + protos.google.cloud.visionai.v1alpha1.IGetInstanceRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getInstance response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Gets details of a single Draft. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.visionai.v1alpha1.Draft|Draft}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/app_platform.get_draft.js + * region_tag:visionai_v1alpha1_generated_AppPlatform_GetDraft_async + */ + getDraft( + request?: protos.google.cloud.visionai.v1alpha1.IGetDraftRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IDraft, + protos.google.cloud.visionai.v1alpha1.IGetDraftRequest | undefined, + {} | undefined, + ] + >; + getDraft( + request: protos.google.cloud.visionai.v1alpha1.IGetDraftRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.IDraft, + protos.google.cloud.visionai.v1alpha1.IGetDraftRequest | null | undefined, + {} | null | undefined + >, + ): void; + getDraft( + request: protos.google.cloud.visionai.v1alpha1.IGetDraftRequest, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.IDraft, + protos.google.cloud.visionai.v1alpha1.IGetDraftRequest | null | undefined, + {} | null | undefined + >, + ): void; + getDraft( + request?: protos.google.cloud.visionai.v1alpha1.IGetDraftRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.visionai.v1alpha1.IDraft, + | protos.google.cloud.visionai.v1alpha1.IGetDraftRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.visionai.v1alpha1.IDraft, + protos.google.cloud.visionai.v1alpha1.IGetDraftRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IDraft, + protos.google.cloud.visionai.v1alpha1.IGetDraftRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('getDraft request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.visionai.v1alpha1.IDraft, + | protos.google.cloud.visionai.v1alpha1.IGetDraftRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getDraft response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getDraft(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.visionai.v1alpha1.IDraft, + protos.google.cloud.visionai.v1alpha1.IGetDraftRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getDraft response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * ListPrebuiltProcessors is a custom pass-through verb that Lists Prebuilt + * Processors. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent path. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsResponse|ListPrebuiltProcessorsResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/app_platform.list_prebuilt_processors.js + * region_tag:visionai_v1alpha1_generated_AppPlatform_ListPrebuiltProcessors_async + */ + listPrebuiltProcessors( + request?: protos.google.cloud.visionai.v1alpha1.IListPrebuiltProcessorsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IListPrebuiltProcessorsResponse, + ( + | protos.google.cloud.visionai.v1alpha1.IListPrebuiltProcessorsRequest + | undefined + ), + {} | undefined, + ] + >; + listPrebuiltProcessors( + request: protos.google.cloud.visionai.v1alpha1.IListPrebuiltProcessorsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.IListPrebuiltProcessorsResponse, + | protos.google.cloud.visionai.v1alpha1.IListPrebuiltProcessorsRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + listPrebuiltProcessors( + request: protos.google.cloud.visionai.v1alpha1.IListPrebuiltProcessorsRequest, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.IListPrebuiltProcessorsResponse, + | protos.google.cloud.visionai.v1alpha1.IListPrebuiltProcessorsRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + listPrebuiltProcessors( + request?: protos.google.cloud.visionai.v1alpha1.IListPrebuiltProcessorsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.visionai.v1alpha1.IListPrebuiltProcessorsResponse, + | protos.google.cloud.visionai.v1alpha1.IListPrebuiltProcessorsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.visionai.v1alpha1.IListPrebuiltProcessorsResponse, + | protos.google.cloud.visionai.v1alpha1.IListPrebuiltProcessorsRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IListPrebuiltProcessorsResponse, + ( + | protos.google.cloud.visionai.v1alpha1.IListPrebuiltProcessorsRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listPrebuiltProcessors request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.visionai.v1alpha1.IListPrebuiltProcessorsResponse, + | protos.google.cloud.visionai.v1alpha1.IListPrebuiltProcessorsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('listPrebuiltProcessors response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .listPrebuiltProcessors(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.visionai.v1alpha1.IListPrebuiltProcessorsResponse, + ( + | protos.google.cloud.visionai.v1alpha1.IListPrebuiltProcessorsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('listPrebuiltProcessors response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Gets details of a single Processor. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.visionai.v1alpha1.Processor|Processor}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/app_platform.get_processor.js + * region_tag:visionai_v1alpha1_generated_AppPlatform_GetProcessor_async + */ + getProcessor( + request?: protos.google.cloud.visionai.v1alpha1.IGetProcessorRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IProcessor, + protos.google.cloud.visionai.v1alpha1.IGetProcessorRequest | undefined, + {} | undefined, + ] + >; + getProcessor( + request: protos.google.cloud.visionai.v1alpha1.IGetProcessorRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.IProcessor, + | protos.google.cloud.visionai.v1alpha1.IGetProcessorRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getProcessor( + request: protos.google.cloud.visionai.v1alpha1.IGetProcessorRequest, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.IProcessor, + | protos.google.cloud.visionai.v1alpha1.IGetProcessorRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getProcessor( + request?: protos.google.cloud.visionai.v1alpha1.IGetProcessorRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.visionai.v1alpha1.IProcessor, + | protos.google.cloud.visionai.v1alpha1.IGetProcessorRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.visionai.v1alpha1.IProcessor, + | protos.google.cloud.visionai.v1alpha1.IGetProcessorRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IProcessor, + protos.google.cloud.visionai.v1alpha1.IGetProcessorRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('getProcessor request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.visionai.v1alpha1.IProcessor, + | protos.google.cloud.visionai.v1alpha1.IGetProcessorRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getProcessor response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getProcessor(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.visionai.v1alpha1.IProcessor, + ( + | protos.google.cloud.visionai.v1alpha1.IGetProcessorRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getProcessor response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Creates a new Application in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Value for parent. + * @param {string} request.applicationId + * Required. Id of the requesting object. + * @param {google.cloud.visionai.v1alpha1.Application} request.application + * Required. The resource being created. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/app_platform.create_application.js + * region_tag:visionai_v1alpha1_generated_AppPlatform_CreateApplication_async + */ + createApplication( + request?: protos.google.cloud.visionai.v1alpha1.ICreateApplicationRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IApplication, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createApplication( + request: protos.google.cloud.visionai.v1alpha1.ICreateApplicationRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IApplication, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createApplication( + request: protos.google.cloud.visionai.v1alpha1.ICreateApplicationRequest, + callback: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IApplication, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createApplication( + request?: protos.google.cloud.visionai.v1alpha1.ICreateApplicationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IApplication, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IApplication, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IApplication, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IApplication, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createApplication response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createApplication request %j', request); + return this.innerApiCalls + .createApplication(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IApplication, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createApplication response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `createApplication()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/app_platform.create_application.js + * region_tag:visionai_v1alpha1_generated_AppPlatform_CreateApplication_async + */ + async checkCreateApplicationProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.visionai.v1alpha1.Application, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + > + > { + this._log.info('createApplication long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createApplication, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.visionai.v1alpha1.Application, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + >; + } + /** + * Updates the parameters of a single Application. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. Field mask is used to specify the fields to be overwritten in the + * Application resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @param {google.cloud.visionai.v1alpha1.Application} request.application + * Required. The resource being updated. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/app_platform.update_application.js + * region_tag:visionai_v1alpha1_generated_AppPlatform_UpdateApplication_async + */ + updateApplication( + request?: protos.google.cloud.visionai.v1alpha1.IUpdateApplicationRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IApplication, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + updateApplication( + request: protos.google.cloud.visionai.v1alpha1.IUpdateApplicationRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IApplication, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + updateApplication( + request: protos.google.cloud.visionai.v1alpha1.IUpdateApplicationRequest, + callback: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IApplication, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + updateApplication( + request?: protos.google.cloud.visionai.v1alpha1.IUpdateApplicationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IApplication, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IApplication, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IApplication, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'application.name': request.application!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IApplication, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateApplication response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateApplication request %j', request); + return this.innerApiCalls + .updateApplication(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IApplication, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateApplication response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `updateApplication()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/app_platform.update_application.js + * region_tag:visionai_v1alpha1_generated_AppPlatform_UpdateApplication_async + */ + async checkUpdateApplicationProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.visionai.v1alpha1.Application, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + > + > { + this._log.info('updateApplication long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateApplication, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.visionai.v1alpha1.Application, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + >; + } + /** + * Deletes a single Application. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the resource. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.force] + * Optional. If set to true, any instances and drafts from this application will also be + * deleted. (Otherwise, the request will only work if the application has no + * instances and drafts.) + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/app_platform.delete_application.js + * region_tag:visionai_v1alpha1_generated_AppPlatform_DeleteApplication_async + */ + deleteApplication( + request?: protos.google.cloud.visionai.v1alpha1.IDeleteApplicationRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deleteApplication( + request: protos.google.cloud.visionai.v1alpha1.IDeleteApplicationRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + deleteApplication( + request: protos.google.cloud.visionai.v1alpha1.IDeleteApplicationRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + deleteApplication( + request?: protos.google.cloud.visionai.v1alpha1.IDeleteApplicationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteApplication response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteApplication request %j', request); + return this.innerApiCalls + .deleteApplication(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteApplication response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `deleteApplication()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/app_platform.delete_application.js + * region_tag:visionai_v1alpha1_generated_AppPlatform_DeleteApplication_async + */ + async checkDeleteApplicationProgress( + name: string, + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + > + > { + this._log.info('deleteApplication long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteApplication, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + >; + } + /** + * Deploys a single Application. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. the name of the application to retrieve. + * Format: + * "projects/{project}/locations/{location}/applications/{application}" + * @param {boolean} request.validateOnly + * If set, validate the request and preview the application graph, but do not + * actually deploy it. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.enableMonitoring] + * Optional. Whether or not to enable monitoring for the application on deployment. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/app_platform.deploy_application.js + * region_tag:visionai_v1alpha1_generated_AppPlatform_DeployApplication_async + */ + deployApplication( + request?: protos.google.cloud.visionai.v1alpha1.IDeployApplicationRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IDeployApplicationResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deployApplication( + request: protos.google.cloud.visionai.v1alpha1.IDeployApplicationRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IDeployApplicationResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + deployApplication( + request: protos.google.cloud.visionai.v1alpha1.IDeployApplicationRequest, + callback: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IDeployApplicationResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + deployApplication( + request?: protos.google.cloud.visionai.v1alpha1.IDeployApplicationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IDeployApplicationResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IDeployApplicationResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IDeployApplicationResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IDeployApplicationResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deployApplication response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deployApplication request %j', request); + return this.innerApiCalls + .deployApplication(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IDeployApplicationResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deployApplication response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `deployApplication()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/app_platform.deploy_application.js + * region_tag:visionai_v1alpha1_generated_AppPlatform_DeployApplication_async + */ + async checkDeployApplicationProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.visionai.v1alpha1.DeployApplicationResponse, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + > + > { + this._log.info('deployApplication long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deployApplication, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.visionai.v1alpha1.DeployApplicationResponse, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + >; + } + /** + * Undeploys a single Application. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. the name of the application to retrieve. + * Format: + * "projects/{project}/locations/{location}/applications/{application}" + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/app_platform.undeploy_application.js + * region_tag:visionai_v1alpha1_generated_AppPlatform_UndeployApplication_async + */ + undeployApplication( + request?: protos.google.cloud.visionai.v1alpha1.IUndeployApplicationRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IUndeployApplicationResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + undeployApplication( + request: protos.google.cloud.visionai.v1alpha1.IUndeployApplicationRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IUndeployApplicationResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + undeployApplication( + request: protos.google.cloud.visionai.v1alpha1.IUndeployApplicationRequest, + callback: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IUndeployApplicationResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + undeployApplication( + request?: protos.google.cloud.visionai.v1alpha1.IUndeployApplicationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IUndeployApplicationResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IUndeployApplicationResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IUndeployApplicationResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IUndeployApplicationResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('undeployApplication response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('undeployApplication request %j', request); + return this.innerApiCalls + .undeployApplication(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IUndeployApplicationResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('undeployApplication response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `undeployApplication()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/app_platform.undeploy_application.js + * region_tag:visionai_v1alpha1_generated_AppPlatform_UndeployApplication_async + */ + async checkUndeployApplicationProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.visionai.v1alpha1.UndeployApplicationResponse, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + > + > { + this._log.info('undeployApplication long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.undeployApplication, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.visionai.v1alpha1.UndeployApplicationResponse, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + >; + } + /** + * Adds target stream input to the Application. + * If the Application is deployed, the corresponding new Application instance + * will be created. If the stream has already been in the Application, the RPC + * will fail. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. the name of the application to retrieve. + * Format: + * "projects/{project}/locations/{location}/applications/{application}" + * @param {number[]} request.applicationStreamInputs + * The stream inputs to add, the stream resource name is the key of each + * StreamInput, and it must be unique within each application. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/app_platform.add_application_stream_input.js + * region_tag:visionai_v1alpha1_generated_AppPlatform_AddApplicationStreamInput_async + */ + addApplicationStreamInput( + request?: protos.google.cloud.visionai.v1alpha1.IAddApplicationStreamInputRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IAddApplicationStreamInputResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + addApplicationStreamInput( + request: protos.google.cloud.visionai.v1alpha1.IAddApplicationStreamInputRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IAddApplicationStreamInputResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + addApplicationStreamInput( + request: protos.google.cloud.visionai.v1alpha1.IAddApplicationStreamInputRequest, + callback: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IAddApplicationStreamInputResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + addApplicationStreamInput( + request?: protos.google.cloud.visionai.v1alpha1.IAddApplicationStreamInputRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IAddApplicationStreamInputResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IAddApplicationStreamInputResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IAddApplicationStreamInputResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IAddApplicationStreamInputResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('addApplicationStreamInput response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('addApplicationStreamInput request %j', request); + return this.innerApiCalls + .addApplicationStreamInput(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IAddApplicationStreamInputResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('addApplicationStreamInput response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `addApplicationStreamInput()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/app_platform.add_application_stream_input.js + * region_tag:visionai_v1alpha1_generated_AppPlatform_AddApplicationStreamInput_async + */ + async checkAddApplicationStreamInputProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.visionai.v1alpha1.AddApplicationStreamInputResponse, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + > + > { + this._log.info('addApplicationStreamInput long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.addApplicationStreamInput, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.visionai.v1alpha1.AddApplicationStreamInputResponse, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + >; + } + /** + * Remove target stream input to the Application, if the Application is + * deployed, the corresponding instance based will be deleted. If the stream + * is not in the Application, the RPC will fail. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. the name of the application to retrieve. + * Format: + * "projects/{project}/locations/{location}/applications/{application}" + * @param {number[]} request.targetStreamInputs + * The target stream to remove. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/app_platform.remove_application_stream_input.js + * region_tag:visionai_v1alpha1_generated_AppPlatform_RemoveApplicationStreamInput_async + */ + removeApplicationStreamInput( + request?: protos.google.cloud.visionai.v1alpha1.IRemoveApplicationStreamInputRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IRemoveApplicationStreamInputResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + removeApplicationStreamInput( + request: protos.google.cloud.visionai.v1alpha1.IRemoveApplicationStreamInputRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IRemoveApplicationStreamInputResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + removeApplicationStreamInput( + request: protos.google.cloud.visionai.v1alpha1.IRemoveApplicationStreamInputRequest, + callback: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IRemoveApplicationStreamInputResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + removeApplicationStreamInput( + request?: protos.google.cloud.visionai.v1alpha1.IRemoveApplicationStreamInputRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IRemoveApplicationStreamInputResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IRemoveApplicationStreamInputResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IRemoveApplicationStreamInputResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IRemoveApplicationStreamInputResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info( + 'removeApplicationStreamInput response %j', + rawResponse, + ); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('removeApplicationStreamInput request %j', request); + return this.innerApiCalls + .removeApplicationStreamInput(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IRemoveApplicationStreamInputResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info( + 'removeApplicationStreamInput response %j', + rawResponse, + ); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `removeApplicationStreamInput()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/app_platform.remove_application_stream_input.js + * region_tag:visionai_v1alpha1_generated_AppPlatform_RemoveApplicationStreamInput_async + */ + async checkRemoveApplicationStreamInputProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputResponse, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + > + > { + this._log.info('removeApplicationStreamInput long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.removeApplicationStreamInput, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputResponse, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + >; + } + /** + * Update target stream input to the Application, if the Application is + * deployed, the corresponding instance based will be deployed. For + * CreateOrUpdate behavior, set allow_missing to true. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. the name of the application to retrieve. + * Format: + * "projects/{project}/locations/{location}/applications/{application}" + * @param {number[]} request.applicationStreamInputs + * The stream inputs to update, the stream resource name is the key of each + * StreamInput, and it must be unique within each application. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} request.allowMissing + * If true, UpdateApplicationStreamInput will insert stream input to + * application even if the target stream is not included in the application. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/app_platform.update_application_stream_input.js + * region_tag:visionai_v1alpha1_generated_AppPlatform_UpdateApplicationStreamInput_async + */ + updateApplicationStreamInput( + request?: protos.google.cloud.visionai.v1alpha1.IUpdateApplicationStreamInputRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IUpdateApplicationStreamInputResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + updateApplicationStreamInput( + request: protos.google.cloud.visionai.v1alpha1.IUpdateApplicationStreamInputRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IUpdateApplicationStreamInputResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + updateApplicationStreamInput( + request: protos.google.cloud.visionai.v1alpha1.IUpdateApplicationStreamInputRequest, + callback: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IUpdateApplicationStreamInputResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + updateApplicationStreamInput( + request?: protos.google.cloud.visionai.v1alpha1.IUpdateApplicationStreamInputRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IUpdateApplicationStreamInputResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IUpdateApplicationStreamInputResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IUpdateApplicationStreamInputResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IUpdateApplicationStreamInputResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info( + 'updateApplicationStreamInput response %j', + rawResponse, + ); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateApplicationStreamInput request %j', request); + return this.innerApiCalls + .updateApplicationStreamInput(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IUpdateApplicationStreamInputResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info( + 'updateApplicationStreamInput response %j', + rawResponse, + ); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `updateApplicationStreamInput()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/app_platform.update_application_stream_input.js + * region_tag:visionai_v1alpha1_generated_AppPlatform_UpdateApplicationStreamInput_async + */ + async checkUpdateApplicationStreamInputProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputResponse, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + > + > { + this._log.info('updateApplicationStreamInput long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateApplicationStreamInput, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputResponse, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + >; + } + /** + * Adds target stream input to the Application. + * If the Application is deployed, the corresponding new Application instance + * will be created. If the stream has already been in the Application, the RPC + * will fail. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. the name of the application to retrieve. + * Format: + * "projects/{project}/locations/{location}/applications/{application}" + * @param {number[]} request.applicationInstances + * Required. The resources being created. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/app_platform.create_application_instances.js + * region_tag:visionai_v1alpha1_generated_AppPlatform_CreateApplicationInstances_async + */ + createApplicationInstances( + request?: protos.google.cloud.visionai.v1alpha1.ICreateApplicationInstancesRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.visionai.v1alpha1.ICreateApplicationInstancesResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createApplicationInstances( + request: protos.google.cloud.visionai.v1alpha1.ICreateApplicationInstancesRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.ICreateApplicationInstancesResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createApplicationInstances( + request: protos.google.cloud.visionai.v1alpha1.ICreateApplicationInstancesRequest, + callback: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.ICreateApplicationInstancesResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createApplicationInstances( + request?: protos.google.cloud.visionai.v1alpha1.ICreateApplicationInstancesRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.ICreateApplicationInstancesResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.ICreateApplicationInstancesResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.visionai.v1alpha1.ICreateApplicationInstancesResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.ICreateApplicationInstancesResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createApplicationInstances response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createApplicationInstances request %j', request); + return this.innerApiCalls + .createApplicationInstances(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.visionai.v1alpha1.ICreateApplicationInstancesResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createApplicationInstances response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `createApplicationInstances()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/app_platform.create_application_instances.js + * region_tag:visionai_v1alpha1_generated_AppPlatform_CreateApplicationInstances_async + */ + async checkCreateApplicationInstancesProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.visionai.v1alpha1.CreateApplicationInstancesResponse, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + > + > { + this._log.info('createApplicationInstances long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createApplicationInstances, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.visionai.v1alpha1.CreateApplicationInstancesResponse, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + >; + } + /** + * Remove target stream input to the Application, if the Application is + * deployed, the corresponding instance based will be deleted. If the stream + * is not in the Application, the RPC will fail. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. the name of the application to retrieve. + * Format: + * "projects/{project}/locations/{location}/applications/{application}" + * @param {string[]} request.instanceIds + * Required. Id of the requesting object. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/app_platform.delete_application_instances.js + * region_tag:visionai_v1alpha1_generated_AppPlatform_DeleteApplicationInstances_async + */ + deleteApplicationInstances( + request?: protos.google.cloud.visionai.v1alpha1.IDeleteApplicationInstancesRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IInstance, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deleteApplicationInstances( + request: protos.google.cloud.visionai.v1alpha1.IDeleteApplicationInstancesRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IInstance, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + deleteApplicationInstances( + request: protos.google.cloud.visionai.v1alpha1.IDeleteApplicationInstancesRequest, + callback: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IInstance, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + deleteApplicationInstances( + request?: protos.google.cloud.visionai.v1alpha1.IDeleteApplicationInstancesRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IInstance, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IInstance, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IInstance, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IInstance, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteApplicationInstances response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteApplicationInstances request %j', request); + return this.innerApiCalls + .deleteApplicationInstances(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IInstance, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteApplicationInstances response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `deleteApplicationInstances()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/app_platform.delete_application_instances.js + * region_tag:visionai_v1alpha1_generated_AppPlatform_DeleteApplicationInstances_async + */ + async checkDeleteApplicationInstancesProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.visionai.v1alpha1.Instance, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + > + > { + this._log.info('deleteApplicationInstances long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteApplicationInstances, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.visionai.v1alpha1.Instance, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + >; + } + /** + * Adds target stream input to the Application. + * If the Application is deployed, the corresponding new Application instance + * will be created. If the stream has already been in the Application, the RPC + * will fail. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. the name of the application to retrieve. + * Format: + * "projects/{project}/locations/{location}/applications/{application}" + * @param {number[]} request.applicationInstances + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} request.allowMissing + * If true, Update Request will create one resource if the target resource + * doesn't exist, this time, the field_mask will be ignored. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/app_platform.update_application_instances.js + * region_tag:visionai_v1alpha1_generated_AppPlatform_UpdateApplicationInstances_async + */ + updateApplicationInstances( + request?: protos.google.cloud.visionai.v1alpha1.IUpdateApplicationInstancesRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IUpdateApplicationInstancesResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + updateApplicationInstances( + request: protos.google.cloud.visionai.v1alpha1.IUpdateApplicationInstancesRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IUpdateApplicationInstancesResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + updateApplicationInstances( + request: protos.google.cloud.visionai.v1alpha1.IUpdateApplicationInstancesRequest, + callback: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IUpdateApplicationInstancesResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + updateApplicationInstances( + request?: protos.google.cloud.visionai.v1alpha1.IUpdateApplicationInstancesRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IUpdateApplicationInstancesResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IUpdateApplicationInstancesResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IUpdateApplicationInstancesResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IUpdateApplicationInstancesResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateApplicationInstances response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateApplicationInstances request %j', request); + return this.innerApiCalls + .updateApplicationInstances(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IUpdateApplicationInstancesResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateApplicationInstances response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `updateApplicationInstances()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/app_platform.update_application_instances.js + * region_tag:visionai_v1alpha1_generated_AppPlatform_UpdateApplicationInstances_async + */ + async checkUpdateApplicationInstancesProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.visionai.v1alpha1.UpdateApplicationInstancesResponse, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + > + > { + this._log.info('updateApplicationInstances long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateApplicationInstances, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.visionai.v1alpha1.UpdateApplicationInstancesResponse, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + >; + } + /** + * Creates a new Draft in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Value for parent. + * @param {string} request.draftId + * Required. Id of the requesting object. + * @param {google.cloud.visionai.v1alpha1.Draft} request.draft + * Required. The resource being created. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/app_platform.create_draft.js + * region_tag:visionai_v1alpha1_generated_AppPlatform_CreateDraft_async + */ + createDraft( + request?: protos.google.cloud.visionai.v1alpha1.ICreateDraftRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IDraft, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createDraft( + request: protos.google.cloud.visionai.v1alpha1.ICreateDraftRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IDraft, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createDraft( + request: protos.google.cloud.visionai.v1alpha1.ICreateDraftRequest, + callback: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IDraft, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createDraft( + request?: protos.google.cloud.visionai.v1alpha1.ICreateDraftRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IDraft, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IDraft, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IDraft, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IDraft, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createDraft response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createDraft request %j', request); + return this.innerApiCalls + .createDraft(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IDraft, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createDraft response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `createDraft()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/app_platform.create_draft.js + * region_tag:visionai_v1alpha1_generated_AppPlatform_CreateDraft_async + */ + async checkCreateDraftProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.visionai.v1alpha1.Draft, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + > + > { + this._log.info('createDraft long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createDraft, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.visionai.v1alpha1.Draft, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + >; + } + /** + * Updates the parameters of a single Draft. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. Field mask is used to specify the fields to be overwritten in the + * Draft resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @param {google.cloud.visionai.v1alpha1.Draft} request.draft + * Required. The resource being updated. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} request.allowMissing + * If true, UpdateDraftRequest will create one resource if the target resource + * doesn't exist, this time, the field_mask will be ignored. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/app_platform.update_draft.js + * region_tag:visionai_v1alpha1_generated_AppPlatform_UpdateDraft_async + */ + updateDraft( + request?: protos.google.cloud.visionai.v1alpha1.IUpdateDraftRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IDraft, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + updateDraft( + request: protos.google.cloud.visionai.v1alpha1.IUpdateDraftRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IDraft, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + updateDraft( + request: protos.google.cloud.visionai.v1alpha1.IUpdateDraftRequest, + callback: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IDraft, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + updateDraft( + request?: protos.google.cloud.visionai.v1alpha1.IUpdateDraftRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IDraft, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IDraft, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IDraft, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'draft.name': request.draft!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IDraft, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateDraft response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateDraft request %j', request); + return this.innerApiCalls + .updateDraft(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IDraft, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateDraft response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `updateDraft()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/app_platform.update_draft.js + * region_tag:visionai_v1alpha1_generated_AppPlatform_UpdateDraft_async + */ + async checkUpdateDraftProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.visionai.v1alpha1.Draft, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + > + > { + this._log.info('updateDraft long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateDraft, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.visionai.v1alpha1.Draft, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + >; + } + /** + * Deletes a single Draft. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the resource. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/app_platform.delete_draft.js + * region_tag:visionai_v1alpha1_generated_AppPlatform_DeleteDraft_async + */ + deleteDraft( + request?: protos.google.cloud.visionai.v1alpha1.IDeleteDraftRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deleteDraft( + request: protos.google.cloud.visionai.v1alpha1.IDeleteDraftRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + deleteDraft( + request: protos.google.cloud.visionai.v1alpha1.IDeleteDraftRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + deleteDraft( + request?: protos.google.cloud.visionai.v1alpha1.IDeleteDraftRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteDraft response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteDraft request %j', request); + return this.innerApiCalls + .deleteDraft(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteDraft response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `deleteDraft()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/app_platform.delete_draft.js + * region_tag:visionai_v1alpha1_generated_AppPlatform_DeleteDraft_async + */ + async checkDeleteDraftProgress( + name: string, + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + > + > { + this._log.info('deleteDraft long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteDraft, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + >; + } + /** + * Creates a new Processor in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Value for parent. + * @param {string} request.processorId + * Required. Id of the requesting object. + * @param {google.cloud.visionai.v1alpha1.Processor} request.processor + * Required. The resource being created. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/app_platform.create_processor.js + * region_tag:visionai_v1alpha1_generated_AppPlatform_CreateProcessor_async + */ + createProcessor( + request?: protos.google.cloud.visionai.v1alpha1.ICreateProcessorRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IProcessor, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createProcessor( + request: protos.google.cloud.visionai.v1alpha1.ICreateProcessorRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IProcessor, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createProcessor( + request: protos.google.cloud.visionai.v1alpha1.ICreateProcessorRequest, + callback: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IProcessor, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createProcessor( + request?: protos.google.cloud.visionai.v1alpha1.ICreateProcessorRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IProcessor, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IProcessor, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IProcessor, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IProcessor, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createProcessor response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createProcessor request %j', request); + return this.innerApiCalls + .createProcessor(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IProcessor, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createProcessor response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `createProcessor()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/app_platform.create_processor.js + * region_tag:visionai_v1alpha1_generated_AppPlatform_CreateProcessor_async + */ + async checkCreateProcessorProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.visionai.v1alpha1.Processor, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + > + > { + this._log.info('createProcessor long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createProcessor, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.visionai.v1alpha1.Processor, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + >; + } + /** + * Updates the parameters of a single Processor. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. Field mask is used to specify the fields to be overwritten in the + * Processor resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @param {google.cloud.visionai.v1alpha1.Processor} request.processor + * Required. The resource being updated. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/app_platform.update_processor.js + * region_tag:visionai_v1alpha1_generated_AppPlatform_UpdateProcessor_async + */ + updateProcessor( + request?: protos.google.cloud.visionai.v1alpha1.IUpdateProcessorRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IProcessor, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + updateProcessor( + request: protos.google.cloud.visionai.v1alpha1.IUpdateProcessorRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IProcessor, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + updateProcessor( + request: protos.google.cloud.visionai.v1alpha1.IUpdateProcessorRequest, + callback: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IProcessor, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + updateProcessor( + request?: protos.google.cloud.visionai.v1alpha1.IUpdateProcessorRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IProcessor, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IProcessor, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IProcessor, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'processor.name': request.processor!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IProcessor, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateProcessor response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateProcessor request %j', request); + return this.innerApiCalls + .updateProcessor(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IProcessor, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateProcessor response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `updateProcessor()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/app_platform.update_processor.js + * region_tag:visionai_v1alpha1_generated_AppPlatform_UpdateProcessor_async + */ + async checkUpdateProcessorProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.visionai.v1alpha1.Processor, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + > + > { + this._log.info('updateProcessor long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateProcessor, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.visionai.v1alpha1.Processor, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + >; + } + /** + * Deletes a single Processor. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the resource + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/app_platform.delete_processor.js + * region_tag:visionai_v1alpha1_generated_AppPlatform_DeleteProcessor_async + */ + deleteProcessor( + request?: protos.google.cloud.visionai.v1alpha1.IDeleteProcessorRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deleteProcessor( + request: protos.google.cloud.visionai.v1alpha1.IDeleteProcessorRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + deleteProcessor( + request: protos.google.cloud.visionai.v1alpha1.IDeleteProcessorRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + deleteProcessor( + request?: protos.google.cloud.visionai.v1alpha1.IDeleteProcessorRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteProcessor response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteProcessor request %j', request); + return this.innerApiCalls + .deleteProcessor(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteProcessor response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `deleteProcessor()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/app_platform.delete_processor.js + * region_tag:visionai_v1alpha1_generated_AppPlatform_DeleteProcessor_async + */ + async checkDeleteProcessorProgress( + name: string, + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + > + > { + this._log.info('deleteProcessor long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteProcessor, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + >; + } + /** + * Lists Applications in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListApplicationsRequest. + * @param {number} request.pageSize + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} request.filter + * Filtering results. + * @param {string} request.orderBy + * Hint for how to order the results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.visionai.v1alpha1.Application|Application}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listApplicationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listApplications( + request?: protos.google.cloud.visionai.v1alpha1.IListApplicationsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IApplication[], + protos.google.cloud.visionai.v1alpha1.IListApplicationsRequest | null, + protos.google.cloud.visionai.v1alpha1.IListApplicationsResponse, + ] + >; + listApplications( + request: protos.google.cloud.visionai.v1alpha1.IListApplicationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListApplicationsRequest, + | protos.google.cloud.visionai.v1alpha1.IListApplicationsResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.IApplication + >, + ): void; + listApplications( + request: protos.google.cloud.visionai.v1alpha1.IListApplicationsRequest, + callback: PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListApplicationsRequest, + | protos.google.cloud.visionai.v1alpha1.IListApplicationsResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.IApplication + >, + ): void; + listApplications( + request?: protos.google.cloud.visionai.v1alpha1.IListApplicationsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListApplicationsRequest, + | protos.google.cloud.visionai.v1alpha1.IListApplicationsResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.IApplication + >, + callback?: PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListApplicationsRequest, + | protos.google.cloud.visionai.v1alpha1.IListApplicationsResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.IApplication + >, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IApplication[], + protos.google.cloud.visionai.v1alpha1.IListApplicationsRequest | null, + protos.google.cloud.visionai.v1alpha1.IListApplicationsResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListApplicationsRequest, + | protos.google.cloud.visionai.v1alpha1.IListApplicationsResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.IApplication + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listApplications values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listApplications request %j', request); + return this.innerApiCalls + .listApplications(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.visionai.v1alpha1.IApplication[], + protos.google.cloud.visionai.v1alpha1.IListApplicationsRequest | null, + protos.google.cloud.visionai.v1alpha1.IListApplicationsResponse, + ]) => { + this._log.info('listApplications values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listApplications`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListApplicationsRequest. + * @param {number} request.pageSize + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} request.filter + * Filtering results. + * @param {string} request.orderBy + * Hint for how to order the results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.visionai.v1alpha1.Application|Application} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listApplicationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listApplicationsStream( + request?: protos.google.cloud.visionai.v1alpha1.IListApplicationsRequest, + options?: CallOptions, + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listApplications']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listApplications stream %j', request); + return this.descriptors.page.listApplications.createStream( + this.innerApiCalls.listApplications as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listApplications`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListApplicationsRequest. + * @param {number} request.pageSize + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} request.filter + * Filtering results. + * @param {string} request.orderBy + * Hint for how to order the results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.visionai.v1alpha1.Application|Application}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/app_platform.list_applications.js + * region_tag:visionai_v1alpha1_generated_AppPlatform_ListApplications_async + */ + listApplicationsAsync( + request?: protos.google.cloud.visionai.v1alpha1.IListApplicationsRequest, + options?: CallOptions, + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listApplications']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listApplications iterate %j', request); + return this.descriptors.page.listApplications.asyncIterate( + this.innerApiCalls['listApplications'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + /** + * Lists Instances in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListInstancesRequest. + * @param {number} request.pageSize + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} request.filter + * Filtering results. + * @param {string} request.orderBy + * Hint for how to order the results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.visionai.v1alpha1.Instance|Instance}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listInstancesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listInstances( + request?: protos.google.cloud.visionai.v1alpha1.IListInstancesRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IInstance[], + protos.google.cloud.visionai.v1alpha1.IListInstancesRequest | null, + protos.google.cloud.visionai.v1alpha1.IListInstancesResponse, + ] + >; + listInstances( + request: protos.google.cloud.visionai.v1alpha1.IListInstancesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListInstancesRequest, + | protos.google.cloud.visionai.v1alpha1.IListInstancesResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.IInstance + >, + ): void; + listInstances( + request: protos.google.cloud.visionai.v1alpha1.IListInstancesRequest, + callback: PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListInstancesRequest, + | protos.google.cloud.visionai.v1alpha1.IListInstancesResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.IInstance + >, + ): void; + listInstances( + request?: protos.google.cloud.visionai.v1alpha1.IListInstancesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListInstancesRequest, + | protos.google.cloud.visionai.v1alpha1.IListInstancesResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.IInstance + >, + callback?: PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListInstancesRequest, + | protos.google.cloud.visionai.v1alpha1.IListInstancesResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.IInstance + >, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IInstance[], + protos.google.cloud.visionai.v1alpha1.IListInstancesRequest | null, + protos.google.cloud.visionai.v1alpha1.IListInstancesResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListInstancesRequest, + | protos.google.cloud.visionai.v1alpha1.IListInstancesResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.IInstance + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listInstances values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listInstances request %j', request); + return this.innerApiCalls + .listInstances(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.visionai.v1alpha1.IInstance[], + protos.google.cloud.visionai.v1alpha1.IListInstancesRequest | null, + protos.google.cloud.visionai.v1alpha1.IListInstancesResponse, + ]) => { + this._log.info('listInstances values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listInstances`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListInstancesRequest. + * @param {number} request.pageSize + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} request.filter + * Filtering results. + * @param {string} request.orderBy + * Hint for how to order the results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.visionai.v1alpha1.Instance|Instance} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listInstancesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listInstancesStream( + request?: protos.google.cloud.visionai.v1alpha1.IListInstancesRequest, + options?: CallOptions, + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listInstances']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listInstances stream %j', request); + return this.descriptors.page.listInstances.createStream( + this.innerApiCalls.listInstances as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listInstances`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListInstancesRequest. + * @param {number} request.pageSize + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} request.filter + * Filtering results. + * @param {string} request.orderBy + * Hint for how to order the results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.visionai.v1alpha1.Instance|Instance}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/app_platform.list_instances.js + * region_tag:visionai_v1alpha1_generated_AppPlatform_ListInstances_async + */ + listInstancesAsync( + request?: protos.google.cloud.visionai.v1alpha1.IListInstancesRequest, + options?: CallOptions, + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listInstances']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listInstances iterate %j', request); + return this.descriptors.page.listInstances.asyncIterate( + this.innerApiCalls['listInstances'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + /** + * Lists Drafts in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListDraftsRequest. + * @param {number} request.pageSize + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} request.filter + * Filtering results. + * @param {string} request.orderBy + * Hint for how to order the results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.visionai.v1alpha1.Draft|Draft}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listDraftsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listDrafts( + request?: protos.google.cloud.visionai.v1alpha1.IListDraftsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IDraft[], + protos.google.cloud.visionai.v1alpha1.IListDraftsRequest | null, + protos.google.cloud.visionai.v1alpha1.IListDraftsResponse, + ] + >; + listDrafts( + request: protos.google.cloud.visionai.v1alpha1.IListDraftsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListDraftsRequest, + | protos.google.cloud.visionai.v1alpha1.IListDraftsResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.IDraft + >, + ): void; + listDrafts( + request: protos.google.cloud.visionai.v1alpha1.IListDraftsRequest, + callback: PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListDraftsRequest, + | protos.google.cloud.visionai.v1alpha1.IListDraftsResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.IDraft + >, + ): void; + listDrafts( + request?: protos.google.cloud.visionai.v1alpha1.IListDraftsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListDraftsRequest, + | protos.google.cloud.visionai.v1alpha1.IListDraftsResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.IDraft + >, + callback?: PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListDraftsRequest, + | protos.google.cloud.visionai.v1alpha1.IListDraftsResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.IDraft + >, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IDraft[], + protos.google.cloud.visionai.v1alpha1.IListDraftsRequest | null, + protos.google.cloud.visionai.v1alpha1.IListDraftsResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListDraftsRequest, + | protos.google.cloud.visionai.v1alpha1.IListDraftsResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.IDraft + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listDrafts values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listDrafts request %j', request); + return this.innerApiCalls + .listDrafts(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.visionai.v1alpha1.IDraft[], + protos.google.cloud.visionai.v1alpha1.IListDraftsRequest | null, + protos.google.cloud.visionai.v1alpha1.IListDraftsResponse, + ]) => { + this._log.info('listDrafts values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listDrafts`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListDraftsRequest. + * @param {number} request.pageSize + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} request.filter + * Filtering results. + * @param {string} request.orderBy + * Hint for how to order the results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.visionai.v1alpha1.Draft|Draft} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listDraftsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listDraftsStream( + request?: protos.google.cloud.visionai.v1alpha1.IListDraftsRequest, + options?: CallOptions, + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listDrafts']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listDrafts stream %j', request); + return this.descriptors.page.listDrafts.createStream( + this.innerApiCalls.listDrafts as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listDrafts`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListDraftsRequest. + * @param {number} request.pageSize + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} request.filter + * Filtering results. + * @param {string} request.orderBy + * Hint for how to order the results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.visionai.v1alpha1.Draft|Draft}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/app_platform.list_drafts.js + * region_tag:visionai_v1alpha1_generated_AppPlatform_ListDrafts_async + */ + listDraftsAsync( + request?: protos.google.cloud.visionai.v1alpha1.IListDraftsRequest, + options?: CallOptions, + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listDrafts']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listDrafts iterate %j', request); + return this.descriptors.page.listDrafts.asyncIterate( + this.innerApiCalls['listDrafts'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + /** + * Lists Processors in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListProcessorsRequest. + * @param {number} request.pageSize + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} request.filter + * Filtering results. + * @param {string} request.orderBy + * Hint for how to order the results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.visionai.v1alpha1.Processor|Processor}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listProcessorsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listProcessors( + request?: protos.google.cloud.visionai.v1alpha1.IListProcessorsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IProcessor[], + protos.google.cloud.visionai.v1alpha1.IListProcessorsRequest | null, + protos.google.cloud.visionai.v1alpha1.IListProcessorsResponse, + ] + >; + listProcessors( + request: protos.google.cloud.visionai.v1alpha1.IListProcessorsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListProcessorsRequest, + | protos.google.cloud.visionai.v1alpha1.IListProcessorsResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.IProcessor + >, + ): void; + listProcessors( + request: protos.google.cloud.visionai.v1alpha1.IListProcessorsRequest, + callback: PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListProcessorsRequest, + | protos.google.cloud.visionai.v1alpha1.IListProcessorsResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.IProcessor + >, + ): void; + listProcessors( + request?: protos.google.cloud.visionai.v1alpha1.IListProcessorsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListProcessorsRequest, + | protos.google.cloud.visionai.v1alpha1.IListProcessorsResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.IProcessor + >, + callback?: PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListProcessorsRequest, + | protos.google.cloud.visionai.v1alpha1.IListProcessorsResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.IProcessor + >, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IProcessor[], + protos.google.cloud.visionai.v1alpha1.IListProcessorsRequest | null, + protos.google.cloud.visionai.v1alpha1.IListProcessorsResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListProcessorsRequest, + | protos.google.cloud.visionai.v1alpha1.IListProcessorsResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.IProcessor + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listProcessors values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listProcessors request %j', request); + return this.innerApiCalls + .listProcessors(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.visionai.v1alpha1.IProcessor[], + protos.google.cloud.visionai.v1alpha1.IListProcessorsRequest | null, + protos.google.cloud.visionai.v1alpha1.IListProcessorsResponse, + ]) => { + this._log.info('listProcessors values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listProcessors`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListProcessorsRequest. + * @param {number} request.pageSize + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} request.filter + * Filtering results. + * @param {string} request.orderBy + * Hint for how to order the results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.visionai.v1alpha1.Processor|Processor} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listProcessorsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listProcessorsStream( + request?: protos.google.cloud.visionai.v1alpha1.IListProcessorsRequest, + options?: CallOptions, + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listProcessors']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listProcessors stream %j', request); + return this.descriptors.page.listProcessors.createStream( + this.innerApiCalls.listProcessors as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listProcessors`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListProcessorsRequest. + * @param {number} request.pageSize + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} request.filter + * Filtering results. + * @param {string} request.orderBy + * Hint for how to order the results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.visionai.v1alpha1.Processor|Processor}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/app_platform.list_processors.js + * region_tag:visionai_v1alpha1_generated_AppPlatform_ListProcessors_async + */ + listProcessorsAsync( + request?: protos.google.cloud.visionai.v1alpha1.IListProcessorsRequest, + options?: CallOptions, + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listProcessors']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listProcessors iterate %j', request); + return this.descriptors.page.listProcessors.asyncIterate( + this.innerApiCalls['listProcessors'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + /** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + ): Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.getIamPolicy(request, options, callback); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + ): Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.setIamPolicy(request, options, callback); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + ): Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { + return this.iamClient.testIamPermissions(request, options, callback); + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + /** + * Lists information about the supported locations for this service. Returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions, + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions, + ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.cancelOperation(request, options, callback); + } + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified analysis resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @param {string} analysis + * @returns {string} Resource name string. + */ + analysisPath( + project: string, + location: string, + cluster: string, + analysis: string, + ) { + return this.pathTemplates.analysisPathTemplate.render({ + project: project, + location: location, + cluster: cluster, + analysis: analysis, + }); + } + + /** + * Parse the project from Analysis resource. + * + * @param {string} analysisName + * A fully-qualified path representing Analysis resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnalysisName(analysisName: string) { + return this.pathTemplates.analysisPathTemplate.match(analysisName).project; + } + + /** + * Parse the location from Analysis resource. + * + * @param {string} analysisName + * A fully-qualified path representing Analysis resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnalysisName(analysisName: string) { + return this.pathTemplates.analysisPathTemplate.match(analysisName).location; + } + + /** + * Parse the cluster from Analysis resource. + * + * @param {string} analysisName + * A fully-qualified path representing Analysis resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromAnalysisName(analysisName: string) { + return this.pathTemplates.analysisPathTemplate.match(analysisName).cluster; + } + + /** + * Parse the analysis from Analysis resource. + * + * @param {string} analysisName + * A fully-qualified path representing Analysis resource. + * @returns {string} A string representing the analysis. + */ + matchAnalysisFromAnalysisName(analysisName: string) { + return this.pathTemplates.analysisPathTemplate.match(analysisName).analysis; + } + + /** + * Return a fully-qualified annotation resource name string. + * + * @param {string} project_number + * @param {string} location + * @param {string} corpus + * @param {string} asset + * @param {string} annotation + * @returns {string} Resource name string. + */ + annotationPath( + projectNumber: string, + location: string, + corpus: string, + asset: string, + annotation: string, + ) { + return this.pathTemplates.annotationPathTemplate.render({ + project_number: projectNumber, + location: location, + corpus: corpus, + asset: asset, + annotation: annotation, + }); + } + + /** + * Parse the project_number from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the project_number. + */ + matchProjectNumberFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .project_number; + } + + /** + * Parse the location from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .location; + } + + /** + * Parse the corpus from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the corpus. + */ + matchCorpusFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .corpus; + } + + /** + * Parse the asset from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the asset. + */ + matchAssetFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .asset; + } + + /** + * Parse the annotation from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the annotation. + */ + matchAnnotationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .annotation; + } + + /** + * Return a fully-qualified application resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} application + * @returns {string} Resource name string. + */ + applicationPath(project: string, location: string, application: string) { + return this.pathTemplates.applicationPathTemplate.render({ + project: project, + location: location, + application: application, + }); + } + + /** + * Parse the project from Application resource. + * + * @param {string} applicationName + * A fully-qualified path representing Application resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApplicationName(applicationName: string) { + return this.pathTemplates.applicationPathTemplate.match(applicationName) + .project; + } + + /** + * Parse the location from Application resource. + * + * @param {string} applicationName + * A fully-qualified path representing Application resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApplicationName(applicationName: string) { + return this.pathTemplates.applicationPathTemplate.match(applicationName) + .location; + } + + /** + * Parse the application from Application resource. + * + * @param {string} applicationName + * A fully-qualified path representing Application resource. + * @returns {string} A string representing the application. + */ + matchApplicationFromApplicationName(applicationName: string) { + return this.pathTemplates.applicationPathTemplate.match(applicationName) + .application; + } + + /** + * Return a fully-qualified asset resource name string. + * + * @param {string} project_number + * @param {string} location + * @param {string} corpus + * @param {string} asset + * @returns {string} Resource name string. + */ + assetPath( + projectNumber: string, + location: string, + corpus: string, + asset: string, + ) { + return this.pathTemplates.assetPathTemplate.render({ + project_number: projectNumber, + location: location, + corpus: corpus, + asset: asset, + }); + } + + /** + * Parse the project_number from Asset resource. + * + * @param {string} assetName + * A fully-qualified path representing Asset resource. + * @returns {string} A string representing the project_number. + */ + matchProjectNumberFromAssetName(assetName: string) { + return this.pathTemplates.assetPathTemplate.match(assetName).project_number; + } + + /** + * Parse the location from Asset resource. + * + * @param {string} assetName + * A fully-qualified path representing Asset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAssetName(assetName: string) { + return this.pathTemplates.assetPathTemplate.match(assetName).location; + } + + /** + * Parse the corpus from Asset resource. + * + * @param {string} assetName + * A fully-qualified path representing Asset resource. + * @returns {string} A string representing the corpus. + */ + matchCorpusFromAssetName(assetName: string) { + return this.pathTemplates.assetPathTemplate.match(assetName).corpus; + } + + /** + * Parse the asset from Asset resource. + * + * @param {string} assetName + * A fully-qualified path representing Asset resource. + * @returns {string} A string representing the asset. + */ + matchAssetFromAssetName(assetName: string) { + return this.pathTemplates.assetPathTemplate.match(assetName).asset; + } + + /** + * Return a fully-qualified channel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @param {string} channel + * @returns {string} Resource name string. + */ + channelPath( + project: string, + location: string, + cluster: string, + channel: string, + ) { + return this.pathTemplates.channelPathTemplate.render({ + project: project, + location: location, + cluster: cluster, + channel: channel, + }); + } + + /** + * Parse the project from Channel resource. + * + * @param {string} channelName + * A fully-qualified path representing Channel resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChannelName(channelName: string) { + return this.pathTemplates.channelPathTemplate.match(channelName).project; + } + + /** + * Parse the location from Channel resource. + * + * @param {string} channelName + * A fully-qualified path representing Channel resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChannelName(channelName: string) { + return this.pathTemplates.channelPathTemplate.match(channelName).location; + } + + /** + * Parse the cluster from Channel resource. + * + * @param {string} channelName + * A fully-qualified path representing Channel resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromChannelName(channelName: string) { + return this.pathTemplates.channelPathTemplate.match(channelName).cluster; + } + + /** + * Parse the channel from Channel resource. + * + * @param {string} channelName + * A fully-qualified path representing Channel resource. + * @returns {string} A string representing the channel. + */ + matchChannelFromChannelName(channelName: string) { + return this.pathTemplates.channelPathTemplate.match(channelName).channel; + } + + /** + * Return a fully-qualified cluster resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @returns {string} Resource name string. + */ + clusterPath(project: string, location: string, cluster: string) { + return this.pathTemplates.clusterPathTemplate.render({ + project: project, + location: location, + cluster: cluster, + }); + } + + /** + * Parse the project from Cluster resource. + * + * @param {string} clusterName + * A fully-qualified path representing Cluster resource. + * @returns {string} A string representing the project. + */ + matchProjectFromClusterName(clusterName: string) { + return this.pathTemplates.clusterPathTemplate.match(clusterName).project; + } + + /** + * Parse the location from Cluster resource. + * + * @param {string} clusterName + * A fully-qualified path representing Cluster resource. + * @returns {string} A string representing the location. + */ + matchLocationFromClusterName(clusterName: string) { + return this.pathTemplates.clusterPathTemplate.match(clusterName).location; + } + + /** + * Parse the cluster from Cluster resource. + * + * @param {string} clusterName + * A fully-qualified path representing Cluster resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromClusterName(clusterName: string) { + return this.pathTemplates.clusterPathTemplate.match(clusterName).cluster; + } + + /** + * Return a fully-qualified corpus resource name string. + * + * @param {string} project_number + * @param {string} location + * @param {string} corpus + * @returns {string} Resource name string. + */ + corpusPath(projectNumber: string, location: string, corpus: string) { + return this.pathTemplates.corpusPathTemplate.render({ + project_number: projectNumber, + location: location, + corpus: corpus, + }); + } + + /** + * Parse the project_number from Corpus resource. + * + * @param {string} corpusName + * A fully-qualified path representing Corpus resource. + * @returns {string} A string representing the project_number. + */ + matchProjectNumberFromCorpusName(corpusName: string) { + return this.pathTemplates.corpusPathTemplate.match(corpusName) + .project_number; + } + + /** + * Parse the location from Corpus resource. + * + * @param {string} corpusName + * A fully-qualified path representing Corpus resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCorpusName(corpusName: string) { + return this.pathTemplates.corpusPathTemplate.match(corpusName).location; + } + + /** + * Parse the corpus from Corpus resource. + * + * @param {string} corpusName + * A fully-qualified path representing Corpus resource. + * @returns {string} A string representing the corpus. + */ + matchCorpusFromCorpusName(corpusName: string) { + return this.pathTemplates.corpusPathTemplate.match(corpusName).corpus; + } + + /** + * Return a fully-qualified dataSchema resource name string. + * + * @param {string} project_number + * @param {string} location + * @param {string} corpus + * @param {string} data_schema + * @returns {string} Resource name string. + */ + dataSchemaPath( + projectNumber: string, + location: string, + corpus: string, + dataSchema: string, + ) { + return this.pathTemplates.dataSchemaPathTemplate.render({ + project_number: projectNumber, + location: location, + corpus: corpus, + data_schema: dataSchema, + }); + } + + /** + * Parse the project_number from DataSchema resource. + * + * @param {string} dataSchemaName + * A fully-qualified path representing DataSchema resource. + * @returns {string} A string representing the project_number. + */ + matchProjectNumberFromDataSchemaName(dataSchemaName: string) { + return this.pathTemplates.dataSchemaPathTemplate.match(dataSchemaName) + .project_number; + } + + /** + * Parse the location from DataSchema resource. + * + * @param {string} dataSchemaName + * A fully-qualified path representing DataSchema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataSchemaName(dataSchemaName: string) { + return this.pathTemplates.dataSchemaPathTemplate.match(dataSchemaName) + .location; + } + + /** + * Parse the corpus from DataSchema resource. + * + * @param {string} dataSchemaName + * A fully-qualified path representing DataSchema resource. + * @returns {string} A string representing the corpus. + */ + matchCorpusFromDataSchemaName(dataSchemaName: string) { + return this.pathTemplates.dataSchemaPathTemplate.match(dataSchemaName) + .corpus; + } + + /** + * Parse the data_schema from DataSchema resource. + * + * @param {string} dataSchemaName + * A fully-qualified path representing DataSchema resource. + * @returns {string} A string representing the data_schema. + */ + matchDataSchemaFromDataSchemaName(dataSchemaName: string) { + return this.pathTemplates.dataSchemaPathTemplate.match(dataSchemaName) + .data_schema; + } + + /** + * Return a fully-qualified draft resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} application + * @param {string} draft + * @returns {string} Resource name string. + */ + draftPath( + project: string, + location: string, + application: string, + draft: string, + ) { + return this.pathTemplates.draftPathTemplate.render({ + project: project, + location: location, + application: application, + draft: draft, + }); + } + + /** + * Parse the project from Draft resource. + * + * @param {string} draftName + * A fully-qualified path representing Draft resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDraftName(draftName: string) { + return this.pathTemplates.draftPathTemplate.match(draftName).project; + } + + /** + * Parse the location from Draft resource. + * + * @param {string} draftName + * A fully-qualified path representing Draft resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDraftName(draftName: string) { + return this.pathTemplates.draftPathTemplate.match(draftName).location; + } + + /** + * Parse the application from Draft resource. + * + * @param {string} draftName + * A fully-qualified path representing Draft resource. + * @returns {string} A string representing the application. + */ + matchApplicationFromDraftName(draftName: string) { + return this.pathTemplates.draftPathTemplate.match(draftName).application; + } + + /** + * Parse the draft from Draft resource. + * + * @param {string} draftName + * A fully-qualified path representing Draft resource. + * @returns {string} A string representing the draft. + */ + matchDraftFromDraftName(draftName: string) { + return this.pathTemplates.draftPathTemplate.match(draftName).draft; + } + + /** + * Return a fully-qualified event resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @param {string} event + * @returns {string} Resource name string. + */ + eventPath(project: string, location: string, cluster: string, event: string) { + return this.pathTemplates.eventPathTemplate.render({ + project: project, + location: location, + cluster: cluster, + event: event, + }); + } + + /** + * Parse the project from Event resource. + * + * @param {string} eventName + * A fully-qualified path representing Event resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEventName(eventName: string) { + return this.pathTemplates.eventPathTemplate.match(eventName).project; + } + + /** + * Parse the location from Event resource. + * + * @param {string} eventName + * A fully-qualified path representing Event resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEventName(eventName: string) { + return this.pathTemplates.eventPathTemplate.match(eventName).location; + } + + /** + * Parse the cluster from Event resource. + * + * @param {string} eventName + * A fully-qualified path representing Event resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromEventName(eventName: string) { + return this.pathTemplates.eventPathTemplate.match(eventName).cluster; + } + + /** + * Parse the event from Event resource. + * + * @param {string} eventName + * A fully-qualified path representing Event resource. + * @returns {string} A string representing the event. + */ + matchEventFromEventName(eventName: string) { + return this.pathTemplates.eventPathTemplate.match(eventName).event; + } + + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} application + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath( + project: string, + location: string, + application: string, + instance: string, + ) { + return this.pathTemplates.instancePathTemplate.render({ + project: project, + location: location, + application: application, + instance: instance, + }); + } + + /** + * Parse the project from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).project; + } + + /** + * Parse the location from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).location; + } + + /** + * Parse the application from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the application. + */ + matchApplicationFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName) + .application; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project: string, location: string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified processor resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} processor + * @returns {string} Resource name string. + */ + processorPath(project: string, location: string, processor: string) { + return this.pathTemplates.processorPathTemplate.render({ + project: project, + location: location, + processor: processor, + }); + } + + /** + * Parse the project from Processor resource. + * + * @param {string} processorName + * A fully-qualified path representing Processor resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProcessorName(processorName: string) { + return this.pathTemplates.processorPathTemplate.match(processorName) + .project; + } + + /** + * Parse the location from Processor resource. + * + * @param {string} processorName + * A fully-qualified path representing Processor resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProcessorName(processorName: string) { + return this.pathTemplates.processorPathTemplate.match(processorName) + .location; + } + + /** + * Parse the processor from Processor resource. + * + * @param {string} processorName + * A fully-qualified path representing Processor resource. + * @returns {string} A string representing the processor. + */ + matchProcessorFromProcessorName(processorName: string) { + return this.pathTemplates.processorPathTemplate.match(processorName) + .processor; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified searchConfig resource name string. + * + * @param {string} project_number + * @param {string} location + * @param {string} corpus + * @param {string} search_config + * @returns {string} Resource name string. + */ + searchConfigPath( + projectNumber: string, + location: string, + corpus: string, + searchConfig: string, + ) { + return this.pathTemplates.searchConfigPathTemplate.render({ + project_number: projectNumber, + location: location, + corpus: corpus, + search_config: searchConfig, + }); + } + + /** + * Parse the project_number from SearchConfig resource. + * + * @param {string} searchConfigName + * A fully-qualified path representing SearchConfig resource. + * @returns {string} A string representing the project_number. + */ + matchProjectNumberFromSearchConfigName(searchConfigName: string) { + return this.pathTemplates.searchConfigPathTemplate.match(searchConfigName) + .project_number; + } + + /** + * Parse the location from SearchConfig resource. + * + * @param {string} searchConfigName + * A fully-qualified path representing SearchConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSearchConfigName(searchConfigName: string) { + return this.pathTemplates.searchConfigPathTemplate.match(searchConfigName) + .location; + } + + /** + * Parse the corpus from SearchConfig resource. + * + * @param {string} searchConfigName + * A fully-qualified path representing SearchConfig resource. + * @returns {string} A string representing the corpus. + */ + matchCorpusFromSearchConfigName(searchConfigName: string) { + return this.pathTemplates.searchConfigPathTemplate.match(searchConfigName) + .corpus; + } + + /** + * Parse the search_config from SearchConfig resource. + * + * @param {string} searchConfigName + * A fully-qualified path representing SearchConfig resource. + * @returns {string} A string representing the search_config. + */ + matchSearchConfigFromSearchConfigName(searchConfigName: string) { + return this.pathTemplates.searchConfigPathTemplate.match(searchConfigName) + .search_config; + } + + /** + * Return a fully-qualified series resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @param {string} series + * @returns {string} Resource name string. + */ + seriesPath( + project: string, + location: string, + cluster: string, + series: string, + ) { + return this.pathTemplates.seriesPathTemplate.render({ + project: project, + location: location, + cluster: cluster, + series: series, + }); + } + + /** + * Parse the project from Series resource. + * + * @param {string} seriesName + * A fully-qualified path representing Series resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSeriesName(seriesName: string) { + return this.pathTemplates.seriesPathTemplate.match(seriesName).project; + } + + /** + * Parse the location from Series resource. + * + * @param {string} seriesName + * A fully-qualified path representing Series resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSeriesName(seriesName: string) { + return this.pathTemplates.seriesPathTemplate.match(seriesName).location; + } + + /** + * Parse the cluster from Series resource. + * + * @param {string} seriesName + * A fully-qualified path representing Series resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromSeriesName(seriesName: string) { + return this.pathTemplates.seriesPathTemplate.match(seriesName).cluster; + } + + /** + * Parse the series from Series resource. + * + * @param {string} seriesName + * A fully-qualified path representing Series resource. + * @returns {string} A string representing the series. + */ + matchSeriesFromSeriesName(seriesName: string) { + return this.pathTemplates.seriesPathTemplate.match(seriesName).series; + } + + /** + * Return a fully-qualified stream resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @param {string} stream + * @returns {string} Resource name string. + */ + streamPath( + project: string, + location: string, + cluster: string, + stream: string, + ) { + return this.pathTemplates.streamPathTemplate.render({ + project: project, + location: location, + cluster: cluster, + stream: stream, + }); + } + + /** + * Parse the project from Stream resource. + * + * @param {string} streamName + * A fully-qualified path representing Stream resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStreamName(streamName: string) { + return this.pathTemplates.streamPathTemplate.match(streamName).project; + } + + /** + * Parse the location from Stream resource. + * + * @param {string} streamName + * A fully-qualified path representing Stream resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStreamName(streamName: string) { + return this.pathTemplates.streamPathTemplate.match(streamName).location; + } + + /** + * Parse the cluster from Stream resource. + * + * @param {string} streamName + * A fully-qualified path representing Stream resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromStreamName(streamName: string) { + return this.pathTemplates.streamPathTemplate.match(streamName).cluster; + } + + /** + * Parse the stream from Stream resource. + * + * @param {string} streamName + * A fully-qualified path representing Stream resource. + * @returns {string} A string representing the stream. + */ + matchStreamFromStreamName(streamName: string) { + return this.pathTemplates.streamPathTemplate.match(streamName).stream; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.appPlatformStub && !this._terminated) { + return this.appPlatformStub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.iamClient.close().catch((err) => { + throw err; + }); + this.locationsClient.close().catch((err) => { + throw err; + }); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-visionai/src/v1alpha1/app_platform_client_config.json b/packages/google-cloud-visionai/src/v1alpha1/app_platform_client_config.json new file mode 100644 index 000000000000..17943fb22bec --- /dev/null +++ b/packages/google-cloud-visionai/src/v1alpha1/app_platform_client_config.json @@ -0,0 +1,130 @@ +{ + "interfaces": { + "google.cloud.visionai.v1alpha1.AppPlatform": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListApplications": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetApplication": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateApplication": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateApplication": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteApplication": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeployApplication": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UndeployApplication": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "AddApplicationStreamInput": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RemoveApplicationStreamInput": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateApplicationStreamInput": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListInstances": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetInstance": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateApplicationInstances": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteApplicationInstances": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateApplicationInstances": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListDrafts": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetDraft": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateDraft": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateDraft": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteDraft": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListProcessors": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListPrebuiltProcessors": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetProcessor": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateProcessor": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateProcessor": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteProcessor": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-visionai/src/v1alpha1/app_platform_proto_list.json b/packages/google-cloud-visionai/src/v1alpha1/app_platform_proto_list.json new file mode 100644 index 000000000000..437d97a901a4 --- /dev/null +++ b/packages/google-cloud-visionai/src/v1alpha1/app_platform_proto_list.json @@ -0,0 +1,13 @@ +[ + "../../protos/google/cloud/visionai/v1alpha1/annotations.proto", + "../../protos/google/cloud/visionai/v1alpha1/common.proto", + "../../protos/google/cloud/visionai/v1alpha1/lva.proto", + "../../protos/google/cloud/visionai/v1alpha1/lva_resources.proto", + "../../protos/google/cloud/visionai/v1alpha1/lva_service.proto", + "../../protos/google/cloud/visionai/v1alpha1/platform.proto", + "../../protos/google/cloud/visionai/v1alpha1/streaming_resources.proto", + "../../protos/google/cloud/visionai/v1alpha1/streaming_service.proto", + "../../protos/google/cloud/visionai/v1alpha1/streams_resources.proto", + "../../protos/google/cloud/visionai/v1alpha1/streams_service.proto", + "../../protos/google/cloud/visionai/v1alpha1/warehouse.proto" +] diff --git a/packages/google-cloud-visionai/src/v1alpha1/gapic_metadata.json b/packages/google-cloud-visionai/src/v1alpha1/gapic_metadata.json new file mode 100644 index 000000000000..67425776c6a7 --- /dev/null +++ b/packages/google-cloud-visionai/src/v1alpha1/gapic_metadata.json @@ -0,0 +1,999 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.visionai.v1alpha1", + "libraryPackage": "@google-cloud/visionai", + "services": { + "AppPlatform": { + "clients": { + "grpc": { + "libraryClient": "AppPlatformClient", + "rpcs": { + "GetApplication": { + "methods": [ + "getApplication" + ] + }, + "GetInstance": { + "methods": [ + "getInstance" + ] + }, + "GetDraft": { + "methods": [ + "getDraft" + ] + }, + "ListPrebuiltProcessors": { + "methods": [ + "listPrebuiltProcessors" + ] + }, + "GetProcessor": { + "methods": [ + "getProcessor" + ] + }, + "CreateApplication": { + "methods": [ + "createApplication" + ] + }, + "UpdateApplication": { + "methods": [ + "updateApplication" + ] + }, + "DeleteApplication": { + "methods": [ + "deleteApplication" + ] + }, + "DeployApplication": { + "methods": [ + "deployApplication" + ] + }, + "UndeployApplication": { + "methods": [ + "undeployApplication" + ] + }, + "AddApplicationStreamInput": { + "methods": [ + "addApplicationStreamInput" + ] + }, + "RemoveApplicationStreamInput": { + "methods": [ + "removeApplicationStreamInput" + ] + }, + "UpdateApplicationStreamInput": { + "methods": [ + "updateApplicationStreamInput" + ] + }, + "CreateApplicationInstances": { + "methods": [ + "createApplicationInstances" + ] + }, + "DeleteApplicationInstances": { + "methods": [ + "deleteApplicationInstances" + ] + }, + "UpdateApplicationInstances": { + "methods": [ + "updateApplicationInstances" + ] + }, + "CreateDraft": { + "methods": [ + "createDraft" + ] + }, + "UpdateDraft": { + "methods": [ + "updateDraft" + ] + }, + "DeleteDraft": { + "methods": [ + "deleteDraft" + ] + }, + "CreateProcessor": { + "methods": [ + "createProcessor" + ] + }, + "UpdateProcessor": { + "methods": [ + "updateProcessor" + ] + }, + "DeleteProcessor": { + "methods": [ + "deleteProcessor" + ] + }, + "ListApplications": { + "methods": [ + "listApplications", + "listApplicationsStream", + "listApplicationsAsync" + ] + }, + "ListInstances": { + "methods": [ + "listInstances", + "listInstancesStream", + "listInstancesAsync" + ] + }, + "ListDrafts": { + "methods": [ + "listDrafts", + "listDraftsStream", + "listDraftsAsync" + ] + }, + "ListProcessors": { + "methods": [ + "listProcessors", + "listProcessorsStream", + "listProcessorsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "AppPlatformClient", + "rpcs": { + "GetApplication": { + "methods": [ + "getApplication" + ] + }, + "GetInstance": { + "methods": [ + "getInstance" + ] + }, + "GetDraft": { + "methods": [ + "getDraft" + ] + }, + "ListPrebuiltProcessors": { + "methods": [ + "listPrebuiltProcessors" + ] + }, + "GetProcessor": { + "methods": [ + "getProcessor" + ] + }, + "CreateApplication": { + "methods": [ + "createApplication" + ] + }, + "UpdateApplication": { + "methods": [ + "updateApplication" + ] + }, + "DeleteApplication": { + "methods": [ + "deleteApplication" + ] + }, + "DeployApplication": { + "methods": [ + "deployApplication" + ] + }, + "UndeployApplication": { + "methods": [ + "undeployApplication" + ] + }, + "AddApplicationStreamInput": { + "methods": [ + "addApplicationStreamInput" + ] + }, + "RemoveApplicationStreamInput": { + "methods": [ + "removeApplicationStreamInput" + ] + }, + "UpdateApplicationStreamInput": { + "methods": [ + "updateApplicationStreamInput" + ] + }, + "CreateApplicationInstances": { + "methods": [ + "createApplicationInstances" + ] + }, + "DeleteApplicationInstances": { + "methods": [ + "deleteApplicationInstances" + ] + }, + "UpdateApplicationInstances": { + "methods": [ + "updateApplicationInstances" + ] + }, + "CreateDraft": { + "methods": [ + "createDraft" + ] + }, + "UpdateDraft": { + "methods": [ + "updateDraft" + ] + }, + "DeleteDraft": { + "methods": [ + "deleteDraft" + ] + }, + "CreateProcessor": { + "methods": [ + "createProcessor" + ] + }, + "UpdateProcessor": { + "methods": [ + "updateProcessor" + ] + }, + "DeleteProcessor": { + "methods": [ + "deleteProcessor" + ] + }, + "ListApplications": { + "methods": [ + "listApplications", + "listApplicationsStream", + "listApplicationsAsync" + ] + }, + "ListInstances": { + "methods": [ + "listInstances", + "listInstancesStream", + "listInstancesAsync" + ] + }, + "ListDrafts": { + "methods": [ + "listDrafts", + "listDraftsStream", + "listDraftsAsync" + ] + }, + "ListProcessors": { + "methods": [ + "listProcessors", + "listProcessorsStream", + "listProcessorsAsync" + ] + } + } + } + } + }, + "LiveVideoAnalytics": { + "clients": { + "grpc": { + "libraryClient": "LiveVideoAnalyticsClient", + "rpcs": { + "GetAnalysis": { + "methods": [ + "getAnalysis" + ] + }, + "CreateAnalysis": { + "methods": [ + "createAnalysis" + ] + }, + "UpdateAnalysis": { + "methods": [ + "updateAnalysis" + ] + }, + "DeleteAnalysis": { + "methods": [ + "deleteAnalysis" + ] + }, + "ListAnalyses": { + "methods": [ + "listAnalyses", + "listAnalysesStream", + "listAnalysesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "LiveVideoAnalyticsClient", + "rpcs": { + "GetAnalysis": { + "methods": [ + "getAnalysis" + ] + }, + "CreateAnalysis": { + "methods": [ + "createAnalysis" + ] + }, + "UpdateAnalysis": { + "methods": [ + "updateAnalysis" + ] + }, + "DeleteAnalysis": { + "methods": [ + "deleteAnalysis" + ] + }, + "ListAnalyses": { + "methods": [ + "listAnalyses", + "listAnalysesStream", + "listAnalysesAsync" + ] + } + } + } + } + }, + "StreamingService": { + "clients": { + "grpc": { + "libraryClient": "StreamingServiceClient", + "rpcs": { + "AcquireLease": { + "methods": [ + "acquireLease" + ] + }, + "RenewLease": { + "methods": [ + "renewLease" + ] + }, + "ReleaseLease": { + "methods": [ + "releaseLease" + ] + }, + "SendPackets": { + "methods": [ + "sendPackets" + ] + }, + "ReceivePackets": { + "methods": [ + "receivePackets" + ] + }, + "ReceiveEvents": { + "methods": [ + "receiveEvents" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "StreamingServiceClient", + "rpcs": { + "AcquireLease": { + "methods": [ + "acquireLease" + ] + }, + "RenewLease": { + "methods": [ + "renewLease" + ] + }, + "ReleaseLease": { + "methods": [ + "releaseLease" + ] + } + } + } + } + }, + "StreamsService": { + "clients": { + "grpc": { + "libraryClient": "StreamsServiceClient", + "rpcs": { + "GetCluster": { + "methods": [ + "getCluster" + ] + }, + "GetStream": { + "methods": [ + "getStream" + ] + }, + "GenerateStreamHlsToken": { + "methods": [ + "generateStreamHlsToken" + ] + }, + "GetEvent": { + "methods": [ + "getEvent" + ] + }, + "GetSeries": { + "methods": [ + "getSeries" + ] + }, + "CreateCluster": { + "methods": [ + "createCluster" + ] + }, + "UpdateCluster": { + "methods": [ + "updateCluster" + ] + }, + "DeleteCluster": { + "methods": [ + "deleteCluster" + ] + }, + "CreateStream": { + "methods": [ + "createStream" + ] + }, + "UpdateStream": { + "methods": [ + "updateStream" + ] + }, + "DeleteStream": { + "methods": [ + "deleteStream" + ] + }, + "CreateEvent": { + "methods": [ + "createEvent" + ] + }, + "UpdateEvent": { + "methods": [ + "updateEvent" + ] + }, + "DeleteEvent": { + "methods": [ + "deleteEvent" + ] + }, + "CreateSeries": { + "methods": [ + "createSeries" + ] + }, + "UpdateSeries": { + "methods": [ + "updateSeries" + ] + }, + "DeleteSeries": { + "methods": [ + "deleteSeries" + ] + }, + "MaterializeChannel": { + "methods": [ + "materializeChannel" + ] + }, + "ListClusters": { + "methods": [ + "listClusters", + "listClustersStream", + "listClustersAsync" + ] + }, + "ListStreams": { + "methods": [ + "listStreams", + "listStreamsStream", + "listStreamsAsync" + ] + }, + "ListEvents": { + "methods": [ + "listEvents", + "listEventsStream", + "listEventsAsync" + ] + }, + "ListSeries": { + "methods": [ + "listSeries", + "listSeriesStream", + "listSeriesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "StreamsServiceClient", + "rpcs": { + "GetCluster": { + "methods": [ + "getCluster" + ] + }, + "GetStream": { + "methods": [ + "getStream" + ] + }, + "GenerateStreamHlsToken": { + "methods": [ + "generateStreamHlsToken" + ] + }, + "GetEvent": { + "methods": [ + "getEvent" + ] + }, + "GetSeries": { + "methods": [ + "getSeries" + ] + }, + "CreateCluster": { + "methods": [ + "createCluster" + ] + }, + "UpdateCluster": { + "methods": [ + "updateCluster" + ] + }, + "DeleteCluster": { + "methods": [ + "deleteCluster" + ] + }, + "CreateStream": { + "methods": [ + "createStream" + ] + }, + "UpdateStream": { + "methods": [ + "updateStream" + ] + }, + "DeleteStream": { + "methods": [ + "deleteStream" + ] + }, + "CreateEvent": { + "methods": [ + "createEvent" + ] + }, + "UpdateEvent": { + "methods": [ + "updateEvent" + ] + }, + "DeleteEvent": { + "methods": [ + "deleteEvent" + ] + }, + "CreateSeries": { + "methods": [ + "createSeries" + ] + }, + "UpdateSeries": { + "methods": [ + "updateSeries" + ] + }, + "DeleteSeries": { + "methods": [ + "deleteSeries" + ] + }, + "MaterializeChannel": { + "methods": [ + "materializeChannel" + ] + }, + "ListClusters": { + "methods": [ + "listClusters", + "listClustersStream", + "listClustersAsync" + ] + }, + "ListStreams": { + "methods": [ + "listStreams", + "listStreamsStream", + "listStreamsAsync" + ] + }, + "ListEvents": { + "methods": [ + "listEvents", + "listEventsStream", + "listEventsAsync" + ] + }, + "ListSeries": { + "methods": [ + "listSeries", + "listSeriesStream", + "listSeriesAsync" + ] + } + } + } + } + }, + "Warehouse": { + "clients": { + "grpc": { + "libraryClient": "WarehouseClient", + "rpcs": { + "CreateAsset": { + "methods": [ + "createAsset" + ] + }, + "UpdateAsset": { + "methods": [ + "updateAsset" + ] + }, + "GetAsset": { + "methods": [ + "getAsset" + ] + }, + "GetCorpus": { + "methods": [ + "getCorpus" + ] + }, + "UpdateCorpus": { + "methods": [ + "updateCorpus" + ] + }, + "DeleteCorpus": { + "methods": [ + "deleteCorpus" + ] + }, + "CreateDataSchema": { + "methods": [ + "createDataSchema" + ] + }, + "UpdateDataSchema": { + "methods": [ + "updateDataSchema" + ] + }, + "GetDataSchema": { + "methods": [ + "getDataSchema" + ] + }, + "DeleteDataSchema": { + "methods": [ + "deleteDataSchema" + ] + }, + "CreateAnnotation": { + "methods": [ + "createAnnotation" + ] + }, + "GetAnnotation": { + "methods": [ + "getAnnotation" + ] + }, + "UpdateAnnotation": { + "methods": [ + "updateAnnotation" + ] + }, + "DeleteAnnotation": { + "methods": [ + "deleteAnnotation" + ] + }, + "ClipAsset": { + "methods": [ + "clipAsset" + ] + }, + "GenerateHlsUri": { + "methods": [ + "generateHlsUri" + ] + }, + "CreateSearchConfig": { + "methods": [ + "createSearchConfig" + ] + }, + "UpdateSearchConfig": { + "methods": [ + "updateSearchConfig" + ] + }, + "GetSearchConfig": { + "methods": [ + "getSearchConfig" + ] + }, + "DeleteSearchConfig": { + "methods": [ + "deleteSearchConfig" + ] + }, + "IngestAsset": { + "methods": [ + "ingestAsset" + ] + }, + "DeleteAsset": { + "methods": [ + "deleteAsset" + ] + }, + "CreateCorpus": { + "methods": [ + "createCorpus" + ] + }, + "ListAssets": { + "methods": [ + "listAssets", + "listAssetsStream", + "listAssetsAsync" + ] + }, + "ListCorpora": { + "methods": [ + "listCorpora", + "listCorporaStream", + "listCorporaAsync" + ] + }, + "ListDataSchemas": { + "methods": [ + "listDataSchemas", + "listDataSchemasStream", + "listDataSchemasAsync" + ] + }, + "ListAnnotations": { + "methods": [ + "listAnnotations", + "listAnnotationsStream", + "listAnnotationsAsync" + ] + }, + "ListSearchConfigs": { + "methods": [ + "listSearchConfigs", + "listSearchConfigsStream", + "listSearchConfigsAsync" + ] + }, + "SearchAssets": { + "methods": [ + "searchAssets", + "searchAssetsStream", + "searchAssetsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "WarehouseClient", + "rpcs": { + "CreateAsset": { + "methods": [ + "createAsset" + ] + }, + "UpdateAsset": { + "methods": [ + "updateAsset" + ] + }, + "GetAsset": { + "methods": [ + "getAsset" + ] + }, + "GetCorpus": { + "methods": [ + "getCorpus" + ] + }, + "UpdateCorpus": { + "methods": [ + "updateCorpus" + ] + }, + "DeleteCorpus": { + "methods": [ + "deleteCorpus" + ] + }, + "CreateDataSchema": { + "methods": [ + "createDataSchema" + ] + }, + "UpdateDataSchema": { + "methods": [ + "updateDataSchema" + ] + }, + "GetDataSchema": { + "methods": [ + "getDataSchema" + ] + }, + "DeleteDataSchema": { + "methods": [ + "deleteDataSchema" + ] + }, + "CreateAnnotation": { + "methods": [ + "createAnnotation" + ] + }, + "GetAnnotation": { + "methods": [ + "getAnnotation" + ] + }, + "UpdateAnnotation": { + "methods": [ + "updateAnnotation" + ] + }, + "DeleteAnnotation": { + "methods": [ + "deleteAnnotation" + ] + }, + "ClipAsset": { + "methods": [ + "clipAsset" + ] + }, + "GenerateHlsUri": { + "methods": [ + "generateHlsUri" + ] + }, + "CreateSearchConfig": { + "methods": [ + "createSearchConfig" + ] + }, + "UpdateSearchConfig": { + "methods": [ + "updateSearchConfig" + ] + }, + "GetSearchConfig": { + "methods": [ + "getSearchConfig" + ] + }, + "DeleteSearchConfig": { + "methods": [ + "deleteSearchConfig" + ] + }, + "DeleteAsset": { + "methods": [ + "deleteAsset" + ] + }, + "CreateCorpus": { + "methods": [ + "createCorpus" + ] + }, + "ListAssets": { + "methods": [ + "listAssets", + "listAssetsStream", + "listAssetsAsync" + ] + }, + "ListCorpora": { + "methods": [ + "listCorpora", + "listCorporaStream", + "listCorporaAsync" + ] + }, + "ListDataSchemas": { + "methods": [ + "listDataSchemas", + "listDataSchemasStream", + "listDataSchemasAsync" + ] + }, + "ListAnnotations": { + "methods": [ + "listAnnotations", + "listAnnotationsStream", + "listAnnotationsAsync" + ] + }, + "ListSearchConfigs": { + "methods": [ + "listSearchConfigs", + "listSearchConfigsStream", + "listSearchConfigsAsync" + ] + }, + "SearchAssets": { + "methods": [ + "searchAssets", + "searchAssetsStream", + "searchAssetsAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-visionai/src/v1alpha1/index.ts b/packages/google-cloud-visionai/src/v1alpha1/index.ts new file mode 100644 index 000000000000..ac18f14f1dad --- /dev/null +++ b/packages/google-cloud-visionai/src/v1alpha1/index.ts @@ -0,0 +1,23 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export { AppPlatformClient } from './app_platform_client'; +export { LiveVideoAnalyticsClient } from './live_video_analytics_client'; +export { StreamingServiceClient } from './streaming_service_client'; +export { StreamsServiceClient } from './streams_service_client'; +export { WarehouseClient } from './warehouse_client'; diff --git a/packages/google-cloud-visionai/src/v1alpha1/live_video_analytics_client.ts b/packages/google-cloud-visionai/src/v1alpha1/live_video_analytics_client.ts new file mode 100644 index 000000000000..a5779cc7fbd1 --- /dev/null +++ b/packages/google-cloud-visionai/src/v1alpha1/live_video_analytics_client.ts @@ -0,0 +1,2981 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + GrpcClientOptions, + LROperation, + PaginationCallback, + GaxCall, + IamClient, + IamProtos, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import { Transform } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1alpha1/live_video_analytics_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './live_video_analytics_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service describing handlers for resources. The service enables clients to run + * Live Video Analytics (LVA) on the streaming inputs. + * @class + * @memberof v1alpha1 + */ +export class LiveVideoAnalyticsClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: { [method: string]: gax.CallSettings }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('visionai'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + iamClient: IamClient; + locationsClient: LocationsClient; + pathTemplates: { [name: string]: gax.PathTemplate }; + operationsClient: gax.OperationsClient; + liveVideoAnalyticsStub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of LiveVideoAnalyticsClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new LiveVideoAnalyticsClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof LiveVideoAnalyticsClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'visionai.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts, + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + analysisPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}/analyses/{analysis}', + ), + annotationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation}', + ), + applicationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/applications/{application}', + ), + assetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}', + ), + channelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}/channels/{channel}', + ), + clusterPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}', + ), + corpusPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project_number}/locations/{location}/corpora/{corpus}', + ), + dataSchemaPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project_number}/locations/{location}/corpora/{corpus}/dataSchemas/{data_schema}', + ), + draftPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/applications/{application}/drafts/{draft}', + ), + eventPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}/events/{event}', + ), + instancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/applications/{application}/instances/{instance}', + ), + processorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/processors/{processor}', + ), + searchConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config}', + ), + seriesPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}/series/{series}', + ), + streamPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}/streams/{stream}', + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listAnalyses: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'analyses', + ), + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/v1alpha1/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v1alpha1/{name=projects/*}/locations', + }, + { + selector: 'google.iam.v1.IAMPolicy.GetIamPolicy', + get: '/v1alpha1/{resource=projects/*/locations/*/clusters/*}:getIamPolicy', + additional_bindings: [ + { + get: '/v1alpha1/{resource=projects/*/locations/*/clusters/*/streams/*}:getIamPolicy', + }, + { + get: '/v1alpha1/{resource=projects/*/locations/*/clusters/*/events/*}:getIamPolicy', + }, + { + get: '/v1alpha1/{resource=projects/*/locations/*/clusters/*/series/*}:getIamPolicy', + }, + { + get: '/v1alpha1/{resource=projects/*/locations/*/operators/*}:getIamPolicy', + }, + { + get: '/v1alpha1/{resource=projects/*/locations/*/operators/*/versions/*}:getIamPolicy', + }, + { + get: '/v1alpha1/{resource=projects/*/locations/*/clusters/*/analyses/*}:getIamPolicy', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.SetIamPolicy', + post: '/v1alpha1/{resource=projects/*/locations/*/clusters/*}:setIamPolicy', + body: '*', + additional_bindings: [ + { + post: '/v1alpha1/{resource=projects/*/locations/*/clusters/*/streams/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1alpha1/{resource=projects/*/locations/*/clusters/*/events/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1alpha1/{resource=projects/*/locations/*/clusters/*/series/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1alpha1/{resource=projects/*/locations/*/operators/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1alpha1/{resource=projects/*/locations/*/operators/*/versions/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1alpha1/{resource=projects/*/locations/*/clusters/*/analyses/*}:setIamPolicy', + body: '*', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.TestIamPermissions', + post: '/v1alpha1/{resource=projects/*/locations/*/clusters/*}:testIamPermissions', + body: '*', + additional_bindings: [ + { + post: '/v1alpha1/{resource=projects/*/locations/*/clusters/*/streams/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1alpha1/{resource=projects/*/locations/*/clusters/*/events/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1alpha1/{resource=projects/*/locations/*/clusters/*/series/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1alpha1/{resource=projects/*/locations/*/operators/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1alpha1/{resource=projects/*/locations/*/operators/*/versions/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1alpha1/{resource=projects/*/locations/*/clusters/*/analyses/*}:testIamPermissions', + body: '*', + }, + ], + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1alpha1/{name=projects/*/locations/*/operations/*}:cancel', + body: '*', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1alpha1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1alpha1/{name=projects/*/locations/*/operations/*}', + additional_bindings: [ + { + get: '/v1alpha1/{name=projects/*/locations/*/warehouseOperations/*}', + }, + { + get: '/v1alpha1/{name=projects/*/locations/*/corpora/*/assets/*/operations/*}', + }, + ], + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1alpha1/{name=projects/*/locations/*}/operations', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const createAnalysisResponse = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.Analysis', + ) as gax.protobuf.Type; + const createAnalysisMetadata = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.OperationMetadata', + ) as gax.protobuf.Type; + const updateAnalysisResponse = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.Analysis', + ) as gax.protobuf.Type; + const updateAnalysisMetadata = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.OperationMetadata', + ) as gax.protobuf.Type; + const deleteAnalysisResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty', + ) as gax.protobuf.Type; + const deleteAnalysisMetadata = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.OperationMetadata', + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createAnalysis: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createAnalysisResponse.decode.bind(createAnalysisResponse), + createAnalysisMetadata.decode.bind(createAnalysisMetadata), + ), + updateAnalysis: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateAnalysisResponse.decode.bind(updateAnalysisResponse), + updateAnalysisMetadata.decode.bind(updateAnalysisMetadata), + ), + deleteAnalysis: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteAnalysisResponse.decode.bind(deleteAnalysisResponse), + deleteAnalysisMetadata.decode.bind(deleteAnalysisMetadata), + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.visionai.v1alpha1.LiveVideoAnalytics', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + { 'x-goog-api-client': clientHeader.join(' ') }, + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.liveVideoAnalyticsStub) { + return this.liveVideoAnalyticsStub; + } + + // Put together the "service stub" for + // google.cloud.visionai.v1alpha1.LiveVideoAnalytics. + this.liveVideoAnalyticsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.visionai.v1alpha1.LiveVideoAnalytics', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.visionai.v1alpha1 + .LiveVideoAnalytics, + this._opts, + this._providedCustomServicePath, + ) as Promise<{ [method: string]: Function }>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const liveVideoAnalyticsStubMethods = [ + 'listAnalyses', + 'getAnalysis', + 'createAnalysis', + 'updateAnalysis', + 'deleteAnalysis', + ]; + for (const methodName of liveVideoAnalyticsStubMethods) { + const callPromise = this.liveVideoAnalyticsStub.then( + (stub) => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + }, + ); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback, + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.liveVideoAnalyticsStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'visionai.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'visionai.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return ['https://www.googleapis.com/auth/cloud-platform']; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback, + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /** + * Gets details of a single Analysis. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.visionai.v1alpha1.Analysis|Analysis}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/live_video_analytics.get_analysis.js + * region_tag:visionai_v1alpha1_generated_LiveVideoAnalytics_GetAnalysis_async + */ + getAnalysis( + request?: protos.google.cloud.visionai.v1alpha1.IGetAnalysisRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IAnalysis, + protos.google.cloud.visionai.v1alpha1.IGetAnalysisRequest | undefined, + {} | undefined, + ] + >; + getAnalysis( + request: protos.google.cloud.visionai.v1alpha1.IGetAnalysisRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.IAnalysis, + | protos.google.cloud.visionai.v1alpha1.IGetAnalysisRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getAnalysis( + request: protos.google.cloud.visionai.v1alpha1.IGetAnalysisRequest, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.IAnalysis, + | protos.google.cloud.visionai.v1alpha1.IGetAnalysisRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getAnalysis( + request?: protos.google.cloud.visionai.v1alpha1.IGetAnalysisRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.visionai.v1alpha1.IAnalysis, + | protos.google.cloud.visionai.v1alpha1.IGetAnalysisRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.visionai.v1alpha1.IAnalysis, + | protos.google.cloud.visionai.v1alpha1.IGetAnalysisRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IAnalysis, + protos.google.cloud.visionai.v1alpha1.IGetAnalysisRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('getAnalysis request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.visionai.v1alpha1.IAnalysis, + | protos.google.cloud.visionai.v1alpha1.IGetAnalysisRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getAnalysis response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getAnalysis(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.visionai.v1alpha1.IAnalysis, + protos.google.cloud.visionai.v1alpha1.IGetAnalysisRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getAnalysis response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Creates a new Analysis in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Value for parent. + * @param {string} request.analysisId + * Required. Id of the requesting object. + * @param {google.cloud.visionai.v1alpha1.Analysis} request.analysis + * Required. The resource being created. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/live_video_analytics.create_analysis.js + * region_tag:visionai_v1alpha1_generated_LiveVideoAnalytics_CreateAnalysis_async + */ + createAnalysis( + request?: protos.google.cloud.visionai.v1alpha1.ICreateAnalysisRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IAnalysis, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createAnalysis( + request: protos.google.cloud.visionai.v1alpha1.ICreateAnalysisRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IAnalysis, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createAnalysis( + request: protos.google.cloud.visionai.v1alpha1.ICreateAnalysisRequest, + callback: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IAnalysis, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createAnalysis( + request?: protos.google.cloud.visionai.v1alpha1.ICreateAnalysisRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IAnalysis, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IAnalysis, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IAnalysis, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IAnalysis, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createAnalysis response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createAnalysis request %j', request); + return this.innerApiCalls + .createAnalysis(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IAnalysis, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createAnalysis response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `createAnalysis()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/live_video_analytics.create_analysis.js + * region_tag:visionai_v1alpha1_generated_LiveVideoAnalytics_CreateAnalysis_async + */ + async checkCreateAnalysisProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.visionai.v1alpha1.Analysis, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + > + > { + this._log.info('createAnalysis long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createAnalysis, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.visionai.v1alpha1.Analysis, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + >; + } + /** + * Updates the parameters of a single Analysis. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Field mask is used to specify the fields to be overwritten in the + * Analysis resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @param {google.cloud.visionai.v1alpha1.Analysis} request.analysis + * Required. The resource being updated. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/live_video_analytics.update_analysis.js + * region_tag:visionai_v1alpha1_generated_LiveVideoAnalytics_UpdateAnalysis_async + */ + updateAnalysis( + request?: protos.google.cloud.visionai.v1alpha1.IUpdateAnalysisRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IAnalysis, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + updateAnalysis( + request: protos.google.cloud.visionai.v1alpha1.IUpdateAnalysisRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IAnalysis, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + updateAnalysis( + request: protos.google.cloud.visionai.v1alpha1.IUpdateAnalysisRequest, + callback: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IAnalysis, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + updateAnalysis( + request?: protos.google.cloud.visionai.v1alpha1.IUpdateAnalysisRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IAnalysis, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IAnalysis, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IAnalysis, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'analysis.name': request.analysis!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IAnalysis, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateAnalysis response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateAnalysis request %j', request); + return this.innerApiCalls + .updateAnalysis(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IAnalysis, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateAnalysis response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `updateAnalysis()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/live_video_analytics.update_analysis.js + * region_tag:visionai_v1alpha1_generated_LiveVideoAnalytics_UpdateAnalysis_async + */ + async checkUpdateAnalysisProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.visionai.v1alpha1.Analysis, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + > + > { + this._log.info('updateAnalysis long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateAnalysis, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.visionai.v1alpha1.Analysis, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + >; + } + /** + * Deletes a single Analysis. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the resource. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/live_video_analytics.delete_analysis.js + * region_tag:visionai_v1alpha1_generated_LiveVideoAnalytics_DeleteAnalysis_async + */ + deleteAnalysis( + request?: protos.google.cloud.visionai.v1alpha1.IDeleteAnalysisRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deleteAnalysis( + request: protos.google.cloud.visionai.v1alpha1.IDeleteAnalysisRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + deleteAnalysis( + request: protos.google.cloud.visionai.v1alpha1.IDeleteAnalysisRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + deleteAnalysis( + request?: protos.google.cloud.visionai.v1alpha1.IDeleteAnalysisRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteAnalysis response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteAnalysis request %j', request); + return this.innerApiCalls + .deleteAnalysis(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteAnalysis response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `deleteAnalysis()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/live_video_analytics.delete_analysis.js + * region_tag:visionai_v1alpha1_generated_LiveVideoAnalytics_DeleteAnalysis_async + */ + async checkDeleteAnalysisProgress( + name: string, + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + > + > { + this._log.info('deleteAnalysis long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteAnalysis, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + >; + } + /** + * Lists Analyses in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListAnalysesRequest + * @param {number} request.pageSize + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} request.filter + * Filtering results + * @param {string} request.orderBy + * Hint for how to order the results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.visionai.v1alpha1.Analysis|Analysis}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listAnalysesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listAnalyses( + request?: protos.google.cloud.visionai.v1alpha1.IListAnalysesRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IAnalysis[], + protos.google.cloud.visionai.v1alpha1.IListAnalysesRequest | null, + protos.google.cloud.visionai.v1alpha1.IListAnalysesResponse, + ] + >; + listAnalyses( + request: protos.google.cloud.visionai.v1alpha1.IListAnalysesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListAnalysesRequest, + | protos.google.cloud.visionai.v1alpha1.IListAnalysesResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.IAnalysis + >, + ): void; + listAnalyses( + request: protos.google.cloud.visionai.v1alpha1.IListAnalysesRequest, + callback: PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListAnalysesRequest, + | protos.google.cloud.visionai.v1alpha1.IListAnalysesResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.IAnalysis + >, + ): void; + listAnalyses( + request?: protos.google.cloud.visionai.v1alpha1.IListAnalysesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListAnalysesRequest, + | protos.google.cloud.visionai.v1alpha1.IListAnalysesResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.IAnalysis + >, + callback?: PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListAnalysesRequest, + | protos.google.cloud.visionai.v1alpha1.IListAnalysesResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.IAnalysis + >, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IAnalysis[], + protos.google.cloud.visionai.v1alpha1.IListAnalysesRequest | null, + protos.google.cloud.visionai.v1alpha1.IListAnalysesResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListAnalysesRequest, + | protos.google.cloud.visionai.v1alpha1.IListAnalysesResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.IAnalysis + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listAnalyses values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listAnalyses request %j', request); + return this.innerApiCalls + .listAnalyses(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.visionai.v1alpha1.IAnalysis[], + protos.google.cloud.visionai.v1alpha1.IListAnalysesRequest | null, + protos.google.cloud.visionai.v1alpha1.IListAnalysesResponse, + ]) => { + this._log.info('listAnalyses values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listAnalyses`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListAnalysesRequest + * @param {number} request.pageSize + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} request.filter + * Filtering results + * @param {string} request.orderBy + * Hint for how to order the results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.visionai.v1alpha1.Analysis|Analysis} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listAnalysesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listAnalysesStream( + request?: protos.google.cloud.visionai.v1alpha1.IListAnalysesRequest, + options?: CallOptions, + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listAnalyses']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listAnalyses stream %j', request); + return this.descriptors.page.listAnalyses.createStream( + this.innerApiCalls.listAnalyses as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listAnalyses`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListAnalysesRequest + * @param {number} request.pageSize + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} request.filter + * Filtering results + * @param {string} request.orderBy + * Hint for how to order the results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.visionai.v1alpha1.Analysis|Analysis}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/live_video_analytics.list_analyses.js + * region_tag:visionai_v1alpha1_generated_LiveVideoAnalytics_ListAnalyses_async + */ + listAnalysesAsync( + request?: protos.google.cloud.visionai.v1alpha1.IListAnalysesRequest, + options?: CallOptions, + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listAnalyses']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listAnalyses iterate %j', request); + return this.descriptors.page.listAnalyses.asyncIterate( + this.innerApiCalls['listAnalyses'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + /** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + ): Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.getIamPolicy(request, options, callback); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + ): Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.setIamPolicy(request, options, callback); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + ): Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { + return this.iamClient.testIamPermissions(request, options, callback); + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + /** + * Lists information about the supported locations for this service. Returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions, + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions, + ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.cancelOperation(request, options, callback); + } + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified analysis resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @param {string} analysis + * @returns {string} Resource name string. + */ + analysisPath( + project: string, + location: string, + cluster: string, + analysis: string, + ) { + return this.pathTemplates.analysisPathTemplate.render({ + project: project, + location: location, + cluster: cluster, + analysis: analysis, + }); + } + + /** + * Parse the project from Analysis resource. + * + * @param {string} analysisName + * A fully-qualified path representing Analysis resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnalysisName(analysisName: string) { + return this.pathTemplates.analysisPathTemplate.match(analysisName).project; + } + + /** + * Parse the location from Analysis resource. + * + * @param {string} analysisName + * A fully-qualified path representing Analysis resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnalysisName(analysisName: string) { + return this.pathTemplates.analysisPathTemplate.match(analysisName).location; + } + + /** + * Parse the cluster from Analysis resource. + * + * @param {string} analysisName + * A fully-qualified path representing Analysis resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromAnalysisName(analysisName: string) { + return this.pathTemplates.analysisPathTemplate.match(analysisName).cluster; + } + + /** + * Parse the analysis from Analysis resource. + * + * @param {string} analysisName + * A fully-qualified path representing Analysis resource. + * @returns {string} A string representing the analysis. + */ + matchAnalysisFromAnalysisName(analysisName: string) { + return this.pathTemplates.analysisPathTemplate.match(analysisName).analysis; + } + + /** + * Return a fully-qualified annotation resource name string. + * + * @param {string} project_number + * @param {string} location + * @param {string} corpus + * @param {string} asset + * @param {string} annotation + * @returns {string} Resource name string. + */ + annotationPath( + projectNumber: string, + location: string, + corpus: string, + asset: string, + annotation: string, + ) { + return this.pathTemplates.annotationPathTemplate.render({ + project_number: projectNumber, + location: location, + corpus: corpus, + asset: asset, + annotation: annotation, + }); + } + + /** + * Parse the project_number from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the project_number. + */ + matchProjectNumberFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .project_number; + } + + /** + * Parse the location from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .location; + } + + /** + * Parse the corpus from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the corpus. + */ + matchCorpusFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .corpus; + } + + /** + * Parse the asset from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the asset. + */ + matchAssetFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .asset; + } + + /** + * Parse the annotation from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the annotation. + */ + matchAnnotationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .annotation; + } + + /** + * Return a fully-qualified application resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} application + * @returns {string} Resource name string. + */ + applicationPath(project: string, location: string, application: string) { + return this.pathTemplates.applicationPathTemplate.render({ + project: project, + location: location, + application: application, + }); + } + + /** + * Parse the project from Application resource. + * + * @param {string} applicationName + * A fully-qualified path representing Application resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApplicationName(applicationName: string) { + return this.pathTemplates.applicationPathTemplate.match(applicationName) + .project; + } + + /** + * Parse the location from Application resource. + * + * @param {string} applicationName + * A fully-qualified path representing Application resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApplicationName(applicationName: string) { + return this.pathTemplates.applicationPathTemplate.match(applicationName) + .location; + } + + /** + * Parse the application from Application resource. + * + * @param {string} applicationName + * A fully-qualified path representing Application resource. + * @returns {string} A string representing the application. + */ + matchApplicationFromApplicationName(applicationName: string) { + return this.pathTemplates.applicationPathTemplate.match(applicationName) + .application; + } + + /** + * Return a fully-qualified asset resource name string. + * + * @param {string} project_number + * @param {string} location + * @param {string} corpus + * @param {string} asset + * @returns {string} Resource name string. + */ + assetPath( + projectNumber: string, + location: string, + corpus: string, + asset: string, + ) { + return this.pathTemplates.assetPathTemplate.render({ + project_number: projectNumber, + location: location, + corpus: corpus, + asset: asset, + }); + } + + /** + * Parse the project_number from Asset resource. + * + * @param {string} assetName + * A fully-qualified path representing Asset resource. + * @returns {string} A string representing the project_number. + */ + matchProjectNumberFromAssetName(assetName: string) { + return this.pathTemplates.assetPathTemplate.match(assetName).project_number; + } + + /** + * Parse the location from Asset resource. + * + * @param {string} assetName + * A fully-qualified path representing Asset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAssetName(assetName: string) { + return this.pathTemplates.assetPathTemplate.match(assetName).location; + } + + /** + * Parse the corpus from Asset resource. + * + * @param {string} assetName + * A fully-qualified path representing Asset resource. + * @returns {string} A string representing the corpus. + */ + matchCorpusFromAssetName(assetName: string) { + return this.pathTemplates.assetPathTemplate.match(assetName).corpus; + } + + /** + * Parse the asset from Asset resource. + * + * @param {string} assetName + * A fully-qualified path representing Asset resource. + * @returns {string} A string representing the asset. + */ + matchAssetFromAssetName(assetName: string) { + return this.pathTemplates.assetPathTemplate.match(assetName).asset; + } + + /** + * Return a fully-qualified channel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @param {string} channel + * @returns {string} Resource name string. + */ + channelPath( + project: string, + location: string, + cluster: string, + channel: string, + ) { + return this.pathTemplates.channelPathTemplate.render({ + project: project, + location: location, + cluster: cluster, + channel: channel, + }); + } + + /** + * Parse the project from Channel resource. + * + * @param {string} channelName + * A fully-qualified path representing Channel resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChannelName(channelName: string) { + return this.pathTemplates.channelPathTemplate.match(channelName).project; + } + + /** + * Parse the location from Channel resource. + * + * @param {string} channelName + * A fully-qualified path representing Channel resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChannelName(channelName: string) { + return this.pathTemplates.channelPathTemplate.match(channelName).location; + } + + /** + * Parse the cluster from Channel resource. + * + * @param {string} channelName + * A fully-qualified path representing Channel resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromChannelName(channelName: string) { + return this.pathTemplates.channelPathTemplate.match(channelName).cluster; + } + + /** + * Parse the channel from Channel resource. + * + * @param {string} channelName + * A fully-qualified path representing Channel resource. + * @returns {string} A string representing the channel. + */ + matchChannelFromChannelName(channelName: string) { + return this.pathTemplates.channelPathTemplate.match(channelName).channel; + } + + /** + * Return a fully-qualified cluster resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @returns {string} Resource name string. + */ + clusterPath(project: string, location: string, cluster: string) { + return this.pathTemplates.clusterPathTemplate.render({ + project: project, + location: location, + cluster: cluster, + }); + } + + /** + * Parse the project from Cluster resource. + * + * @param {string} clusterName + * A fully-qualified path representing Cluster resource. + * @returns {string} A string representing the project. + */ + matchProjectFromClusterName(clusterName: string) { + return this.pathTemplates.clusterPathTemplate.match(clusterName).project; + } + + /** + * Parse the location from Cluster resource. + * + * @param {string} clusterName + * A fully-qualified path representing Cluster resource. + * @returns {string} A string representing the location. + */ + matchLocationFromClusterName(clusterName: string) { + return this.pathTemplates.clusterPathTemplate.match(clusterName).location; + } + + /** + * Parse the cluster from Cluster resource. + * + * @param {string} clusterName + * A fully-qualified path representing Cluster resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromClusterName(clusterName: string) { + return this.pathTemplates.clusterPathTemplate.match(clusterName).cluster; + } + + /** + * Return a fully-qualified corpus resource name string. + * + * @param {string} project_number + * @param {string} location + * @param {string} corpus + * @returns {string} Resource name string. + */ + corpusPath(projectNumber: string, location: string, corpus: string) { + return this.pathTemplates.corpusPathTemplate.render({ + project_number: projectNumber, + location: location, + corpus: corpus, + }); + } + + /** + * Parse the project_number from Corpus resource. + * + * @param {string} corpusName + * A fully-qualified path representing Corpus resource. + * @returns {string} A string representing the project_number. + */ + matchProjectNumberFromCorpusName(corpusName: string) { + return this.pathTemplates.corpusPathTemplate.match(corpusName) + .project_number; + } + + /** + * Parse the location from Corpus resource. + * + * @param {string} corpusName + * A fully-qualified path representing Corpus resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCorpusName(corpusName: string) { + return this.pathTemplates.corpusPathTemplate.match(corpusName).location; + } + + /** + * Parse the corpus from Corpus resource. + * + * @param {string} corpusName + * A fully-qualified path representing Corpus resource. + * @returns {string} A string representing the corpus. + */ + matchCorpusFromCorpusName(corpusName: string) { + return this.pathTemplates.corpusPathTemplate.match(corpusName).corpus; + } + + /** + * Return a fully-qualified dataSchema resource name string. + * + * @param {string} project_number + * @param {string} location + * @param {string} corpus + * @param {string} data_schema + * @returns {string} Resource name string. + */ + dataSchemaPath( + projectNumber: string, + location: string, + corpus: string, + dataSchema: string, + ) { + return this.pathTemplates.dataSchemaPathTemplate.render({ + project_number: projectNumber, + location: location, + corpus: corpus, + data_schema: dataSchema, + }); + } + + /** + * Parse the project_number from DataSchema resource. + * + * @param {string} dataSchemaName + * A fully-qualified path representing DataSchema resource. + * @returns {string} A string representing the project_number. + */ + matchProjectNumberFromDataSchemaName(dataSchemaName: string) { + return this.pathTemplates.dataSchemaPathTemplate.match(dataSchemaName) + .project_number; + } + + /** + * Parse the location from DataSchema resource. + * + * @param {string} dataSchemaName + * A fully-qualified path representing DataSchema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataSchemaName(dataSchemaName: string) { + return this.pathTemplates.dataSchemaPathTemplate.match(dataSchemaName) + .location; + } + + /** + * Parse the corpus from DataSchema resource. + * + * @param {string} dataSchemaName + * A fully-qualified path representing DataSchema resource. + * @returns {string} A string representing the corpus. + */ + matchCorpusFromDataSchemaName(dataSchemaName: string) { + return this.pathTemplates.dataSchemaPathTemplate.match(dataSchemaName) + .corpus; + } + + /** + * Parse the data_schema from DataSchema resource. + * + * @param {string} dataSchemaName + * A fully-qualified path representing DataSchema resource. + * @returns {string} A string representing the data_schema. + */ + matchDataSchemaFromDataSchemaName(dataSchemaName: string) { + return this.pathTemplates.dataSchemaPathTemplate.match(dataSchemaName) + .data_schema; + } + + /** + * Return a fully-qualified draft resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} application + * @param {string} draft + * @returns {string} Resource name string. + */ + draftPath( + project: string, + location: string, + application: string, + draft: string, + ) { + return this.pathTemplates.draftPathTemplate.render({ + project: project, + location: location, + application: application, + draft: draft, + }); + } + + /** + * Parse the project from Draft resource. + * + * @param {string} draftName + * A fully-qualified path representing Draft resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDraftName(draftName: string) { + return this.pathTemplates.draftPathTemplate.match(draftName).project; + } + + /** + * Parse the location from Draft resource. + * + * @param {string} draftName + * A fully-qualified path representing Draft resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDraftName(draftName: string) { + return this.pathTemplates.draftPathTemplate.match(draftName).location; + } + + /** + * Parse the application from Draft resource. + * + * @param {string} draftName + * A fully-qualified path representing Draft resource. + * @returns {string} A string representing the application. + */ + matchApplicationFromDraftName(draftName: string) { + return this.pathTemplates.draftPathTemplate.match(draftName).application; + } + + /** + * Parse the draft from Draft resource. + * + * @param {string} draftName + * A fully-qualified path representing Draft resource. + * @returns {string} A string representing the draft. + */ + matchDraftFromDraftName(draftName: string) { + return this.pathTemplates.draftPathTemplate.match(draftName).draft; + } + + /** + * Return a fully-qualified event resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @param {string} event + * @returns {string} Resource name string. + */ + eventPath(project: string, location: string, cluster: string, event: string) { + return this.pathTemplates.eventPathTemplate.render({ + project: project, + location: location, + cluster: cluster, + event: event, + }); + } + + /** + * Parse the project from Event resource. + * + * @param {string} eventName + * A fully-qualified path representing Event resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEventName(eventName: string) { + return this.pathTemplates.eventPathTemplate.match(eventName).project; + } + + /** + * Parse the location from Event resource. + * + * @param {string} eventName + * A fully-qualified path representing Event resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEventName(eventName: string) { + return this.pathTemplates.eventPathTemplate.match(eventName).location; + } + + /** + * Parse the cluster from Event resource. + * + * @param {string} eventName + * A fully-qualified path representing Event resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromEventName(eventName: string) { + return this.pathTemplates.eventPathTemplate.match(eventName).cluster; + } + + /** + * Parse the event from Event resource. + * + * @param {string} eventName + * A fully-qualified path representing Event resource. + * @returns {string} A string representing the event. + */ + matchEventFromEventName(eventName: string) { + return this.pathTemplates.eventPathTemplate.match(eventName).event; + } + + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} application + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath( + project: string, + location: string, + application: string, + instance: string, + ) { + return this.pathTemplates.instancePathTemplate.render({ + project: project, + location: location, + application: application, + instance: instance, + }); + } + + /** + * Parse the project from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).project; + } + + /** + * Parse the location from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).location; + } + + /** + * Parse the application from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the application. + */ + matchApplicationFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName) + .application; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + + /** + * Return a fully-qualified processor resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} processor + * @returns {string} Resource name string. + */ + processorPath(project: string, location: string, processor: string) { + return this.pathTemplates.processorPathTemplate.render({ + project: project, + location: location, + processor: processor, + }); + } + + /** + * Parse the project from Processor resource. + * + * @param {string} processorName + * A fully-qualified path representing Processor resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProcessorName(processorName: string) { + return this.pathTemplates.processorPathTemplate.match(processorName) + .project; + } + + /** + * Parse the location from Processor resource. + * + * @param {string} processorName + * A fully-qualified path representing Processor resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProcessorName(processorName: string) { + return this.pathTemplates.processorPathTemplate.match(processorName) + .location; + } + + /** + * Parse the processor from Processor resource. + * + * @param {string} processorName + * A fully-qualified path representing Processor resource. + * @returns {string} A string representing the processor. + */ + matchProcessorFromProcessorName(processorName: string) { + return this.pathTemplates.processorPathTemplate.match(processorName) + .processor; + } + + /** + * Return a fully-qualified searchConfig resource name string. + * + * @param {string} project_number + * @param {string} location + * @param {string} corpus + * @param {string} search_config + * @returns {string} Resource name string. + */ + searchConfigPath( + projectNumber: string, + location: string, + corpus: string, + searchConfig: string, + ) { + return this.pathTemplates.searchConfigPathTemplate.render({ + project_number: projectNumber, + location: location, + corpus: corpus, + search_config: searchConfig, + }); + } + + /** + * Parse the project_number from SearchConfig resource. + * + * @param {string} searchConfigName + * A fully-qualified path representing SearchConfig resource. + * @returns {string} A string representing the project_number. + */ + matchProjectNumberFromSearchConfigName(searchConfigName: string) { + return this.pathTemplates.searchConfigPathTemplate.match(searchConfigName) + .project_number; + } + + /** + * Parse the location from SearchConfig resource. + * + * @param {string} searchConfigName + * A fully-qualified path representing SearchConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSearchConfigName(searchConfigName: string) { + return this.pathTemplates.searchConfigPathTemplate.match(searchConfigName) + .location; + } + + /** + * Parse the corpus from SearchConfig resource. + * + * @param {string} searchConfigName + * A fully-qualified path representing SearchConfig resource. + * @returns {string} A string representing the corpus. + */ + matchCorpusFromSearchConfigName(searchConfigName: string) { + return this.pathTemplates.searchConfigPathTemplate.match(searchConfigName) + .corpus; + } + + /** + * Parse the search_config from SearchConfig resource. + * + * @param {string} searchConfigName + * A fully-qualified path representing SearchConfig resource. + * @returns {string} A string representing the search_config. + */ + matchSearchConfigFromSearchConfigName(searchConfigName: string) { + return this.pathTemplates.searchConfigPathTemplate.match(searchConfigName) + .search_config; + } + + /** + * Return a fully-qualified series resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @param {string} series + * @returns {string} Resource name string. + */ + seriesPath( + project: string, + location: string, + cluster: string, + series: string, + ) { + return this.pathTemplates.seriesPathTemplate.render({ + project: project, + location: location, + cluster: cluster, + series: series, + }); + } + + /** + * Parse the project from Series resource. + * + * @param {string} seriesName + * A fully-qualified path representing Series resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSeriesName(seriesName: string) { + return this.pathTemplates.seriesPathTemplate.match(seriesName).project; + } + + /** + * Parse the location from Series resource. + * + * @param {string} seriesName + * A fully-qualified path representing Series resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSeriesName(seriesName: string) { + return this.pathTemplates.seriesPathTemplate.match(seriesName).location; + } + + /** + * Parse the cluster from Series resource. + * + * @param {string} seriesName + * A fully-qualified path representing Series resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromSeriesName(seriesName: string) { + return this.pathTemplates.seriesPathTemplate.match(seriesName).cluster; + } + + /** + * Parse the series from Series resource. + * + * @param {string} seriesName + * A fully-qualified path representing Series resource. + * @returns {string} A string representing the series. + */ + matchSeriesFromSeriesName(seriesName: string) { + return this.pathTemplates.seriesPathTemplate.match(seriesName).series; + } + + /** + * Return a fully-qualified stream resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @param {string} stream + * @returns {string} Resource name string. + */ + streamPath( + project: string, + location: string, + cluster: string, + stream: string, + ) { + return this.pathTemplates.streamPathTemplate.render({ + project: project, + location: location, + cluster: cluster, + stream: stream, + }); + } + + /** + * Parse the project from Stream resource. + * + * @param {string} streamName + * A fully-qualified path representing Stream resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStreamName(streamName: string) { + return this.pathTemplates.streamPathTemplate.match(streamName).project; + } + + /** + * Parse the location from Stream resource. + * + * @param {string} streamName + * A fully-qualified path representing Stream resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStreamName(streamName: string) { + return this.pathTemplates.streamPathTemplate.match(streamName).location; + } + + /** + * Parse the cluster from Stream resource. + * + * @param {string} streamName + * A fully-qualified path representing Stream resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromStreamName(streamName: string) { + return this.pathTemplates.streamPathTemplate.match(streamName).cluster; + } + + /** + * Parse the stream from Stream resource. + * + * @param {string} streamName + * A fully-qualified path representing Stream resource. + * @returns {string} A string representing the stream. + */ + matchStreamFromStreamName(streamName: string) { + return this.pathTemplates.streamPathTemplate.match(streamName).stream; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.liveVideoAnalyticsStub && !this._terminated) { + return this.liveVideoAnalyticsStub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.iamClient.close().catch((err) => { + throw err; + }); + this.locationsClient.close().catch((err) => { + throw err; + }); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-visionai/src/v1alpha1/live_video_analytics_client_config.json b/packages/google-cloud-visionai/src/v1alpha1/live_video_analytics_client_config.json new file mode 100644 index 000000000000..3d81bd583a30 --- /dev/null +++ b/packages/google-cloud-visionai/src/v1alpha1/live_video_analytics_client_config.json @@ -0,0 +1,51 @@ +{ + "interfaces": { + "google.cloud.visionai.v1alpha1.LiveVideoAnalytics": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListAnalyses": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetAnalysis": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateAnalysis": { + "timeout_millis": 300000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateAnalysis": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteAnalysis": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-visionai/src/v1alpha1/live_video_analytics_proto_list.json b/packages/google-cloud-visionai/src/v1alpha1/live_video_analytics_proto_list.json new file mode 100644 index 000000000000..437d97a901a4 --- /dev/null +++ b/packages/google-cloud-visionai/src/v1alpha1/live_video_analytics_proto_list.json @@ -0,0 +1,13 @@ +[ + "../../protos/google/cloud/visionai/v1alpha1/annotations.proto", + "../../protos/google/cloud/visionai/v1alpha1/common.proto", + "../../protos/google/cloud/visionai/v1alpha1/lva.proto", + "../../protos/google/cloud/visionai/v1alpha1/lva_resources.proto", + "../../protos/google/cloud/visionai/v1alpha1/lva_service.proto", + "../../protos/google/cloud/visionai/v1alpha1/platform.proto", + "../../protos/google/cloud/visionai/v1alpha1/streaming_resources.proto", + "../../protos/google/cloud/visionai/v1alpha1/streaming_service.proto", + "../../protos/google/cloud/visionai/v1alpha1/streams_resources.proto", + "../../protos/google/cloud/visionai/v1alpha1/streams_service.proto", + "../../protos/google/cloud/visionai/v1alpha1/warehouse.proto" +] diff --git a/packages/google-cloud-visionai/src/v1alpha1/streaming_service_client.ts b/packages/google-cloud-visionai/src/v1alpha1/streaming_service_client.ts new file mode 100644 index 000000000000..36af0be99346 --- /dev/null +++ b/packages/google-cloud-visionai/src/v1alpha1/streaming_service_client.ts @@ -0,0 +1,2159 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + IamClient, + IamProtos, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import { PassThrough } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1alpha1/streaming_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './streaming_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Streaming service for receiving and sending packets. + * @class + * @memberof v1alpha1 + */ +export class StreamingServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: { [method: string]: gax.CallSettings }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('visionai'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + iamClient: IamClient; + locationsClient: LocationsClient; + pathTemplates: { [name: string]: gax.PathTemplate }; + streamingServiceStub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of StreamingServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new StreamingServiceClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof StreamingServiceClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'visionai.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts, + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + analysisPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}/analyses/{analysis}', + ), + annotationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation}', + ), + applicationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/applications/{application}', + ), + assetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}', + ), + channelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}/channels/{channel}', + ), + clusterPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}', + ), + corpusPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project_number}/locations/{location}/corpora/{corpus}', + ), + dataSchemaPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project_number}/locations/{location}/corpora/{corpus}/dataSchemas/{data_schema}', + ), + draftPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/applications/{application}/drafts/{draft}', + ), + eventPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}/events/{event}', + ), + instancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/applications/{application}/instances/{instance}', + ), + processorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/processors/{processor}', + ), + searchConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config}', + ), + seriesPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}/series/{series}', + ), + streamPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}/streams/{stream}', + ), + }; + + // Some of the methods on this service provide streaming responses. + // Provide descriptors for these. + this.descriptors.stream = { + sendPackets: new this._gaxModule.StreamDescriptor( + this._gaxModule.StreamType.BIDI_STREAMING, + !!opts.fallback, + !!opts.gaxServerStreamingRetries, + ), + receivePackets: new this._gaxModule.StreamDescriptor( + this._gaxModule.StreamType.BIDI_STREAMING, + !!opts.fallback, + !!opts.gaxServerStreamingRetries, + ), + receiveEvents: new this._gaxModule.StreamDescriptor( + this._gaxModule.StreamType.BIDI_STREAMING, + !!opts.fallback, + !!opts.gaxServerStreamingRetries, + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.visionai.v1alpha1.StreamingService', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + { 'x-goog-api-client': clientHeader.join(' ') }, + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.streamingServiceStub) { + return this.streamingServiceStub; + } + + // Put together the "service stub" for + // google.cloud.visionai.v1alpha1.StreamingService. + this.streamingServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.visionai.v1alpha1.StreamingService', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.visionai.v1alpha1.StreamingService, + this._opts, + this._providedCustomServicePath, + ) as Promise<{ [method: string]: Function }>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const streamingServiceStubMethods = [ + 'sendPackets', + 'receivePackets', + 'receiveEvents', + 'acquireLease', + 'renewLease', + 'releaseLease', + ]; + for (const methodName of streamingServiceStubMethods) { + const callPromise = this.streamingServiceStub.then( + (stub) => + (...args: Array<{}>) => { + if (this._terminated) { + if (methodName in this.descriptors.stream) { + const stream = new PassThrough({ objectMode: true }); + setImmediate(() => { + stream.emit( + 'error', + new this._gaxModule.GoogleError( + 'The client has already been closed.', + ), + ); + }); + return stream; + } + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + }, + ); + + const descriptor = this.descriptors.stream[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback, + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.streamingServiceStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'visionai.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'visionai.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return ['https://www.googleapis.com/auth/cloud-platform']; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback, + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /** + * AcquireLease acquires a lease. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.series + * The series name. + * @param {string} request.owner + * The owner name. + * @param {google.protobuf.Duration} request.term + * The lease term. + * @param {google.cloud.visionai.v1alpha1.LeaseType} request.leaseType + * The lease type. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.visionai.v1alpha1.Lease|Lease}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/streaming_service.acquire_lease.js + * region_tag:visionai_v1alpha1_generated_StreamingService_AcquireLease_async + */ + acquireLease( + request?: protos.google.cloud.visionai.v1alpha1.IAcquireLeaseRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.ILease, + protos.google.cloud.visionai.v1alpha1.IAcquireLeaseRequest | undefined, + {} | undefined, + ] + >; + acquireLease( + request: protos.google.cloud.visionai.v1alpha1.IAcquireLeaseRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.ILease, + | protos.google.cloud.visionai.v1alpha1.IAcquireLeaseRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + acquireLease( + request: protos.google.cloud.visionai.v1alpha1.IAcquireLeaseRequest, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.ILease, + | protos.google.cloud.visionai.v1alpha1.IAcquireLeaseRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + acquireLease( + request?: protos.google.cloud.visionai.v1alpha1.IAcquireLeaseRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.visionai.v1alpha1.ILease, + | protos.google.cloud.visionai.v1alpha1.IAcquireLeaseRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.visionai.v1alpha1.ILease, + | protos.google.cloud.visionai.v1alpha1.IAcquireLeaseRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.ILease, + protos.google.cloud.visionai.v1alpha1.IAcquireLeaseRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + series: request.series ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('acquireLease request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.visionai.v1alpha1.ILease, + | protos.google.cloud.visionai.v1alpha1.IAcquireLeaseRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('acquireLease response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .acquireLease(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.visionai.v1alpha1.ILease, + ( + | protos.google.cloud.visionai.v1alpha1.IAcquireLeaseRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('acquireLease response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * RenewLease renews a lease. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.id + * Lease id. + * @param {string} request.series + * Series name. + * @param {string} request.owner + * Lease owner. + * @param {google.protobuf.Duration} request.term + * Lease term. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.visionai.v1alpha1.Lease|Lease}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/streaming_service.renew_lease.js + * region_tag:visionai_v1alpha1_generated_StreamingService_RenewLease_async + */ + renewLease( + request?: protos.google.cloud.visionai.v1alpha1.IRenewLeaseRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.ILease, + protos.google.cloud.visionai.v1alpha1.IRenewLeaseRequest | undefined, + {} | undefined, + ] + >; + renewLease( + request: protos.google.cloud.visionai.v1alpha1.IRenewLeaseRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.ILease, + | protos.google.cloud.visionai.v1alpha1.IRenewLeaseRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + renewLease( + request: protos.google.cloud.visionai.v1alpha1.IRenewLeaseRequest, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.ILease, + | protos.google.cloud.visionai.v1alpha1.IRenewLeaseRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + renewLease( + request?: protos.google.cloud.visionai.v1alpha1.IRenewLeaseRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.visionai.v1alpha1.ILease, + | protos.google.cloud.visionai.v1alpha1.IRenewLeaseRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.visionai.v1alpha1.ILease, + | protos.google.cloud.visionai.v1alpha1.IRenewLeaseRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.ILease, + protos.google.cloud.visionai.v1alpha1.IRenewLeaseRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + series: request.series ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('renewLease request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.visionai.v1alpha1.ILease, + | protos.google.cloud.visionai.v1alpha1.IRenewLeaseRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('renewLease response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .renewLease(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.visionai.v1alpha1.ILease, + protos.google.cloud.visionai.v1alpha1.IRenewLeaseRequest | undefined, + {} | undefined, + ]) => { + this._log.info('renewLease response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * RleaseLease releases a lease. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.id + * Lease id. + * @param {string} request.series + * Series name. + * @param {string} request.owner + * Lease owner. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.visionai.v1alpha1.ReleaseLeaseResponse|ReleaseLeaseResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/streaming_service.release_lease.js + * region_tag:visionai_v1alpha1_generated_StreamingService_ReleaseLease_async + */ + releaseLease( + request?: protos.google.cloud.visionai.v1alpha1.IReleaseLeaseRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IReleaseLeaseResponse, + protos.google.cloud.visionai.v1alpha1.IReleaseLeaseRequest | undefined, + {} | undefined, + ] + >; + releaseLease( + request: protos.google.cloud.visionai.v1alpha1.IReleaseLeaseRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.IReleaseLeaseResponse, + | protos.google.cloud.visionai.v1alpha1.IReleaseLeaseRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + releaseLease( + request: protos.google.cloud.visionai.v1alpha1.IReleaseLeaseRequest, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.IReleaseLeaseResponse, + | protos.google.cloud.visionai.v1alpha1.IReleaseLeaseRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + releaseLease( + request?: protos.google.cloud.visionai.v1alpha1.IReleaseLeaseRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.visionai.v1alpha1.IReleaseLeaseResponse, + | protos.google.cloud.visionai.v1alpha1.IReleaseLeaseRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.visionai.v1alpha1.IReleaseLeaseResponse, + | protos.google.cloud.visionai.v1alpha1.IReleaseLeaseRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IReleaseLeaseResponse, + protos.google.cloud.visionai.v1alpha1.IReleaseLeaseRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + series: request.series ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('releaseLease request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.visionai.v1alpha1.IReleaseLeaseResponse, + | protos.google.cloud.visionai.v1alpha1.IReleaseLeaseRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('releaseLease response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .releaseLease(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.visionai.v1alpha1.IReleaseLeaseResponse, + ( + | protos.google.cloud.visionai.v1alpha1.IReleaseLeaseRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('releaseLease response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Send packets to the series. + * + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which is both readable and writable. It accepts objects + * representing {@link protos.google.cloud.visionai.v1alpha1.SendPacketsRequest|SendPacketsRequest} for write() method, and + * will emit objects representing {@link protos.google.cloud.visionai.v1alpha1.SendPacketsResponse|SendPacketsResponse} on 'data' event asynchronously. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#bi-directional-streaming | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/streaming_service.send_packets.js + * region_tag:visionai_v1alpha1_generated_StreamingService_SendPackets_async + */ + sendPackets(options?: CallOptions): gax.CancellableStream { + this.initialize().catch((err) => { + throw err; + }); + this._log.info('sendPackets stream %j', options); + return this.innerApiCalls.sendPackets(null, options); + } + + /** + * Receive packets from the series. + * + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which is both readable and writable. It accepts objects + * representing {@link protos.google.cloud.visionai.v1alpha1.ReceivePacketsRequest|ReceivePacketsRequest} for write() method, and + * will emit objects representing {@link protos.google.cloud.visionai.v1alpha1.ReceivePacketsResponse|ReceivePacketsResponse} on 'data' event asynchronously. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#bi-directional-streaming | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/streaming_service.receive_packets.js + * region_tag:visionai_v1alpha1_generated_StreamingService_ReceivePackets_async + */ + receivePackets(options?: CallOptions): gax.CancellableStream { + this.initialize().catch((err) => { + throw err; + }); + this._log.info('receivePackets stream %j', options); + return this.innerApiCalls.receivePackets(null, options); + } + + /** + * Receive events given the stream name. + * + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which is both readable and writable. It accepts objects + * representing {@link protos.google.cloud.visionai.v1alpha1.ReceiveEventsRequest|ReceiveEventsRequest} for write() method, and + * will emit objects representing {@link protos.google.cloud.visionai.v1alpha1.ReceiveEventsResponse|ReceiveEventsResponse} on 'data' event asynchronously. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#bi-directional-streaming | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/streaming_service.receive_events.js + * region_tag:visionai_v1alpha1_generated_StreamingService_ReceiveEvents_async + */ + receiveEvents(options?: CallOptions): gax.CancellableStream { + this.initialize().catch((err) => { + throw err; + }); + this._log.info('receiveEvents stream %j', options); + return this.innerApiCalls.receiveEvents(null, options); + } + + /** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + ): Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.getIamPolicy(request, options, callback); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + ): Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.setIamPolicy(request, options, callback); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + ): Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { + return this.iamClient.testIamPermissions(request, options, callback); + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + /** + * Lists information about the supported locations for this service. Returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions, + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified analysis resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @param {string} analysis + * @returns {string} Resource name string. + */ + analysisPath( + project: string, + location: string, + cluster: string, + analysis: string, + ) { + return this.pathTemplates.analysisPathTemplate.render({ + project: project, + location: location, + cluster: cluster, + analysis: analysis, + }); + } + + /** + * Parse the project from Analysis resource. + * + * @param {string} analysisName + * A fully-qualified path representing Analysis resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnalysisName(analysisName: string) { + return this.pathTemplates.analysisPathTemplate.match(analysisName).project; + } + + /** + * Parse the location from Analysis resource. + * + * @param {string} analysisName + * A fully-qualified path representing Analysis resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnalysisName(analysisName: string) { + return this.pathTemplates.analysisPathTemplate.match(analysisName).location; + } + + /** + * Parse the cluster from Analysis resource. + * + * @param {string} analysisName + * A fully-qualified path representing Analysis resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromAnalysisName(analysisName: string) { + return this.pathTemplates.analysisPathTemplate.match(analysisName).cluster; + } + + /** + * Parse the analysis from Analysis resource. + * + * @param {string} analysisName + * A fully-qualified path representing Analysis resource. + * @returns {string} A string representing the analysis. + */ + matchAnalysisFromAnalysisName(analysisName: string) { + return this.pathTemplates.analysisPathTemplate.match(analysisName).analysis; + } + + /** + * Return a fully-qualified annotation resource name string. + * + * @param {string} project_number + * @param {string} location + * @param {string} corpus + * @param {string} asset + * @param {string} annotation + * @returns {string} Resource name string. + */ + annotationPath( + projectNumber: string, + location: string, + corpus: string, + asset: string, + annotation: string, + ) { + return this.pathTemplates.annotationPathTemplate.render({ + project_number: projectNumber, + location: location, + corpus: corpus, + asset: asset, + annotation: annotation, + }); + } + + /** + * Parse the project_number from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the project_number. + */ + matchProjectNumberFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .project_number; + } + + /** + * Parse the location from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .location; + } + + /** + * Parse the corpus from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the corpus. + */ + matchCorpusFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .corpus; + } + + /** + * Parse the asset from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the asset. + */ + matchAssetFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .asset; + } + + /** + * Parse the annotation from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the annotation. + */ + matchAnnotationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .annotation; + } + + /** + * Return a fully-qualified application resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} application + * @returns {string} Resource name string. + */ + applicationPath(project: string, location: string, application: string) { + return this.pathTemplates.applicationPathTemplate.render({ + project: project, + location: location, + application: application, + }); + } + + /** + * Parse the project from Application resource. + * + * @param {string} applicationName + * A fully-qualified path representing Application resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApplicationName(applicationName: string) { + return this.pathTemplates.applicationPathTemplate.match(applicationName) + .project; + } + + /** + * Parse the location from Application resource. + * + * @param {string} applicationName + * A fully-qualified path representing Application resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApplicationName(applicationName: string) { + return this.pathTemplates.applicationPathTemplate.match(applicationName) + .location; + } + + /** + * Parse the application from Application resource. + * + * @param {string} applicationName + * A fully-qualified path representing Application resource. + * @returns {string} A string representing the application. + */ + matchApplicationFromApplicationName(applicationName: string) { + return this.pathTemplates.applicationPathTemplate.match(applicationName) + .application; + } + + /** + * Return a fully-qualified asset resource name string. + * + * @param {string} project_number + * @param {string} location + * @param {string} corpus + * @param {string} asset + * @returns {string} Resource name string. + */ + assetPath( + projectNumber: string, + location: string, + corpus: string, + asset: string, + ) { + return this.pathTemplates.assetPathTemplate.render({ + project_number: projectNumber, + location: location, + corpus: corpus, + asset: asset, + }); + } + + /** + * Parse the project_number from Asset resource. + * + * @param {string} assetName + * A fully-qualified path representing Asset resource. + * @returns {string} A string representing the project_number. + */ + matchProjectNumberFromAssetName(assetName: string) { + return this.pathTemplates.assetPathTemplate.match(assetName).project_number; + } + + /** + * Parse the location from Asset resource. + * + * @param {string} assetName + * A fully-qualified path representing Asset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAssetName(assetName: string) { + return this.pathTemplates.assetPathTemplate.match(assetName).location; + } + + /** + * Parse the corpus from Asset resource. + * + * @param {string} assetName + * A fully-qualified path representing Asset resource. + * @returns {string} A string representing the corpus. + */ + matchCorpusFromAssetName(assetName: string) { + return this.pathTemplates.assetPathTemplate.match(assetName).corpus; + } + + /** + * Parse the asset from Asset resource. + * + * @param {string} assetName + * A fully-qualified path representing Asset resource. + * @returns {string} A string representing the asset. + */ + matchAssetFromAssetName(assetName: string) { + return this.pathTemplates.assetPathTemplate.match(assetName).asset; + } + + /** + * Return a fully-qualified channel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @param {string} channel + * @returns {string} Resource name string. + */ + channelPath( + project: string, + location: string, + cluster: string, + channel: string, + ) { + return this.pathTemplates.channelPathTemplate.render({ + project: project, + location: location, + cluster: cluster, + channel: channel, + }); + } + + /** + * Parse the project from Channel resource. + * + * @param {string} channelName + * A fully-qualified path representing Channel resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChannelName(channelName: string) { + return this.pathTemplates.channelPathTemplate.match(channelName).project; + } + + /** + * Parse the location from Channel resource. + * + * @param {string} channelName + * A fully-qualified path representing Channel resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChannelName(channelName: string) { + return this.pathTemplates.channelPathTemplate.match(channelName).location; + } + + /** + * Parse the cluster from Channel resource. + * + * @param {string} channelName + * A fully-qualified path representing Channel resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromChannelName(channelName: string) { + return this.pathTemplates.channelPathTemplate.match(channelName).cluster; + } + + /** + * Parse the channel from Channel resource. + * + * @param {string} channelName + * A fully-qualified path representing Channel resource. + * @returns {string} A string representing the channel. + */ + matchChannelFromChannelName(channelName: string) { + return this.pathTemplates.channelPathTemplate.match(channelName).channel; + } + + /** + * Return a fully-qualified cluster resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @returns {string} Resource name string. + */ + clusterPath(project: string, location: string, cluster: string) { + return this.pathTemplates.clusterPathTemplate.render({ + project: project, + location: location, + cluster: cluster, + }); + } + + /** + * Parse the project from Cluster resource. + * + * @param {string} clusterName + * A fully-qualified path representing Cluster resource. + * @returns {string} A string representing the project. + */ + matchProjectFromClusterName(clusterName: string) { + return this.pathTemplates.clusterPathTemplate.match(clusterName).project; + } + + /** + * Parse the location from Cluster resource. + * + * @param {string} clusterName + * A fully-qualified path representing Cluster resource. + * @returns {string} A string representing the location. + */ + matchLocationFromClusterName(clusterName: string) { + return this.pathTemplates.clusterPathTemplate.match(clusterName).location; + } + + /** + * Parse the cluster from Cluster resource. + * + * @param {string} clusterName + * A fully-qualified path representing Cluster resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromClusterName(clusterName: string) { + return this.pathTemplates.clusterPathTemplate.match(clusterName).cluster; + } + + /** + * Return a fully-qualified corpus resource name string. + * + * @param {string} project_number + * @param {string} location + * @param {string} corpus + * @returns {string} Resource name string. + */ + corpusPath(projectNumber: string, location: string, corpus: string) { + return this.pathTemplates.corpusPathTemplate.render({ + project_number: projectNumber, + location: location, + corpus: corpus, + }); + } + + /** + * Parse the project_number from Corpus resource. + * + * @param {string} corpusName + * A fully-qualified path representing Corpus resource. + * @returns {string} A string representing the project_number. + */ + matchProjectNumberFromCorpusName(corpusName: string) { + return this.pathTemplates.corpusPathTemplate.match(corpusName) + .project_number; + } + + /** + * Parse the location from Corpus resource. + * + * @param {string} corpusName + * A fully-qualified path representing Corpus resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCorpusName(corpusName: string) { + return this.pathTemplates.corpusPathTemplate.match(corpusName).location; + } + + /** + * Parse the corpus from Corpus resource. + * + * @param {string} corpusName + * A fully-qualified path representing Corpus resource. + * @returns {string} A string representing the corpus. + */ + matchCorpusFromCorpusName(corpusName: string) { + return this.pathTemplates.corpusPathTemplate.match(corpusName).corpus; + } + + /** + * Return a fully-qualified dataSchema resource name string. + * + * @param {string} project_number + * @param {string} location + * @param {string} corpus + * @param {string} data_schema + * @returns {string} Resource name string. + */ + dataSchemaPath( + projectNumber: string, + location: string, + corpus: string, + dataSchema: string, + ) { + return this.pathTemplates.dataSchemaPathTemplate.render({ + project_number: projectNumber, + location: location, + corpus: corpus, + data_schema: dataSchema, + }); + } + + /** + * Parse the project_number from DataSchema resource. + * + * @param {string} dataSchemaName + * A fully-qualified path representing DataSchema resource. + * @returns {string} A string representing the project_number. + */ + matchProjectNumberFromDataSchemaName(dataSchemaName: string) { + return this.pathTemplates.dataSchemaPathTemplate.match(dataSchemaName) + .project_number; + } + + /** + * Parse the location from DataSchema resource. + * + * @param {string} dataSchemaName + * A fully-qualified path representing DataSchema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataSchemaName(dataSchemaName: string) { + return this.pathTemplates.dataSchemaPathTemplate.match(dataSchemaName) + .location; + } + + /** + * Parse the corpus from DataSchema resource. + * + * @param {string} dataSchemaName + * A fully-qualified path representing DataSchema resource. + * @returns {string} A string representing the corpus. + */ + matchCorpusFromDataSchemaName(dataSchemaName: string) { + return this.pathTemplates.dataSchemaPathTemplate.match(dataSchemaName) + .corpus; + } + + /** + * Parse the data_schema from DataSchema resource. + * + * @param {string} dataSchemaName + * A fully-qualified path representing DataSchema resource. + * @returns {string} A string representing the data_schema. + */ + matchDataSchemaFromDataSchemaName(dataSchemaName: string) { + return this.pathTemplates.dataSchemaPathTemplate.match(dataSchemaName) + .data_schema; + } + + /** + * Return a fully-qualified draft resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} application + * @param {string} draft + * @returns {string} Resource name string. + */ + draftPath( + project: string, + location: string, + application: string, + draft: string, + ) { + return this.pathTemplates.draftPathTemplate.render({ + project: project, + location: location, + application: application, + draft: draft, + }); + } + + /** + * Parse the project from Draft resource. + * + * @param {string} draftName + * A fully-qualified path representing Draft resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDraftName(draftName: string) { + return this.pathTemplates.draftPathTemplate.match(draftName).project; + } + + /** + * Parse the location from Draft resource. + * + * @param {string} draftName + * A fully-qualified path representing Draft resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDraftName(draftName: string) { + return this.pathTemplates.draftPathTemplate.match(draftName).location; + } + + /** + * Parse the application from Draft resource. + * + * @param {string} draftName + * A fully-qualified path representing Draft resource. + * @returns {string} A string representing the application. + */ + matchApplicationFromDraftName(draftName: string) { + return this.pathTemplates.draftPathTemplate.match(draftName).application; + } + + /** + * Parse the draft from Draft resource. + * + * @param {string} draftName + * A fully-qualified path representing Draft resource. + * @returns {string} A string representing the draft. + */ + matchDraftFromDraftName(draftName: string) { + return this.pathTemplates.draftPathTemplate.match(draftName).draft; + } + + /** + * Return a fully-qualified event resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @param {string} event + * @returns {string} Resource name string. + */ + eventPath(project: string, location: string, cluster: string, event: string) { + return this.pathTemplates.eventPathTemplate.render({ + project: project, + location: location, + cluster: cluster, + event: event, + }); + } + + /** + * Parse the project from Event resource. + * + * @param {string} eventName + * A fully-qualified path representing Event resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEventName(eventName: string) { + return this.pathTemplates.eventPathTemplate.match(eventName).project; + } + + /** + * Parse the location from Event resource. + * + * @param {string} eventName + * A fully-qualified path representing Event resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEventName(eventName: string) { + return this.pathTemplates.eventPathTemplate.match(eventName).location; + } + + /** + * Parse the cluster from Event resource. + * + * @param {string} eventName + * A fully-qualified path representing Event resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromEventName(eventName: string) { + return this.pathTemplates.eventPathTemplate.match(eventName).cluster; + } + + /** + * Parse the event from Event resource. + * + * @param {string} eventName + * A fully-qualified path representing Event resource. + * @returns {string} A string representing the event. + */ + matchEventFromEventName(eventName: string) { + return this.pathTemplates.eventPathTemplate.match(eventName).event; + } + + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} application + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath( + project: string, + location: string, + application: string, + instance: string, + ) { + return this.pathTemplates.instancePathTemplate.render({ + project: project, + location: location, + application: application, + instance: instance, + }); + } + + /** + * Parse the project from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).project; + } + + /** + * Parse the location from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).location; + } + + /** + * Parse the application from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the application. + */ + matchApplicationFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName) + .application; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + + /** + * Return a fully-qualified processor resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} processor + * @returns {string} Resource name string. + */ + processorPath(project: string, location: string, processor: string) { + return this.pathTemplates.processorPathTemplate.render({ + project: project, + location: location, + processor: processor, + }); + } + + /** + * Parse the project from Processor resource. + * + * @param {string} processorName + * A fully-qualified path representing Processor resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProcessorName(processorName: string) { + return this.pathTemplates.processorPathTemplate.match(processorName) + .project; + } + + /** + * Parse the location from Processor resource. + * + * @param {string} processorName + * A fully-qualified path representing Processor resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProcessorName(processorName: string) { + return this.pathTemplates.processorPathTemplate.match(processorName) + .location; + } + + /** + * Parse the processor from Processor resource. + * + * @param {string} processorName + * A fully-qualified path representing Processor resource. + * @returns {string} A string representing the processor. + */ + matchProcessorFromProcessorName(processorName: string) { + return this.pathTemplates.processorPathTemplate.match(processorName) + .processor; + } + + /** + * Return a fully-qualified searchConfig resource name string. + * + * @param {string} project_number + * @param {string} location + * @param {string} corpus + * @param {string} search_config + * @returns {string} Resource name string. + */ + searchConfigPath( + projectNumber: string, + location: string, + corpus: string, + searchConfig: string, + ) { + return this.pathTemplates.searchConfigPathTemplate.render({ + project_number: projectNumber, + location: location, + corpus: corpus, + search_config: searchConfig, + }); + } + + /** + * Parse the project_number from SearchConfig resource. + * + * @param {string} searchConfigName + * A fully-qualified path representing SearchConfig resource. + * @returns {string} A string representing the project_number. + */ + matchProjectNumberFromSearchConfigName(searchConfigName: string) { + return this.pathTemplates.searchConfigPathTemplate.match(searchConfigName) + .project_number; + } + + /** + * Parse the location from SearchConfig resource. + * + * @param {string} searchConfigName + * A fully-qualified path representing SearchConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSearchConfigName(searchConfigName: string) { + return this.pathTemplates.searchConfigPathTemplate.match(searchConfigName) + .location; + } + + /** + * Parse the corpus from SearchConfig resource. + * + * @param {string} searchConfigName + * A fully-qualified path representing SearchConfig resource. + * @returns {string} A string representing the corpus. + */ + matchCorpusFromSearchConfigName(searchConfigName: string) { + return this.pathTemplates.searchConfigPathTemplate.match(searchConfigName) + .corpus; + } + + /** + * Parse the search_config from SearchConfig resource. + * + * @param {string} searchConfigName + * A fully-qualified path representing SearchConfig resource. + * @returns {string} A string representing the search_config. + */ + matchSearchConfigFromSearchConfigName(searchConfigName: string) { + return this.pathTemplates.searchConfigPathTemplate.match(searchConfigName) + .search_config; + } + + /** + * Return a fully-qualified series resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @param {string} series + * @returns {string} Resource name string. + */ + seriesPath( + project: string, + location: string, + cluster: string, + series: string, + ) { + return this.pathTemplates.seriesPathTemplate.render({ + project: project, + location: location, + cluster: cluster, + series: series, + }); + } + + /** + * Parse the project from Series resource. + * + * @param {string} seriesName + * A fully-qualified path representing Series resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSeriesName(seriesName: string) { + return this.pathTemplates.seriesPathTemplate.match(seriesName).project; + } + + /** + * Parse the location from Series resource. + * + * @param {string} seriesName + * A fully-qualified path representing Series resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSeriesName(seriesName: string) { + return this.pathTemplates.seriesPathTemplate.match(seriesName).location; + } + + /** + * Parse the cluster from Series resource. + * + * @param {string} seriesName + * A fully-qualified path representing Series resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromSeriesName(seriesName: string) { + return this.pathTemplates.seriesPathTemplate.match(seriesName).cluster; + } + + /** + * Parse the series from Series resource. + * + * @param {string} seriesName + * A fully-qualified path representing Series resource. + * @returns {string} A string representing the series. + */ + matchSeriesFromSeriesName(seriesName: string) { + return this.pathTemplates.seriesPathTemplate.match(seriesName).series; + } + + /** + * Return a fully-qualified stream resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @param {string} stream + * @returns {string} Resource name string. + */ + streamPath( + project: string, + location: string, + cluster: string, + stream: string, + ) { + return this.pathTemplates.streamPathTemplate.render({ + project: project, + location: location, + cluster: cluster, + stream: stream, + }); + } + + /** + * Parse the project from Stream resource. + * + * @param {string} streamName + * A fully-qualified path representing Stream resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStreamName(streamName: string) { + return this.pathTemplates.streamPathTemplate.match(streamName).project; + } + + /** + * Parse the location from Stream resource. + * + * @param {string} streamName + * A fully-qualified path representing Stream resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStreamName(streamName: string) { + return this.pathTemplates.streamPathTemplate.match(streamName).location; + } + + /** + * Parse the cluster from Stream resource. + * + * @param {string} streamName + * A fully-qualified path representing Stream resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromStreamName(streamName: string) { + return this.pathTemplates.streamPathTemplate.match(streamName).cluster; + } + + /** + * Parse the stream from Stream resource. + * + * @param {string} streamName + * A fully-qualified path representing Stream resource. + * @returns {string} A string representing the stream. + */ + matchStreamFromStreamName(streamName: string) { + return this.pathTemplates.streamPathTemplate.match(streamName).stream; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.streamingServiceStub && !this._terminated) { + return this.streamingServiceStub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.iamClient.close().catch((err) => { + throw err; + }); + this.locationsClient.close().catch((err) => { + throw err; + }); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-visionai/src/v1alpha1/streaming_service_client_config.json b/packages/google-cloud-visionai/src/v1alpha1/streaming_service_client_config.json new file mode 100644 index 000000000000..1972253c13be --- /dev/null +++ b/packages/google-cloud-visionai/src/v1alpha1/streaming_service_client_config.json @@ -0,0 +1,50 @@ +{ + "interfaces": { + "google.cloud.visionai.v1alpha1.StreamingService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "SendPackets": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ReceivePackets": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ReceiveEvents": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "AcquireLease": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RenewLease": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ReleaseLease": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-visionai/src/v1alpha1/streaming_service_proto_list.json b/packages/google-cloud-visionai/src/v1alpha1/streaming_service_proto_list.json new file mode 100644 index 000000000000..437d97a901a4 --- /dev/null +++ b/packages/google-cloud-visionai/src/v1alpha1/streaming_service_proto_list.json @@ -0,0 +1,13 @@ +[ + "../../protos/google/cloud/visionai/v1alpha1/annotations.proto", + "../../protos/google/cloud/visionai/v1alpha1/common.proto", + "../../protos/google/cloud/visionai/v1alpha1/lva.proto", + "../../protos/google/cloud/visionai/v1alpha1/lva_resources.proto", + "../../protos/google/cloud/visionai/v1alpha1/lva_service.proto", + "../../protos/google/cloud/visionai/v1alpha1/platform.proto", + "../../protos/google/cloud/visionai/v1alpha1/streaming_resources.proto", + "../../protos/google/cloud/visionai/v1alpha1/streaming_service.proto", + "../../protos/google/cloud/visionai/v1alpha1/streams_resources.proto", + "../../protos/google/cloud/visionai/v1alpha1/streams_service.proto", + "../../protos/google/cloud/visionai/v1alpha1/warehouse.proto" +] diff --git a/packages/google-cloud-visionai/src/v1alpha1/streams_service_client.ts b/packages/google-cloud-visionai/src/v1alpha1/streams_service_client.ts new file mode 100644 index 000000000000..1f9ea48bc0ac --- /dev/null +++ b/packages/google-cloud-visionai/src/v1alpha1/streams_service_client.ts @@ -0,0 +1,6297 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + GrpcClientOptions, + LROperation, + PaginationCallback, + GaxCall, + IamClient, + IamProtos, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import { Transform } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1alpha1/streams_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './streams_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service describing handlers for resources. + * Vision API and Vision AI API are two independent APIs developed by the same + * team. Vision API is for people to annotate their image while Vision AI is an + * e2e solution for customer to build their own computer vision application. + * @class + * @memberof v1alpha1 + */ +export class StreamsServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: { [method: string]: gax.CallSettings }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('visionai'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + iamClient: IamClient; + locationsClient: LocationsClient; + pathTemplates: { [name: string]: gax.PathTemplate }; + operationsClient: gax.OperationsClient; + streamsServiceStub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of StreamsServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new StreamsServiceClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof StreamsServiceClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'visionai.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts, + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + analysisPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}/analyses/{analysis}', + ), + annotationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation}', + ), + applicationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/applications/{application}', + ), + assetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}', + ), + channelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}/channels/{channel}', + ), + clusterPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}', + ), + corpusPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project_number}/locations/{location}/corpora/{corpus}', + ), + dataSchemaPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project_number}/locations/{location}/corpora/{corpus}/dataSchemas/{data_schema}', + ), + draftPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/applications/{application}/drafts/{draft}', + ), + eventPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}/events/{event}', + ), + instancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/applications/{application}/instances/{instance}', + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}', + ), + processorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/processors/{processor}', + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}', + ), + searchConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config}', + ), + seriesPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}/series/{series}', + ), + streamPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}/streams/{stream}', + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listClusters: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'clusters', + ), + listStreams: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'streams', + ), + listEvents: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'events', + ), + listSeries: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'series', + ), + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/v1alpha1/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v1alpha1/{name=projects/*}/locations', + }, + { + selector: 'google.iam.v1.IAMPolicy.GetIamPolicy', + get: '/v1alpha1/{resource=projects/*/locations/*/clusters/*}:getIamPolicy', + additional_bindings: [ + { + get: '/v1alpha1/{resource=projects/*/locations/*/clusters/*/streams/*}:getIamPolicy', + }, + { + get: '/v1alpha1/{resource=projects/*/locations/*/clusters/*/events/*}:getIamPolicy', + }, + { + get: '/v1alpha1/{resource=projects/*/locations/*/clusters/*/series/*}:getIamPolicy', + }, + { + get: '/v1alpha1/{resource=projects/*/locations/*/operators/*}:getIamPolicy', + }, + { + get: '/v1alpha1/{resource=projects/*/locations/*/operators/*/versions/*}:getIamPolicy', + }, + { + get: '/v1alpha1/{resource=projects/*/locations/*/clusters/*/analyses/*}:getIamPolicy', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.SetIamPolicy', + post: '/v1alpha1/{resource=projects/*/locations/*/clusters/*}:setIamPolicy', + body: '*', + additional_bindings: [ + { + post: '/v1alpha1/{resource=projects/*/locations/*/clusters/*/streams/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1alpha1/{resource=projects/*/locations/*/clusters/*/events/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1alpha1/{resource=projects/*/locations/*/clusters/*/series/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1alpha1/{resource=projects/*/locations/*/operators/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1alpha1/{resource=projects/*/locations/*/operators/*/versions/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1alpha1/{resource=projects/*/locations/*/clusters/*/analyses/*}:setIamPolicy', + body: '*', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.TestIamPermissions', + post: '/v1alpha1/{resource=projects/*/locations/*/clusters/*}:testIamPermissions', + body: '*', + additional_bindings: [ + { + post: '/v1alpha1/{resource=projects/*/locations/*/clusters/*/streams/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1alpha1/{resource=projects/*/locations/*/clusters/*/events/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1alpha1/{resource=projects/*/locations/*/clusters/*/series/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1alpha1/{resource=projects/*/locations/*/operators/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1alpha1/{resource=projects/*/locations/*/operators/*/versions/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1alpha1/{resource=projects/*/locations/*/clusters/*/analyses/*}:testIamPermissions', + body: '*', + }, + ], + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1alpha1/{name=projects/*/locations/*/operations/*}:cancel', + body: '*', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1alpha1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1alpha1/{name=projects/*/locations/*/operations/*}', + additional_bindings: [ + { + get: '/v1alpha1/{name=projects/*/locations/*/warehouseOperations/*}', + }, + { + get: '/v1alpha1/{name=projects/*/locations/*/corpora/*/assets/*/operations/*}', + }, + ], + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1alpha1/{name=projects/*/locations/*}/operations', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const createClusterResponse = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.Cluster', + ) as gax.protobuf.Type; + const createClusterMetadata = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.OperationMetadata', + ) as gax.protobuf.Type; + const updateClusterResponse = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.Cluster', + ) as gax.protobuf.Type; + const updateClusterMetadata = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.OperationMetadata', + ) as gax.protobuf.Type; + const deleteClusterResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty', + ) as gax.protobuf.Type; + const deleteClusterMetadata = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.OperationMetadata', + ) as gax.protobuf.Type; + const createStreamResponse = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.Stream', + ) as gax.protobuf.Type; + const createStreamMetadata = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.OperationMetadata', + ) as gax.protobuf.Type; + const updateStreamResponse = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.Stream', + ) as gax.protobuf.Type; + const updateStreamMetadata = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.OperationMetadata', + ) as gax.protobuf.Type; + const deleteStreamResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty', + ) as gax.protobuf.Type; + const deleteStreamMetadata = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.OperationMetadata', + ) as gax.protobuf.Type; + const createEventResponse = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.Event', + ) as gax.protobuf.Type; + const createEventMetadata = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.OperationMetadata', + ) as gax.protobuf.Type; + const updateEventResponse = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.Event', + ) as gax.protobuf.Type; + const updateEventMetadata = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.OperationMetadata', + ) as gax.protobuf.Type; + const deleteEventResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty', + ) as gax.protobuf.Type; + const deleteEventMetadata = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.OperationMetadata', + ) as gax.protobuf.Type; + const createSeriesResponse = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.Series', + ) as gax.protobuf.Type; + const createSeriesMetadata = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.OperationMetadata', + ) as gax.protobuf.Type; + const updateSeriesResponse = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.Series', + ) as gax.protobuf.Type; + const updateSeriesMetadata = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.OperationMetadata', + ) as gax.protobuf.Type; + const deleteSeriesResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty', + ) as gax.protobuf.Type; + const deleteSeriesMetadata = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.OperationMetadata', + ) as gax.protobuf.Type; + const materializeChannelResponse = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.Channel', + ) as gax.protobuf.Type; + const materializeChannelMetadata = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.OperationMetadata', + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createClusterResponse.decode.bind(createClusterResponse), + createClusterMetadata.decode.bind(createClusterMetadata), + ), + updateCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateClusterResponse.decode.bind(updateClusterResponse), + updateClusterMetadata.decode.bind(updateClusterMetadata), + ), + deleteCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteClusterResponse.decode.bind(deleteClusterResponse), + deleteClusterMetadata.decode.bind(deleteClusterMetadata), + ), + createStream: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createStreamResponse.decode.bind(createStreamResponse), + createStreamMetadata.decode.bind(createStreamMetadata), + ), + updateStream: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateStreamResponse.decode.bind(updateStreamResponse), + updateStreamMetadata.decode.bind(updateStreamMetadata), + ), + deleteStream: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteStreamResponse.decode.bind(deleteStreamResponse), + deleteStreamMetadata.decode.bind(deleteStreamMetadata), + ), + createEvent: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createEventResponse.decode.bind(createEventResponse), + createEventMetadata.decode.bind(createEventMetadata), + ), + updateEvent: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateEventResponse.decode.bind(updateEventResponse), + updateEventMetadata.decode.bind(updateEventMetadata), + ), + deleteEvent: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteEventResponse.decode.bind(deleteEventResponse), + deleteEventMetadata.decode.bind(deleteEventMetadata), + ), + createSeries: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createSeriesResponse.decode.bind(createSeriesResponse), + createSeriesMetadata.decode.bind(createSeriesMetadata), + ), + updateSeries: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateSeriesResponse.decode.bind(updateSeriesResponse), + updateSeriesMetadata.decode.bind(updateSeriesMetadata), + ), + deleteSeries: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteSeriesResponse.decode.bind(deleteSeriesResponse), + deleteSeriesMetadata.decode.bind(deleteSeriesMetadata), + ), + materializeChannel: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + materializeChannelResponse.decode.bind(materializeChannelResponse), + materializeChannelMetadata.decode.bind(materializeChannelMetadata), + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.visionai.v1alpha1.StreamsService', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + { 'x-goog-api-client': clientHeader.join(' ') }, + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.streamsServiceStub) { + return this.streamsServiceStub; + } + + // Put together the "service stub" for + // google.cloud.visionai.v1alpha1.StreamsService. + this.streamsServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.visionai.v1alpha1.StreamsService', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.visionai.v1alpha1.StreamsService, + this._opts, + this._providedCustomServicePath, + ) as Promise<{ [method: string]: Function }>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const streamsServiceStubMethods = [ + 'listClusters', + 'getCluster', + 'createCluster', + 'updateCluster', + 'deleteCluster', + 'listStreams', + 'getStream', + 'createStream', + 'updateStream', + 'deleteStream', + 'generateStreamHlsToken', + 'listEvents', + 'getEvent', + 'createEvent', + 'updateEvent', + 'deleteEvent', + 'listSeries', + 'getSeries', + 'createSeries', + 'updateSeries', + 'deleteSeries', + 'materializeChannel', + ]; + for (const methodName of streamsServiceStubMethods) { + const callPromise = this.streamsServiceStub.then( + (stub) => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + }, + ); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback, + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.streamsServiceStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'visionai.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'visionai.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return ['https://www.googleapis.com/auth/cloud-platform']; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback, + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /** + * Gets details of a single Cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.visionai.v1alpha1.Cluster|Cluster}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/streams_service.get_cluster.js + * region_tag:visionai_v1alpha1_generated_StreamsService_GetCluster_async + */ + getCluster( + request?: protos.google.cloud.visionai.v1alpha1.IGetClusterRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.ICluster, + protos.google.cloud.visionai.v1alpha1.IGetClusterRequest | undefined, + {} | undefined, + ] + >; + getCluster( + request: protos.google.cloud.visionai.v1alpha1.IGetClusterRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.ICluster, + | protos.google.cloud.visionai.v1alpha1.IGetClusterRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getCluster( + request: protos.google.cloud.visionai.v1alpha1.IGetClusterRequest, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.ICluster, + | protos.google.cloud.visionai.v1alpha1.IGetClusterRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getCluster( + request?: protos.google.cloud.visionai.v1alpha1.IGetClusterRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.visionai.v1alpha1.ICluster, + | protos.google.cloud.visionai.v1alpha1.IGetClusterRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.visionai.v1alpha1.ICluster, + | protos.google.cloud.visionai.v1alpha1.IGetClusterRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.ICluster, + protos.google.cloud.visionai.v1alpha1.IGetClusterRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('getCluster request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.visionai.v1alpha1.ICluster, + | protos.google.cloud.visionai.v1alpha1.IGetClusterRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getCluster response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getCluster(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.visionai.v1alpha1.ICluster, + protos.google.cloud.visionai.v1alpha1.IGetClusterRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getCluster response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Gets details of a single Stream. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.visionai.v1alpha1.Stream|Stream}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/streams_service.get_stream.js + * region_tag:visionai_v1alpha1_generated_StreamsService_GetStream_async + */ + getStream( + request?: protos.google.cloud.visionai.v1alpha1.IGetStreamRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IStream, + protos.google.cloud.visionai.v1alpha1.IGetStreamRequest | undefined, + {} | undefined, + ] + >; + getStream( + request: protos.google.cloud.visionai.v1alpha1.IGetStreamRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.IStream, + | protos.google.cloud.visionai.v1alpha1.IGetStreamRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getStream( + request: protos.google.cloud.visionai.v1alpha1.IGetStreamRequest, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.IStream, + | protos.google.cloud.visionai.v1alpha1.IGetStreamRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getStream( + request?: protos.google.cloud.visionai.v1alpha1.IGetStreamRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.visionai.v1alpha1.IStream, + | protos.google.cloud.visionai.v1alpha1.IGetStreamRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.visionai.v1alpha1.IStream, + | protos.google.cloud.visionai.v1alpha1.IGetStreamRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IStream, + protos.google.cloud.visionai.v1alpha1.IGetStreamRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('getStream request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.visionai.v1alpha1.IStream, + | protos.google.cloud.visionai.v1alpha1.IGetStreamRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getStream response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getStream(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.visionai.v1alpha1.IStream, + protos.google.cloud.visionai.v1alpha1.IGetStreamRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getStream response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Generate the JWT auth token required to get the stream HLS contents. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.stream + * Required. The name of the stream. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenResponse|GenerateStreamHlsTokenResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/streams_service.generate_stream_hls_token.js + * region_tag:visionai_v1alpha1_generated_StreamsService_GenerateStreamHlsToken_async + */ + generateStreamHlsToken( + request?: protos.google.cloud.visionai.v1alpha1.IGenerateStreamHlsTokenRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IGenerateStreamHlsTokenResponse, + ( + | protos.google.cloud.visionai.v1alpha1.IGenerateStreamHlsTokenRequest + | undefined + ), + {} | undefined, + ] + >; + generateStreamHlsToken( + request: protos.google.cloud.visionai.v1alpha1.IGenerateStreamHlsTokenRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.IGenerateStreamHlsTokenResponse, + | protos.google.cloud.visionai.v1alpha1.IGenerateStreamHlsTokenRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + generateStreamHlsToken( + request: protos.google.cloud.visionai.v1alpha1.IGenerateStreamHlsTokenRequest, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.IGenerateStreamHlsTokenResponse, + | protos.google.cloud.visionai.v1alpha1.IGenerateStreamHlsTokenRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + generateStreamHlsToken( + request?: protos.google.cloud.visionai.v1alpha1.IGenerateStreamHlsTokenRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.visionai.v1alpha1.IGenerateStreamHlsTokenResponse, + | protos.google.cloud.visionai.v1alpha1.IGenerateStreamHlsTokenRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.visionai.v1alpha1.IGenerateStreamHlsTokenResponse, + | protos.google.cloud.visionai.v1alpha1.IGenerateStreamHlsTokenRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IGenerateStreamHlsTokenResponse, + ( + | protos.google.cloud.visionai.v1alpha1.IGenerateStreamHlsTokenRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + stream: request.stream ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('generateStreamHlsToken request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.visionai.v1alpha1.IGenerateStreamHlsTokenResponse, + | protos.google.cloud.visionai.v1alpha1.IGenerateStreamHlsTokenRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('generateStreamHlsToken response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .generateStreamHlsToken(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.visionai.v1alpha1.IGenerateStreamHlsTokenResponse, + ( + | protos.google.cloud.visionai.v1alpha1.IGenerateStreamHlsTokenRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('generateStreamHlsToken response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Gets details of a single Event. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.visionai.v1alpha1.Event|Event}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/streams_service.get_event.js + * region_tag:visionai_v1alpha1_generated_StreamsService_GetEvent_async + */ + getEvent( + request?: protos.google.cloud.visionai.v1alpha1.IGetEventRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IEvent, + protos.google.cloud.visionai.v1alpha1.IGetEventRequest | undefined, + {} | undefined, + ] + >; + getEvent( + request: protos.google.cloud.visionai.v1alpha1.IGetEventRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.IEvent, + protos.google.cloud.visionai.v1alpha1.IGetEventRequest | null | undefined, + {} | null | undefined + >, + ): void; + getEvent( + request: protos.google.cloud.visionai.v1alpha1.IGetEventRequest, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.IEvent, + protos.google.cloud.visionai.v1alpha1.IGetEventRequest | null | undefined, + {} | null | undefined + >, + ): void; + getEvent( + request?: protos.google.cloud.visionai.v1alpha1.IGetEventRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.visionai.v1alpha1.IEvent, + | protos.google.cloud.visionai.v1alpha1.IGetEventRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.visionai.v1alpha1.IEvent, + protos.google.cloud.visionai.v1alpha1.IGetEventRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IEvent, + protos.google.cloud.visionai.v1alpha1.IGetEventRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('getEvent request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.visionai.v1alpha1.IEvent, + | protos.google.cloud.visionai.v1alpha1.IGetEventRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getEvent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getEvent(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.visionai.v1alpha1.IEvent, + protos.google.cloud.visionai.v1alpha1.IGetEventRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getEvent response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Gets details of a single Series. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.visionai.v1alpha1.Series|Series}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/streams_service.get_series.js + * region_tag:visionai_v1alpha1_generated_StreamsService_GetSeries_async + */ + getSeries( + request?: protos.google.cloud.visionai.v1alpha1.IGetSeriesRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.ISeries, + protos.google.cloud.visionai.v1alpha1.IGetSeriesRequest | undefined, + {} | undefined, + ] + >; + getSeries( + request: protos.google.cloud.visionai.v1alpha1.IGetSeriesRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.ISeries, + | protos.google.cloud.visionai.v1alpha1.IGetSeriesRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getSeries( + request: protos.google.cloud.visionai.v1alpha1.IGetSeriesRequest, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.ISeries, + | protos.google.cloud.visionai.v1alpha1.IGetSeriesRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getSeries( + request?: protos.google.cloud.visionai.v1alpha1.IGetSeriesRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.visionai.v1alpha1.ISeries, + | protos.google.cloud.visionai.v1alpha1.IGetSeriesRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.visionai.v1alpha1.ISeries, + | protos.google.cloud.visionai.v1alpha1.IGetSeriesRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.ISeries, + protos.google.cloud.visionai.v1alpha1.IGetSeriesRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('getSeries request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.visionai.v1alpha1.ISeries, + | protos.google.cloud.visionai.v1alpha1.IGetSeriesRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getSeries response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getSeries(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.visionai.v1alpha1.ISeries, + protos.google.cloud.visionai.v1alpha1.IGetSeriesRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getSeries response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Creates a new Cluster in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Value for parent. + * @param {string} request.clusterId + * Required. Id of the requesting object. + * @param {google.cloud.visionai.v1alpha1.Cluster} request.cluster + * Required. The resource being created. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/streams_service.create_cluster.js + * region_tag:visionai_v1alpha1_generated_StreamsService_CreateCluster_async + */ + createCluster( + request?: protos.google.cloud.visionai.v1alpha1.ICreateClusterRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.visionai.v1alpha1.ICluster, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createCluster( + request: protos.google.cloud.visionai.v1alpha1.ICreateClusterRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.ICluster, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createCluster( + request: protos.google.cloud.visionai.v1alpha1.ICreateClusterRequest, + callback: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.ICluster, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createCluster( + request?: protos.google.cloud.visionai.v1alpha1.ICreateClusterRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.ICluster, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.ICluster, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.visionai.v1alpha1.ICluster, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.ICluster, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createCluster request %j', request); + return this.innerApiCalls + .createCluster(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.visionai.v1alpha1.ICluster, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createCluster response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `createCluster()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/streams_service.create_cluster.js + * region_tag:visionai_v1alpha1_generated_StreamsService_CreateCluster_async + */ + async checkCreateClusterProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.visionai.v1alpha1.Cluster, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + > + > { + this._log.info('createCluster long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createCluster, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.visionai.v1alpha1.Cluster, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + >; + } + /** + * Updates the parameters of a single Cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Field mask is used to specify the fields to be overwritten in the + * Cluster resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @param {google.cloud.visionai.v1alpha1.Cluster} request.cluster + * Required. The resource being updated + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/streams_service.update_cluster.js + * region_tag:visionai_v1alpha1_generated_StreamsService_UpdateCluster_async + */ + updateCluster( + request?: protos.google.cloud.visionai.v1alpha1.IUpdateClusterRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.visionai.v1alpha1.ICluster, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + updateCluster( + request: protos.google.cloud.visionai.v1alpha1.IUpdateClusterRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.ICluster, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + updateCluster( + request: protos.google.cloud.visionai.v1alpha1.IUpdateClusterRequest, + callback: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.ICluster, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + updateCluster( + request?: protos.google.cloud.visionai.v1alpha1.IUpdateClusterRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.ICluster, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.ICluster, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.visionai.v1alpha1.ICluster, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'cluster.name': request.cluster!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.ICluster, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateCluster request %j', request); + return this.innerApiCalls + .updateCluster(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.visionai.v1alpha1.ICluster, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateCluster response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `updateCluster()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/streams_service.update_cluster.js + * region_tag:visionai_v1alpha1_generated_StreamsService_UpdateCluster_async + */ + async checkUpdateClusterProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.visionai.v1alpha1.Cluster, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + > + > { + this._log.info('updateCluster long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateCluster, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.visionai.v1alpha1.Cluster, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + >; + } + /** + * Deletes a single Cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the resource + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/streams_service.delete_cluster.js + * region_tag:visionai_v1alpha1_generated_StreamsService_DeleteCluster_async + */ + deleteCluster( + request?: protos.google.cloud.visionai.v1alpha1.IDeleteClusterRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deleteCluster( + request: protos.google.cloud.visionai.v1alpha1.IDeleteClusterRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + deleteCluster( + request: protos.google.cloud.visionai.v1alpha1.IDeleteClusterRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + deleteCluster( + request?: protos.google.cloud.visionai.v1alpha1.IDeleteClusterRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteCluster request %j', request); + return this.innerApiCalls + .deleteCluster(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteCluster response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `deleteCluster()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/streams_service.delete_cluster.js + * region_tag:visionai_v1alpha1_generated_StreamsService_DeleteCluster_async + */ + async checkDeleteClusterProgress( + name: string, + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + > + > { + this._log.info('deleteCluster long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteCluster, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + >; + } + /** + * Creates a new Stream in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Value for parent. + * @param {string} request.streamId + * Required. Id of the requesting object. + * @param {google.cloud.visionai.v1alpha1.Stream} request.stream + * Required. The resource being created. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/streams_service.create_stream.js + * region_tag:visionai_v1alpha1_generated_StreamsService_CreateStream_async + */ + createStream( + request?: protos.google.cloud.visionai.v1alpha1.ICreateStreamRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IStream, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createStream( + request: protos.google.cloud.visionai.v1alpha1.ICreateStreamRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IStream, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createStream( + request: protos.google.cloud.visionai.v1alpha1.ICreateStreamRequest, + callback: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IStream, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createStream( + request?: protos.google.cloud.visionai.v1alpha1.ICreateStreamRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IStream, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IStream, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IStream, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IStream, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createStream response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createStream request %j', request); + return this.innerApiCalls + .createStream(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IStream, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createStream response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `createStream()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/streams_service.create_stream.js + * region_tag:visionai_v1alpha1_generated_StreamsService_CreateStream_async + */ + async checkCreateStreamProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.visionai.v1alpha1.Stream, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + > + > { + this._log.info('createStream long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createStream, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.visionai.v1alpha1.Stream, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + >; + } + /** + * Updates the parameters of a single Stream. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Field mask is used to specify the fields to be overwritten in the + * Stream resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @param {google.cloud.visionai.v1alpha1.Stream} request.stream + * Required. The resource being updated. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/streams_service.update_stream.js + * region_tag:visionai_v1alpha1_generated_StreamsService_UpdateStream_async + */ + updateStream( + request?: protos.google.cloud.visionai.v1alpha1.IUpdateStreamRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IStream, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + updateStream( + request: protos.google.cloud.visionai.v1alpha1.IUpdateStreamRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IStream, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + updateStream( + request: protos.google.cloud.visionai.v1alpha1.IUpdateStreamRequest, + callback: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IStream, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + updateStream( + request?: protos.google.cloud.visionai.v1alpha1.IUpdateStreamRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IStream, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IStream, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IStream, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'stream.name': request.stream!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IStream, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateStream response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateStream request %j', request); + return this.innerApiCalls + .updateStream(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IStream, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateStream response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `updateStream()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/streams_service.update_stream.js + * region_tag:visionai_v1alpha1_generated_StreamsService_UpdateStream_async + */ + async checkUpdateStreamProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.visionai.v1alpha1.Stream, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + > + > { + this._log.info('updateStream long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateStream, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.visionai.v1alpha1.Stream, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + >; + } + /** + * Deletes a single Stream. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the resource. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/streams_service.delete_stream.js + * region_tag:visionai_v1alpha1_generated_StreamsService_DeleteStream_async + */ + deleteStream( + request?: protos.google.cloud.visionai.v1alpha1.IDeleteStreamRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deleteStream( + request: protos.google.cloud.visionai.v1alpha1.IDeleteStreamRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + deleteStream( + request: protos.google.cloud.visionai.v1alpha1.IDeleteStreamRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + deleteStream( + request?: protos.google.cloud.visionai.v1alpha1.IDeleteStreamRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteStream response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteStream request %j', request); + return this.innerApiCalls + .deleteStream(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteStream response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `deleteStream()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/streams_service.delete_stream.js + * region_tag:visionai_v1alpha1_generated_StreamsService_DeleteStream_async + */ + async checkDeleteStreamProgress( + name: string, + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + > + > { + this._log.info('deleteStream long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteStream, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + >; + } + /** + * Creates a new Event in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Value for parent. + * @param {string} request.eventId + * Required. Id of the requesting object. + * @param {google.cloud.visionai.v1alpha1.Event} request.event + * Required. The resource being created. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/streams_service.create_event.js + * region_tag:visionai_v1alpha1_generated_StreamsService_CreateEvent_async + */ + createEvent( + request?: protos.google.cloud.visionai.v1alpha1.ICreateEventRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IEvent, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createEvent( + request: protos.google.cloud.visionai.v1alpha1.ICreateEventRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IEvent, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createEvent( + request: protos.google.cloud.visionai.v1alpha1.ICreateEventRequest, + callback: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IEvent, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createEvent( + request?: protos.google.cloud.visionai.v1alpha1.ICreateEventRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IEvent, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IEvent, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IEvent, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IEvent, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createEvent response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createEvent request %j', request); + return this.innerApiCalls + .createEvent(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IEvent, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createEvent response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `createEvent()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/streams_service.create_event.js + * region_tag:visionai_v1alpha1_generated_StreamsService_CreateEvent_async + */ + async checkCreateEventProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.visionai.v1alpha1.Event, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + > + > { + this._log.info('createEvent long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createEvent, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.visionai.v1alpha1.Event, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + >; + } + /** + * Updates the parameters of a single Event. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Field mask is used to specify the fields to be overwritten in the + * Event resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @param {google.cloud.visionai.v1alpha1.Event} request.event + * Required. The resource being updated. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/streams_service.update_event.js + * region_tag:visionai_v1alpha1_generated_StreamsService_UpdateEvent_async + */ + updateEvent( + request?: protos.google.cloud.visionai.v1alpha1.IUpdateEventRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IEvent, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + updateEvent( + request: protos.google.cloud.visionai.v1alpha1.IUpdateEventRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IEvent, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + updateEvent( + request: protos.google.cloud.visionai.v1alpha1.IUpdateEventRequest, + callback: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IEvent, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + updateEvent( + request?: protos.google.cloud.visionai.v1alpha1.IUpdateEventRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IEvent, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IEvent, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IEvent, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'event.name': request.event!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IEvent, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateEvent response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateEvent request %j', request); + return this.innerApiCalls + .updateEvent(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IEvent, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateEvent response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `updateEvent()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/streams_service.update_event.js + * region_tag:visionai_v1alpha1_generated_StreamsService_UpdateEvent_async + */ + async checkUpdateEventProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.visionai.v1alpha1.Event, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + > + > { + this._log.info('updateEvent long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateEvent, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.visionai.v1alpha1.Event, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + >; + } + /** + * Deletes a single Event. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the resource. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/streams_service.delete_event.js + * region_tag:visionai_v1alpha1_generated_StreamsService_DeleteEvent_async + */ + deleteEvent( + request?: protos.google.cloud.visionai.v1alpha1.IDeleteEventRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deleteEvent( + request: protos.google.cloud.visionai.v1alpha1.IDeleteEventRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + deleteEvent( + request: protos.google.cloud.visionai.v1alpha1.IDeleteEventRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + deleteEvent( + request?: protos.google.cloud.visionai.v1alpha1.IDeleteEventRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteEvent response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteEvent request %j', request); + return this.innerApiCalls + .deleteEvent(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteEvent response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `deleteEvent()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/streams_service.delete_event.js + * region_tag:visionai_v1alpha1_generated_StreamsService_DeleteEvent_async + */ + async checkDeleteEventProgress( + name: string, + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + > + > { + this._log.info('deleteEvent long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteEvent, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + >; + } + /** + * Creates a new Series in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Value for parent. + * @param {string} request.seriesId + * Required. Id of the requesting object. + * @param {google.cloud.visionai.v1alpha1.Series} request.series + * Required. The resource being created. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/streams_service.create_series.js + * region_tag:visionai_v1alpha1_generated_StreamsService_CreateSeries_async + */ + createSeries( + request?: protos.google.cloud.visionai.v1alpha1.ICreateSeriesRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.visionai.v1alpha1.ISeries, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createSeries( + request: protos.google.cloud.visionai.v1alpha1.ICreateSeriesRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.ISeries, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createSeries( + request: protos.google.cloud.visionai.v1alpha1.ICreateSeriesRequest, + callback: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.ISeries, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createSeries( + request?: protos.google.cloud.visionai.v1alpha1.ICreateSeriesRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.ISeries, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.ISeries, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.visionai.v1alpha1.ISeries, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.ISeries, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createSeries response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createSeries request %j', request); + return this.innerApiCalls + .createSeries(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.visionai.v1alpha1.ISeries, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createSeries response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `createSeries()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/streams_service.create_series.js + * region_tag:visionai_v1alpha1_generated_StreamsService_CreateSeries_async + */ + async checkCreateSeriesProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.visionai.v1alpha1.Series, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + > + > { + this._log.info('createSeries long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createSeries, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.visionai.v1alpha1.Series, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + >; + } + /** + * Updates the parameters of a single Event. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Field mask is used to specify the fields to be overwritten in the Series + * resource by the update. The fields specified in the update_mask are + * relative to the resource, not the full request. A field will be overwritten + * if it is in the mask. If the user does not provide a mask then all fields + * will be overwritten. + * @param {google.cloud.visionai.v1alpha1.Series} request.series + * Required. The resource being updated + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/streams_service.update_series.js + * region_tag:visionai_v1alpha1_generated_StreamsService_UpdateSeries_async + */ + updateSeries( + request?: protos.google.cloud.visionai.v1alpha1.IUpdateSeriesRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.visionai.v1alpha1.ISeries, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + updateSeries( + request: protos.google.cloud.visionai.v1alpha1.IUpdateSeriesRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.ISeries, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + updateSeries( + request: protos.google.cloud.visionai.v1alpha1.IUpdateSeriesRequest, + callback: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.ISeries, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + updateSeries( + request?: protos.google.cloud.visionai.v1alpha1.IUpdateSeriesRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.ISeries, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.ISeries, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.visionai.v1alpha1.ISeries, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'series.name': request.series!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.ISeries, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateSeries response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateSeries request %j', request); + return this.innerApiCalls + .updateSeries(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.visionai.v1alpha1.ISeries, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateSeries response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `updateSeries()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/streams_service.update_series.js + * region_tag:visionai_v1alpha1_generated_StreamsService_UpdateSeries_async + */ + async checkUpdateSeriesProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.visionai.v1alpha1.Series, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + > + > { + this._log.info('updateSeries long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateSeries, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.visionai.v1alpha1.Series, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + >; + } + /** + * Deletes a single Series. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the resource. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/streams_service.delete_series.js + * region_tag:visionai_v1alpha1_generated_StreamsService_DeleteSeries_async + */ + deleteSeries( + request?: protos.google.cloud.visionai.v1alpha1.IDeleteSeriesRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deleteSeries( + request: protos.google.cloud.visionai.v1alpha1.IDeleteSeriesRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + deleteSeries( + request: protos.google.cloud.visionai.v1alpha1.IDeleteSeriesRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + deleteSeries( + request?: protos.google.cloud.visionai.v1alpha1.IDeleteSeriesRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteSeries response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteSeries request %j', request); + return this.innerApiCalls + .deleteSeries(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteSeries response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `deleteSeries()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/streams_service.delete_series.js + * region_tag:visionai_v1alpha1_generated_StreamsService_DeleteSeries_async + */ + async checkDeleteSeriesProgress( + name: string, + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + > + > { + this._log.info('deleteSeries long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteSeries, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + >; + } + /** + * Materialize a channel. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Value for parent. + * @param {string} request.channelId + * Required. Id of the channel. + * @param {google.cloud.visionai.v1alpha1.Channel} request.channel + * Required. The resource being created. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/streams_service.materialize_channel.js + * region_tag:visionai_v1alpha1_generated_StreamsService_MaterializeChannel_async + */ + materializeChannel( + request?: protos.google.cloud.visionai.v1alpha1.IMaterializeChannelRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IChannel, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + materializeChannel( + request: protos.google.cloud.visionai.v1alpha1.IMaterializeChannelRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IChannel, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + materializeChannel( + request: protos.google.cloud.visionai.v1alpha1.IMaterializeChannelRequest, + callback: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IChannel, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + materializeChannel( + request?: protos.google.cloud.visionai.v1alpha1.IMaterializeChannelRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IChannel, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IChannel, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IChannel, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.IChannel, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('materializeChannel response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('materializeChannel request %j', request); + return this.innerApiCalls + .materializeChannel(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.visionai.v1alpha1.IChannel, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('materializeChannel response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `materializeChannel()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/streams_service.materialize_channel.js + * region_tag:visionai_v1alpha1_generated_StreamsService_MaterializeChannel_async + */ + async checkMaterializeChannelProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.visionai.v1alpha1.Channel, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + > + > { + this._log.info('materializeChannel long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.materializeChannel, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.visionai.v1alpha1.Channel, + protos.google.cloud.visionai.v1alpha1.OperationMetadata + >; + } + /** + * Lists Clusters in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListClustersRequest. + * @param {number} request.pageSize + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} request.filter + * Filtering results. + * @param {string} request.orderBy + * Hint for how to order the results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.visionai.v1alpha1.Cluster|Cluster}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listClustersAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listClusters( + request?: protos.google.cloud.visionai.v1alpha1.IListClustersRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.ICluster[], + protos.google.cloud.visionai.v1alpha1.IListClustersRequest | null, + protos.google.cloud.visionai.v1alpha1.IListClustersResponse, + ] + >; + listClusters( + request: protos.google.cloud.visionai.v1alpha1.IListClustersRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListClustersRequest, + | protos.google.cloud.visionai.v1alpha1.IListClustersResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.ICluster + >, + ): void; + listClusters( + request: protos.google.cloud.visionai.v1alpha1.IListClustersRequest, + callback: PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListClustersRequest, + | protos.google.cloud.visionai.v1alpha1.IListClustersResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.ICluster + >, + ): void; + listClusters( + request?: protos.google.cloud.visionai.v1alpha1.IListClustersRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListClustersRequest, + | protos.google.cloud.visionai.v1alpha1.IListClustersResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.ICluster + >, + callback?: PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListClustersRequest, + | protos.google.cloud.visionai.v1alpha1.IListClustersResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.ICluster + >, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.ICluster[], + protos.google.cloud.visionai.v1alpha1.IListClustersRequest | null, + protos.google.cloud.visionai.v1alpha1.IListClustersResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListClustersRequest, + | protos.google.cloud.visionai.v1alpha1.IListClustersResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.ICluster + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listClusters values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listClusters request %j', request); + return this.innerApiCalls + .listClusters(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.visionai.v1alpha1.ICluster[], + protos.google.cloud.visionai.v1alpha1.IListClustersRequest | null, + protos.google.cloud.visionai.v1alpha1.IListClustersResponse, + ]) => { + this._log.info('listClusters values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listClusters`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListClustersRequest. + * @param {number} request.pageSize + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} request.filter + * Filtering results. + * @param {string} request.orderBy + * Hint for how to order the results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.visionai.v1alpha1.Cluster|Cluster} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listClustersAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listClustersStream( + request?: protos.google.cloud.visionai.v1alpha1.IListClustersRequest, + options?: CallOptions, + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listClusters']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listClusters stream %j', request); + return this.descriptors.page.listClusters.createStream( + this.innerApiCalls.listClusters as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listClusters`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListClustersRequest. + * @param {number} request.pageSize + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} request.filter + * Filtering results. + * @param {string} request.orderBy + * Hint for how to order the results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.visionai.v1alpha1.Cluster|Cluster}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/streams_service.list_clusters.js + * region_tag:visionai_v1alpha1_generated_StreamsService_ListClusters_async + */ + listClustersAsync( + request?: protos.google.cloud.visionai.v1alpha1.IListClustersRequest, + options?: CallOptions, + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listClusters']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listClusters iterate %j', request); + return this.descriptors.page.listClusters.asyncIterate( + this.innerApiCalls['listClusters'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + /** + * Lists Streams in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListStreamsRequest. + * @param {number} request.pageSize + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} request.filter + * Filtering results. + * @param {string} request.orderBy + * Hint for how to order the results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.visionai.v1alpha1.Stream|Stream}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listStreamsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listStreams( + request?: protos.google.cloud.visionai.v1alpha1.IListStreamsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IStream[], + protos.google.cloud.visionai.v1alpha1.IListStreamsRequest | null, + protos.google.cloud.visionai.v1alpha1.IListStreamsResponse, + ] + >; + listStreams( + request: protos.google.cloud.visionai.v1alpha1.IListStreamsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListStreamsRequest, + | protos.google.cloud.visionai.v1alpha1.IListStreamsResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.IStream + >, + ): void; + listStreams( + request: protos.google.cloud.visionai.v1alpha1.IListStreamsRequest, + callback: PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListStreamsRequest, + | protos.google.cloud.visionai.v1alpha1.IListStreamsResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.IStream + >, + ): void; + listStreams( + request?: protos.google.cloud.visionai.v1alpha1.IListStreamsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListStreamsRequest, + | protos.google.cloud.visionai.v1alpha1.IListStreamsResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.IStream + >, + callback?: PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListStreamsRequest, + | protos.google.cloud.visionai.v1alpha1.IListStreamsResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.IStream + >, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IStream[], + protos.google.cloud.visionai.v1alpha1.IListStreamsRequest | null, + protos.google.cloud.visionai.v1alpha1.IListStreamsResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListStreamsRequest, + | protos.google.cloud.visionai.v1alpha1.IListStreamsResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.IStream + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listStreams values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listStreams request %j', request); + return this.innerApiCalls + .listStreams(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.visionai.v1alpha1.IStream[], + protos.google.cloud.visionai.v1alpha1.IListStreamsRequest | null, + protos.google.cloud.visionai.v1alpha1.IListStreamsResponse, + ]) => { + this._log.info('listStreams values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listStreams`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListStreamsRequest. + * @param {number} request.pageSize + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} request.filter + * Filtering results. + * @param {string} request.orderBy + * Hint for how to order the results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.visionai.v1alpha1.Stream|Stream} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listStreamsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listStreamsStream( + request?: protos.google.cloud.visionai.v1alpha1.IListStreamsRequest, + options?: CallOptions, + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listStreams']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listStreams stream %j', request); + return this.descriptors.page.listStreams.createStream( + this.innerApiCalls.listStreams as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listStreams`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListStreamsRequest. + * @param {number} request.pageSize + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} request.filter + * Filtering results. + * @param {string} request.orderBy + * Hint for how to order the results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.visionai.v1alpha1.Stream|Stream}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/streams_service.list_streams.js + * region_tag:visionai_v1alpha1_generated_StreamsService_ListStreams_async + */ + listStreamsAsync( + request?: protos.google.cloud.visionai.v1alpha1.IListStreamsRequest, + options?: CallOptions, + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listStreams']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listStreams iterate %j', request); + return this.descriptors.page.listStreams.asyncIterate( + this.innerApiCalls['listStreams'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + /** + * Lists Events in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListEventsRequest. + * @param {number} request.pageSize + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} request.filter + * Filtering results. + * @param {string} request.orderBy + * Hint for how to order the results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.visionai.v1alpha1.Event|Event}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listEventsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listEvents( + request?: protos.google.cloud.visionai.v1alpha1.IListEventsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IEvent[], + protos.google.cloud.visionai.v1alpha1.IListEventsRequest | null, + protos.google.cloud.visionai.v1alpha1.IListEventsResponse, + ] + >; + listEvents( + request: protos.google.cloud.visionai.v1alpha1.IListEventsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListEventsRequest, + | protos.google.cloud.visionai.v1alpha1.IListEventsResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.IEvent + >, + ): void; + listEvents( + request: protos.google.cloud.visionai.v1alpha1.IListEventsRequest, + callback: PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListEventsRequest, + | protos.google.cloud.visionai.v1alpha1.IListEventsResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.IEvent + >, + ): void; + listEvents( + request?: protos.google.cloud.visionai.v1alpha1.IListEventsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListEventsRequest, + | protos.google.cloud.visionai.v1alpha1.IListEventsResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.IEvent + >, + callback?: PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListEventsRequest, + | protos.google.cloud.visionai.v1alpha1.IListEventsResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.IEvent + >, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IEvent[], + protos.google.cloud.visionai.v1alpha1.IListEventsRequest | null, + protos.google.cloud.visionai.v1alpha1.IListEventsResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListEventsRequest, + | protos.google.cloud.visionai.v1alpha1.IListEventsResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.IEvent + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listEvents values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listEvents request %j', request); + return this.innerApiCalls + .listEvents(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.visionai.v1alpha1.IEvent[], + protos.google.cloud.visionai.v1alpha1.IListEventsRequest | null, + protos.google.cloud.visionai.v1alpha1.IListEventsResponse, + ]) => { + this._log.info('listEvents values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listEvents`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListEventsRequest. + * @param {number} request.pageSize + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} request.filter + * Filtering results. + * @param {string} request.orderBy + * Hint for how to order the results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.visionai.v1alpha1.Event|Event} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listEventsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listEventsStream( + request?: protos.google.cloud.visionai.v1alpha1.IListEventsRequest, + options?: CallOptions, + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listEvents']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listEvents stream %j', request); + return this.descriptors.page.listEvents.createStream( + this.innerApiCalls.listEvents as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listEvents`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListEventsRequest. + * @param {number} request.pageSize + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} request.filter + * Filtering results. + * @param {string} request.orderBy + * Hint for how to order the results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.visionai.v1alpha1.Event|Event}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/streams_service.list_events.js + * region_tag:visionai_v1alpha1_generated_StreamsService_ListEvents_async + */ + listEventsAsync( + request?: protos.google.cloud.visionai.v1alpha1.IListEventsRequest, + options?: CallOptions, + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listEvents']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listEvents iterate %j', request); + return this.descriptors.page.listEvents.asyncIterate( + this.innerApiCalls['listEvents'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + /** + * Lists Series in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListSeriesRequest. + * @param {number} request.pageSize + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} request.filter + * Filtering results. + * @param {string} request.orderBy + * Hint for how to order the results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.visionai.v1alpha1.Series|Series}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listSeriesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSeries( + request?: protos.google.cloud.visionai.v1alpha1.IListSeriesRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.ISeries[], + protos.google.cloud.visionai.v1alpha1.IListSeriesRequest | null, + protos.google.cloud.visionai.v1alpha1.IListSeriesResponse, + ] + >; + listSeries( + request: protos.google.cloud.visionai.v1alpha1.IListSeriesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListSeriesRequest, + | protos.google.cloud.visionai.v1alpha1.IListSeriesResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.ISeries + >, + ): void; + listSeries( + request: protos.google.cloud.visionai.v1alpha1.IListSeriesRequest, + callback: PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListSeriesRequest, + | protos.google.cloud.visionai.v1alpha1.IListSeriesResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.ISeries + >, + ): void; + listSeries( + request?: protos.google.cloud.visionai.v1alpha1.IListSeriesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListSeriesRequest, + | protos.google.cloud.visionai.v1alpha1.IListSeriesResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.ISeries + >, + callback?: PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListSeriesRequest, + | protos.google.cloud.visionai.v1alpha1.IListSeriesResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.ISeries + >, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.ISeries[], + protos.google.cloud.visionai.v1alpha1.IListSeriesRequest | null, + protos.google.cloud.visionai.v1alpha1.IListSeriesResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListSeriesRequest, + | protos.google.cloud.visionai.v1alpha1.IListSeriesResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.ISeries + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listSeries values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listSeries request %j', request); + return this.innerApiCalls + .listSeries(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.visionai.v1alpha1.ISeries[], + protos.google.cloud.visionai.v1alpha1.IListSeriesRequest | null, + protos.google.cloud.visionai.v1alpha1.IListSeriesResponse, + ]) => { + this._log.info('listSeries values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listSeries`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListSeriesRequest. + * @param {number} request.pageSize + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} request.filter + * Filtering results. + * @param {string} request.orderBy + * Hint for how to order the results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.visionai.v1alpha1.Series|Series} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listSeriesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSeriesStream( + request?: protos.google.cloud.visionai.v1alpha1.IListSeriesRequest, + options?: CallOptions, + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listSeries']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listSeries stream %j', request); + return this.descriptors.page.listSeries.createStream( + this.innerApiCalls.listSeries as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listSeries`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListSeriesRequest. + * @param {number} request.pageSize + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} request.filter + * Filtering results. + * @param {string} request.orderBy + * Hint for how to order the results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.visionai.v1alpha1.Series|Series}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/streams_service.list_series.js + * region_tag:visionai_v1alpha1_generated_StreamsService_ListSeries_async + */ + listSeriesAsync( + request?: protos.google.cloud.visionai.v1alpha1.IListSeriesRequest, + options?: CallOptions, + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listSeries']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listSeries iterate %j', request); + return this.descriptors.page.listSeries.asyncIterate( + this.innerApiCalls['listSeries'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + /** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + ): Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.getIamPolicy(request, options, callback); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + ): Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.setIamPolicy(request, options, callback); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + ): Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { + return this.iamClient.testIamPermissions(request, options, callback); + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + /** + * Lists information about the supported locations for this service. Returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions, + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions, + ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.cancelOperation(request, options, callback); + } + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified analysis resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @param {string} analysis + * @returns {string} Resource name string. + */ + analysisPath( + project: string, + location: string, + cluster: string, + analysis: string, + ) { + return this.pathTemplates.analysisPathTemplate.render({ + project: project, + location: location, + cluster: cluster, + analysis: analysis, + }); + } + + /** + * Parse the project from Analysis resource. + * + * @param {string} analysisName + * A fully-qualified path representing Analysis resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnalysisName(analysisName: string) { + return this.pathTemplates.analysisPathTemplate.match(analysisName).project; + } + + /** + * Parse the location from Analysis resource. + * + * @param {string} analysisName + * A fully-qualified path representing Analysis resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnalysisName(analysisName: string) { + return this.pathTemplates.analysisPathTemplate.match(analysisName).location; + } + + /** + * Parse the cluster from Analysis resource. + * + * @param {string} analysisName + * A fully-qualified path representing Analysis resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromAnalysisName(analysisName: string) { + return this.pathTemplates.analysisPathTemplate.match(analysisName).cluster; + } + + /** + * Parse the analysis from Analysis resource. + * + * @param {string} analysisName + * A fully-qualified path representing Analysis resource. + * @returns {string} A string representing the analysis. + */ + matchAnalysisFromAnalysisName(analysisName: string) { + return this.pathTemplates.analysisPathTemplate.match(analysisName).analysis; + } + + /** + * Return a fully-qualified annotation resource name string. + * + * @param {string} project_number + * @param {string} location + * @param {string} corpus + * @param {string} asset + * @param {string} annotation + * @returns {string} Resource name string. + */ + annotationPath( + projectNumber: string, + location: string, + corpus: string, + asset: string, + annotation: string, + ) { + return this.pathTemplates.annotationPathTemplate.render({ + project_number: projectNumber, + location: location, + corpus: corpus, + asset: asset, + annotation: annotation, + }); + } + + /** + * Parse the project_number from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the project_number. + */ + matchProjectNumberFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .project_number; + } + + /** + * Parse the location from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .location; + } + + /** + * Parse the corpus from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the corpus. + */ + matchCorpusFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .corpus; + } + + /** + * Parse the asset from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the asset. + */ + matchAssetFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .asset; + } + + /** + * Parse the annotation from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the annotation. + */ + matchAnnotationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .annotation; + } + + /** + * Return a fully-qualified application resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} application + * @returns {string} Resource name string. + */ + applicationPath(project: string, location: string, application: string) { + return this.pathTemplates.applicationPathTemplate.render({ + project: project, + location: location, + application: application, + }); + } + + /** + * Parse the project from Application resource. + * + * @param {string} applicationName + * A fully-qualified path representing Application resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApplicationName(applicationName: string) { + return this.pathTemplates.applicationPathTemplate.match(applicationName) + .project; + } + + /** + * Parse the location from Application resource. + * + * @param {string} applicationName + * A fully-qualified path representing Application resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApplicationName(applicationName: string) { + return this.pathTemplates.applicationPathTemplate.match(applicationName) + .location; + } + + /** + * Parse the application from Application resource. + * + * @param {string} applicationName + * A fully-qualified path representing Application resource. + * @returns {string} A string representing the application. + */ + matchApplicationFromApplicationName(applicationName: string) { + return this.pathTemplates.applicationPathTemplate.match(applicationName) + .application; + } + + /** + * Return a fully-qualified asset resource name string. + * + * @param {string} project_number + * @param {string} location + * @param {string} corpus + * @param {string} asset + * @returns {string} Resource name string. + */ + assetPath( + projectNumber: string, + location: string, + corpus: string, + asset: string, + ) { + return this.pathTemplates.assetPathTemplate.render({ + project_number: projectNumber, + location: location, + corpus: corpus, + asset: asset, + }); + } + + /** + * Parse the project_number from Asset resource. + * + * @param {string} assetName + * A fully-qualified path representing Asset resource. + * @returns {string} A string representing the project_number. + */ + matchProjectNumberFromAssetName(assetName: string) { + return this.pathTemplates.assetPathTemplate.match(assetName).project_number; + } + + /** + * Parse the location from Asset resource. + * + * @param {string} assetName + * A fully-qualified path representing Asset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAssetName(assetName: string) { + return this.pathTemplates.assetPathTemplate.match(assetName).location; + } + + /** + * Parse the corpus from Asset resource. + * + * @param {string} assetName + * A fully-qualified path representing Asset resource. + * @returns {string} A string representing the corpus. + */ + matchCorpusFromAssetName(assetName: string) { + return this.pathTemplates.assetPathTemplate.match(assetName).corpus; + } + + /** + * Parse the asset from Asset resource. + * + * @param {string} assetName + * A fully-qualified path representing Asset resource. + * @returns {string} A string representing the asset. + */ + matchAssetFromAssetName(assetName: string) { + return this.pathTemplates.assetPathTemplate.match(assetName).asset; + } + + /** + * Return a fully-qualified channel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @param {string} channel + * @returns {string} Resource name string. + */ + channelPath( + project: string, + location: string, + cluster: string, + channel: string, + ) { + return this.pathTemplates.channelPathTemplate.render({ + project: project, + location: location, + cluster: cluster, + channel: channel, + }); + } + + /** + * Parse the project from Channel resource. + * + * @param {string} channelName + * A fully-qualified path representing Channel resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChannelName(channelName: string) { + return this.pathTemplates.channelPathTemplate.match(channelName).project; + } + + /** + * Parse the location from Channel resource. + * + * @param {string} channelName + * A fully-qualified path representing Channel resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChannelName(channelName: string) { + return this.pathTemplates.channelPathTemplate.match(channelName).location; + } + + /** + * Parse the cluster from Channel resource. + * + * @param {string} channelName + * A fully-qualified path representing Channel resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromChannelName(channelName: string) { + return this.pathTemplates.channelPathTemplate.match(channelName).cluster; + } + + /** + * Parse the channel from Channel resource. + * + * @param {string} channelName + * A fully-qualified path representing Channel resource. + * @returns {string} A string representing the channel. + */ + matchChannelFromChannelName(channelName: string) { + return this.pathTemplates.channelPathTemplate.match(channelName).channel; + } + + /** + * Return a fully-qualified cluster resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @returns {string} Resource name string. + */ + clusterPath(project: string, location: string, cluster: string) { + return this.pathTemplates.clusterPathTemplate.render({ + project: project, + location: location, + cluster: cluster, + }); + } + + /** + * Parse the project from Cluster resource. + * + * @param {string} clusterName + * A fully-qualified path representing Cluster resource. + * @returns {string} A string representing the project. + */ + matchProjectFromClusterName(clusterName: string) { + return this.pathTemplates.clusterPathTemplate.match(clusterName).project; + } + + /** + * Parse the location from Cluster resource. + * + * @param {string} clusterName + * A fully-qualified path representing Cluster resource. + * @returns {string} A string representing the location. + */ + matchLocationFromClusterName(clusterName: string) { + return this.pathTemplates.clusterPathTemplate.match(clusterName).location; + } + + /** + * Parse the cluster from Cluster resource. + * + * @param {string} clusterName + * A fully-qualified path representing Cluster resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromClusterName(clusterName: string) { + return this.pathTemplates.clusterPathTemplate.match(clusterName).cluster; + } + + /** + * Return a fully-qualified corpus resource name string. + * + * @param {string} project_number + * @param {string} location + * @param {string} corpus + * @returns {string} Resource name string. + */ + corpusPath(projectNumber: string, location: string, corpus: string) { + return this.pathTemplates.corpusPathTemplate.render({ + project_number: projectNumber, + location: location, + corpus: corpus, + }); + } + + /** + * Parse the project_number from Corpus resource. + * + * @param {string} corpusName + * A fully-qualified path representing Corpus resource. + * @returns {string} A string representing the project_number. + */ + matchProjectNumberFromCorpusName(corpusName: string) { + return this.pathTemplates.corpusPathTemplate.match(corpusName) + .project_number; + } + + /** + * Parse the location from Corpus resource. + * + * @param {string} corpusName + * A fully-qualified path representing Corpus resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCorpusName(corpusName: string) { + return this.pathTemplates.corpusPathTemplate.match(corpusName).location; + } + + /** + * Parse the corpus from Corpus resource. + * + * @param {string} corpusName + * A fully-qualified path representing Corpus resource. + * @returns {string} A string representing the corpus. + */ + matchCorpusFromCorpusName(corpusName: string) { + return this.pathTemplates.corpusPathTemplate.match(corpusName).corpus; + } + + /** + * Return a fully-qualified dataSchema resource name string. + * + * @param {string} project_number + * @param {string} location + * @param {string} corpus + * @param {string} data_schema + * @returns {string} Resource name string. + */ + dataSchemaPath( + projectNumber: string, + location: string, + corpus: string, + dataSchema: string, + ) { + return this.pathTemplates.dataSchemaPathTemplate.render({ + project_number: projectNumber, + location: location, + corpus: corpus, + data_schema: dataSchema, + }); + } + + /** + * Parse the project_number from DataSchema resource. + * + * @param {string} dataSchemaName + * A fully-qualified path representing DataSchema resource. + * @returns {string} A string representing the project_number. + */ + matchProjectNumberFromDataSchemaName(dataSchemaName: string) { + return this.pathTemplates.dataSchemaPathTemplate.match(dataSchemaName) + .project_number; + } + + /** + * Parse the location from DataSchema resource. + * + * @param {string} dataSchemaName + * A fully-qualified path representing DataSchema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataSchemaName(dataSchemaName: string) { + return this.pathTemplates.dataSchemaPathTemplate.match(dataSchemaName) + .location; + } + + /** + * Parse the corpus from DataSchema resource. + * + * @param {string} dataSchemaName + * A fully-qualified path representing DataSchema resource. + * @returns {string} A string representing the corpus. + */ + matchCorpusFromDataSchemaName(dataSchemaName: string) { + return this.pathTemplates.dataSchemaPathTemplate.match(dataSchemaName) + .corpus; + } + + /** + * Parse the data_schema from DataSchema resource. + * + * @param {string} dataSchemaName + * A fully-qualified path representing DataSchema resource. + * @returns {string} A string representing the data_schema. + */ + matchDataSchemaFromDataSchemaName(dataSchemaName: string) { + return this.pathTemplates.dataSchemaPathTemplate.match(dataSchemaName) + .data_schema; + } + + /** + * Return a fully-qualified draft resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} application + * @param {string} draft + * @returns {string} Resource name string. + */ + draftPath( + project: string, + location: string, + application: string, + draft: string, + ) { + return this.pathTemplates.draftPathTemplate.render({ + project: project, + location: location, + application: application, + draft: draft, + }); + } + + /** + * Parse the project from Draft resource. + * + * @param {string} draftName + * A fully-qualified path representing Draft resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDraftName(draftName: string) { + return this.pathTemplates.draftPathTemplate.match(draftName).project; + } + + /** + * Parse the location from Draft resource. + * + * @param {string} draftName + * A fully-qualified path representing Draft resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDraftName(draftName: string) { + return this.pathTemplates.draftPathTemplate.match(draftName).location; + } + + /** + * Parse the application from Draft resource. + * + * @param {string} draftName + * A fully-qualified path representing Draft resource. + * @returns {string} A string representing the application. + */ + matchApplicationFromDraftName(draftName: string) { + return this.pathTemplates.draftPathTemplate.match(draftName).application; + } + + /** + * Parse the draft from Draft resource. + * + * @param {string} draftName + * A fully-qualified path representing Draft resource. + * @returns {string} A string representing the draft. + */ + matchDraftFromDraftName(draftName: string) { + return this.pathTemplates.draftPathTemplate.match(draftName).draft; + } + + /** + * Return a fully-qualified event resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @param {string} event + * @returns {string} Resource name string. + */ + eventPath(project: string, location: string, cluster: string, event: string) { + return this.pathTemplates.eventPathTemplate.render({ + project: project, + location: location, + cluster: cluster, + event: event, + }); + } + + /** + * Parse the project from Event resource. + * + * @param {string} eventName + * A fully-qualified path representing Event resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEventName(eventName: string) { + return this.pathTemplates.eventPathTemplate.match(eventName).project; + } + + /** + * Parse the location from Event resource. + * + * @param {string} eventName + * A fully-qualified path representing Event resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEventName(eventName: string) { + return this.pathTemplates.eventPathTemplate.match(eventName).location; + } + + /** + * Parse the cluster from Event resource. + * + * @param {string} eventName + * A fully-qualified path representing Event resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromEventName(eventName: string) { + return this.pathTemplates.eventPathTemplate.match(eventName).cluster; + } + + /** + * Parse the event from Event resource. + * + * @param {string} eventName + * A fully-qualified path representing Event resource. + * @returns {string} A string representing the event. + */ + matchEventFromEventName(eventName: string) { + return this.pathTemplates.eventPathTemplate.match(eventName).event; + } + + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} application + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath( + project: string, + location: string, + application: string, + instance: string, + ) { + return this.pathTemplates.instancePathTemplate.render({ + project: project, + location: location, + application: application, + instance: instance, + }); + } + + /** + * Parse the project from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).project; + } + + /** + * Parse the location from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).location; + } + + /** + * Parse the application from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the application. + */ + matchApplicationFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName) + .application; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project: string, location: string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified processor resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} processor + * @returns {string} Resource name string. + */ + processorPath(project: string, location: string, processor: string) { + return this.pathTemplates.processorPathTemplate.render({ + project: project, + location: location, + processor: processor, + }); + } + + /** + * Parse the project from Processor resource. + * + * @param {string} processorName + * A fully-qualified path representing Processor resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProcessorName(processorName: string) { + return this.pathTemplates.processorPathTemplate.match(processorName) + .project; + } + + /** + * Parse the location from Processor resource. + * + * @param {string} processorName + * A fully-qualified path representing Processor resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProcessorName(processorName: string) { + return this.pathTemplates.processorPathTemplate.match(processorName) + .location; + } + + /** + * Parse the processor from Processor resource. + * + * @param {string} processorName + * A fully-qualified path representing Processor resource. + * @returns {string} A string representing the processor. + */ + matchProcessorFromProcessorName(processorName: string) { + return this.pathTemplates.processorPathTemplate.match(processorName) + .processor; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified searchConfig resource name string. + * + * @param {string} project_number + * @param {string} location + * @param {string} corpus + * @param {string} search_config + * @returns {string} Resource name string. + */ + searchConfigPath( + projectNumber: string, + location: string, + corpus: string, + searchConfig: string, + ) { + return this.pathTemplates.searchConfigPathTemplate.render({ + project_number: projectNumber, + location: location, + corpus: corpus, + search_config: searchConfig, + }); + } + + /** + * Parse the project_number from SearchConfig resource. + * + * @param {string} searchConfigName + * A fully-qualified path representing SearchConfig resource. + * @returns {string} A string representing the project_number. + */ + matchProjectNumberFromSearchConfigName(searchConfigName: string) { + return this.pathTemplates.searchConfigPathTemplate.match(searchConfigName) + .project_number; + } + + /** + * Parse the location from SearchConfig resource. + * + * @param {string} searchConfigName + * A fully-qualified path representing SearchConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSearchConfigName(searchConfigName: string) { + return this.pathTemplates.searchConfigPathTemplate.match(searchConfigName) + .location; + } + + /** + * Parse the corpus from SearchConfig resource. + * + * @param {string} searchConfigName + * A fully-qualified path representing SearchConfig resource. + * @returns {string} A string representing the corpus. + */ + matchCorpusFromSearchConfigName(searchConfigName: string) { + return this.pathTemplates.searchConfigPathTemplate.match(searchConfigName) + .corpus; + } + + /** + * Parse the search_config from SearchConfig resource. + * + * @param {string} searchConfigName + * A fully-qualified path representing SearchConfig resource. + * @returns {string} A string representing the search_config. + */ + matchSearchConfigFromSearchConfigName(searchConfigName: string) { + return this.pathTemplates.searchConfigPathTemplate.match(searchConfigName) + .search_config; + } + + /** + * Return a fully-qualified series resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @param {string} series + * @returns {string} Resource name string. + */ + seriesPath( + project: string, + location: string, + cluster: string, + series: string, + ) { + return this.pathTemplates.seriesPathTemplate.render({ + project: project, + location: location, + cluster: cluster, + series: series, + }); + } + + /** + * Parse the project from Series resource. + * + * @param {string} seriesName + * A fully-qualified path representing Series resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSeriesName(seriesName: string) { + return this.pathTemplates.seriesPathTemplate.match(seriesName).project; + } + + /** + * Parse the location from Series resource. + * + * @param {string} seriesName + * A fully-qualified path representing Series resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSeriesName(seriesName: string) { + return this.pathTemplates.seriesPathTemplate.match(seriesName).location; + } + + /** + * Parse the cluster from Series resource. + * + * @param {string} seriesName + * A fully-qualified path representing Series resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromSeriesName(seriesName: string) { + return this.pathTemplates.seriesPathTemplate.match(seriesName).cluster; + } + + /** + * Parse the series from Series resource. + * + * @param {string} seriesName + * A fully-qualified path representing Series resource. + * @returns {string} A string representing the series. + */ + matchSeriesFromSeriesName(seriesName: string) { + return this.pathTemplates.seriesPathTemplate.match(seriesName).series; + } + + /** + * Return a fully-qualified stream resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @param {string} stream + * @returns {string} Resource name string. + */ + streamPath( + project: string, + location: string, + cluster: string, + stream: string, + ) { + return this.pathTemplates.streamPathTemplate.render({ + project: project, + location: location, + cluster: cluster, + stream: stream, + }); + } + + /** + * Parse the project from Stream resource. + * + * @param {string} streamName + * A fully-qualified path representing Stream resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStreamName(streamName: string) { + return this.pathTemplates.streamPathTemplate.match(streamName).project; + } + + /** + * Parse the location from Stream resource. + * + * @param {string} streamName + * A fully-qualified path representing Stream resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStreamName(streamName: string) { + return this.pathTemplates.streamPathTemplate.match(streamName).location; + } + + /** + * Parse the cluster from Stream resource. + * + * @param {string} streamName + * A fully-qualified path representing Stream resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromStreamName(streamName: string) { + return this.pathTemplates.streamPathTemplate.match(streamName).cluster; + } + + /** + * Parse the stream from Stream resource. + * + * @param {string} streamName + * A fully-qualified path representing Stream resource. + * @returns {string} A string representing the stream. + */ + matchStreamFromStreamName(streamName: string) { + return this.pathTemplates.streamPathTemplate.match(streamName).stream; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.streamsServiceStub && !this._terminated) { + return this.streamsServiceStub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.iamClient.close().catch((err) => { + throw err; + }); + this.locationsClient.close().catch((err) => { + throw err; + }); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-visionai/src/v1alpha1/streams_service_client_config.json b/packages/google-cloud-visionai/src/v1alpha1/streams_service_client_config.json new file mode 100644 index 000000000000..977502355db2 --- /dev/null +++ b/packages/google-cloud-visionai/src/v1alpha1/streams_service_client_config.json @@ -0,0 +1,114 @@ +{ + "interfaces": { + "google.cloud.visionai.v1alpha1.StreamsService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListClusters": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetCluster": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateCluster": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateCluster": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteCluster": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListStreams": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetStream": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateStream": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateStream": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteStream": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GenerateStreamHlsToken": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListEvents": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetEvent": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateEvent": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateEvent": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteEvent": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListSeries": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetSeries": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateSeries": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateSeries": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteSeries": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "MaterializeChannel": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-visionai/src/v1alpha1/streams_service_proto_list.json b/packages/google-cloud-visionai/src/v1alpha1/streams_service_proto_list.json new file mode 100644 index 000000000000..437d97a901a4 --- /dev/null +++ b/packages/google-cloud-visionai/src/v1alpha1/streams_service_proto_list.json @@ -0,0 +1,13 @@ +[ + "../../protos/google/cloud/visionai/v1alpha1/annotations.proto", + "../../protos/google/cloud/visionai/v1alpha1/common.proto", + "../../protos/google/cloud/visionai/v1alpha1/lva.proto", + "../../protos/google/cloud/visionai/v1alpha1/lva_resources.proto", + "../../protos/google/cloud/visionai/v1alpha1/lva_service.proto", + "../../protos/google/cloud/visionai/v1alpha1/platform.proto", + "../../protos/google/cloud/visionai/v1alpha1/streaming_resources.proto", + "../../protos/google/cloud/visionai/v1alpha1/streaming_service.proto", + "../../protos/google/cloud/visionai/v1alpha1/streams_resources.proto", + "../../protos/google/cloud/visionai/v1alpha1/streams_service.proto", + "../../protos/google/cloud/visionai/v1alpha1/warehouse.proto" +] diff --git a/packages/google-cloud-visionai/src/v1alpha1/warehouse_client.ts b/packages/google-cloud-visionai/src/v1alpha1/warehouse_client.ts new file mode 100644 index 000000000000..92be085b0a90 --- /dev/null +++ b/packages/google-cloud-visionai/src/v1alpha1/warehouse_client.ts @@ -0,0 +1,6901 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + GrpcClientOptions, + LROperation, + PaginationCallback, + GaxCall, + IamClient, + IamProtos, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import { Transform, PassThrough } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1alpha1/warehouse_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './warehouse_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service that manages media content + metadata for streaming. + * @class + * @memberof v1alpha1 + */ +export class WarehouseClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: { [method: string]: gax.CallSettings }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('visionai'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + iamClient: IamClient; + locationsClient: LocationsClient; + pathTemplates: { [name: string]: gax.PathTemplate }; + operationsClient: gax.OperationsClient; + warehouseStub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of WarehouseClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new WarehouseClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof WarehouseClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'visionai.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts, + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + analysisPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}/analyses/{analysis}', + ), + annotationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation}', + ), + applicationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/applications/{application}', + ), + assetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}', + ), + channelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}/channels/{channel}', + ), + clusterPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}', + ), + corpusPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project_number}/locations/{location}/corpora/{corpus}', + ), + dataSchemaPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project_number}/locations/{location}/corpora/{corpus}/dataSchemas/{data_schema}', + ), + draftPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/applications/{application}/drafts/{draft}', + ), + eventPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}/events/{event}', + ), + instancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/applications/{application}/instances/{instance}', + ), + processorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/processors/{processor}', + ), + searchConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config}', + ), + seriesPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}/series/{series}', + ), + streamPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}/streams/{stream}', + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listAssets: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'assets', + ), + listCorpora: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'corpora', + ), + listDataSchemas: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'dataSchemas', + ), + listAnnotations: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'annotations', + ), + listSearchConfigs: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'searchConfigs', + ), + searchAssets: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'searchResultItems', + ), + }; + + // Some of the methods on this service provide streaming responses. + // Provide descriptors for these. + this.descriptors.stream = { + ingestAsset: new this._gaxModule.StreamDescriptor( + this._gaxModule.StreamType.BIDI_STREAMING, + !!opts.fallback, + !!opts.gaxServerStreamingRetries, + ), + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/v1alpha1/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v1alpha1/{name=projects/*}/locations', + }, + { + selector: 'google.iam.v1.IAMPolicy.GetIamPolicy', + get: '/v1alpha1/{resource=projects/*/locations/*/clusters/*}:getIamPolicy', + additional_bindings: [ + { + get: '/v1alpha1/{resource=projects/*/locations/*/clusters/*/streams/*}:getIamPolicy', + }, + { + get: '/v1alpha1/{resource=projects/*/locations/*/clusters/*/events/*}:getIamPolicy', + }, + { + get: '/v1alpha1/{resource=projects/*/locations/*/clusters/*/series/*}:getIamPolicy', + }, + { + get: '/v1alpha1/{resource=projects/*/locations/*/operators/*}:getIamPolicy', + }, + { + get: '/v1alpha1/{resource=projects/*/locations/*/operators/*/versions/*}:getIamPolicy', + }, + { + get: '/v1alpha1/{resource=projects/*/locations/*/clusters/*/analyses/*}:getIamPolicy', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.SetIamPolicy', + post: '/v1alpha1/{resource=projects/*/locations/*/clusters/*}:setIamPolicy', + body: '*', + additional_bindings: [ + { + post: '/v1alpha1/{resource=projects/*/locations/*/clusters/*/streams/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1alpha1/{resource=projects/*/locations/*/clusters/*/events/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1alpha1/{resource=projects/*/locations/*/clusters/*/series/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1alpha1/{resource=projects/*/locations/*/operators/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1alpha1/{resource=projects/*/locations/*/operators/*/versions/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1alpha1/{resource=projects/*/locations/*/clusters/*/analyses/*}:setIamPolicy', + body: '*', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.TestIamPermissions', + post: '/v1alpha1/{resource=projects/*/locations/*/clusters/*}:testIamPermissions', + body: '*', + additional_bindings: [ + { + post: '/v1alpha1/{resource=projects/*/locations/*/clusters/*/streams/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1alpha1/{resource=projects/*/locations/*/clusters/*/events/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1alpha1/{resource=projects/*/locations/*/clusters/*/series/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1alpha1/{resource=projects/*/locations/*/operators/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1alpha1/{resource=projects/*/locations/*/operators/*/versions/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1alpha1/{resource=projects/*/locations/*/clusters/*/analyses/*}:testIamPermissions', + body: '*', + }, + ], + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1alpha1/{name=projects/*/locations/*/operations/*}:cancel', + body: '*', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1alpha1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1alpha1/{name=projects/*/locations/*/operations/*}', + additional_bindings: [ + { + get: '/v1alpha1/{name=projects/*/locations/*/warehouseOperations/*}', + }, + { + get: '/v1alpha1/{name=projects/*/locations/*/corpora/*/assets/*/operations/*}', + }, + ], + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1alpha1/{name=projects/*/locations/*}/operations', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const deleteAssetResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty', + ) as gax.protobuf.Type; + const deleteAssetMetadata = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.DeleteAssetMetadata', + ) as gax.protobuf.Type; + const createCorpusResponse = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.Corpus', + ) as gax.protobuf.Type; + const createCorpusMetadata = protoFilesRoot.lookup( + '.google.cloud.visionai.v1alpha1.CreateCorpusMetadata', + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + deleteAsset: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteAssetResponse.decode.bind(deleteAssetResponse), + deleteAssetMetadata.decode.bind(deleteAssetMetadata), + ), + createCorpus: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createCorpusResponse.decode.bind(createCorpusResponse), + createCorpusMetadata.decode.bind(createCorpusMetadata), + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.visionai.v1alpha1.Warehouse', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + { 'x-goog-api-client': clientHeader.join(' ') }, + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.warehouseStub) { + return this.warehouseStub; + } + + // Put together the "service stub" for + // google.cloud.visionai.v1alpha1.Warehouse. + this.warehouseStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.visionai.v1alpha1.Warehouse', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.visionai.v1alpha1.Warehouse, + this._opts, + this._providedCustomServicePath, + ) as Promise<{ [method: string]: Function }>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const warehouseStubMethods = [ + 'createAsset', + 'updateAsset', + 'getAsset', + 'listAssets', + 'deleteAsset', + 'createCorpus', + 'getCorpus', + 'updateCorpus', + 'listCorpora', + 'deleteCorpus', + 'createDataSchema', + 'updateDataSchema', + 'getDataSchema', + 'deleteDataSchema', + 'listDataSchemas', + 'createAnnotation', + 'getAnnotation', + 'listAnnotations', + 'updateAnnotation', + 'deleteAnnotation', + 'ingestAsset', + 'clipAsset', + 'generateHlsUri', + 'createSearchConfig', + 'updateSearchConfig', + 'getSearchConfig', + 'deleteSearchConfig', + 'listSearchConfigs', + 'searchAssets', + ]; + for (const methodName of warehouseStubMethods) { + const callPromise = this.warehouseStub.then( + (stub) => + (...args: Array<{}>) => { + if (this._terminated) { + if (methodName in this.descriptors.stream) { + const stream = new PassThrough({ objectMode: true }); + setImmediate(() => { + stream.emit( + 'error', + new this._gaxModule.GoogleError( + 'The client has already been closed.', + ), + ); + }); + return stream; + } + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + }, + ); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.stream[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback, + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.warehouseStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'visionai.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'visionai.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return ['https://www.googleapis.com/auth/cloud-platform']; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback, + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /** + * Creates an asset inside corpus. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource where this asset will be created. + * Format: projects/* /locations/* /corpora/* + * @param {google.cloud.visionai.v1alpha1.Asset} request.asset + * Required. The asset to create. + * @param {string} [request.assetId] + * Optional. The ID to use for the asset, which will become the final component of + * the asset's resource name if user choose to specify. Otherwise, asset id + * will be generated by system. + * + * This value should be up to 63 characters, and valid characters + * are /{@link protos.0-9|a-z}-/. The first character must be a letter, the last could be + * a letter or a number. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.visionai.v1alpha1.Asset|Asset}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/warehouse.create_asset.js + * region_tag:visionai_v1alpha1_generated_Warehouse_CreateAsset_async + */ + createAsset( + request?: protos.google.cloud.visionai.v1alpha1.ICreateAssetRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IAsset, + protos.google.cloud.visionai.v1alpha1.ICreateAssetRequest | undefined, + {} | undefined, + ] + >; + createAsset( + request: protos.google.cloud.visionai.v1alpha1.ICreateAssetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.IAsset, + | protos.google.cloud.visionai.v1alpha1.ICreateAssetRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createAsset( + request: protos.google.cloud.visionai.v1alpha1.ICreateAssetRequest, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.IAsset, + | protos.google.cloud.visionai.v1alpha1.ICreateAssetRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createAsset( + request?: protos.google.cloud.visionai.v1alpha1.ICreateAssetRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.visionai.v1alpha1.IAsset, + | protos.google.cloud.visionai.v1alpha1.ICreateAssetRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.visionai.v1alpha1.IAsset, + | protos.google.cloud.visionai.v1alpha1.ICreateAssetRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IAsset, + protos.google.cloud.visionai.v1alpha1.ICreateAssetRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('createAsset request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.visionai.v1alpha1.IAsset, + | protos.google.cloud.visionai.v1alpha1.ICreateAssetRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createAsset response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createAsset(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.visionai.v1alpha1.IAsset, + protos.google.cloud.visionai.v1alpha1.ICreateAssetRequest | undefined, + {} | undefined, + ]) => { + this._log.info('createAsset response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Updates an asset inside corpus. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.visionai.v1alpha1.Asset} request.asset + * Required. The asset to update. + * + * The asset's `name` field is used to identify the asset to be updated. + * Format: + * projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset} + * @param {google.protobuf.FieldMask} request.updateMask + * The list of fields to be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.visionai.v1alpha1.Asset|Asset}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/warehouse.update_asset.js + * region_tag:visionai_v1alpha1_generated_Warehouse_UpdateAsset_async + */ + updateAsset( + request?: protos.google.cloud.visionai.v1alpha1.IUpdateAssetRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IAsset, + protos.google.cloud.visionai.v1alpha1.IUpdateAssetRequest | undefined, + {} | undefined, + ] + >; + updateAsset( + request: protos.google.cloud.visionai.v1alpha1.IUpdateAssetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.IAsset, + | protos.google.cloud.visionai.v1alpha1.IUpdateAssetRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateAsset( + request: protos.google.cloud.visionai.v1alpha1.IUpdateAssetRequest, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.IAsset, + | protos.google.cloud.visionai.v1alpha1.IUpdateAssetRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateAsset( + request?: protos.google.cloud.visionai.v1alpha1.IUpdateAssetRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.visionai.v1alpha1.IAsset, + | protos.google.cloud.visionai.v1alpha1.IUpdateAssetRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.visionai.v1alpha1.IAsset, + | protos.google.cloud.visionai.v1alpha1.IUpdateAssetRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IAsset, + protos.google.cloud.visionai.v1alpha1.IUpdateAssetRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'asset.name': request.asset!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('updateAsset request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.visionai.v1alpha1.IAsset, + | protos.google.cloud.visionai.v1alpha1.IUpdateAssetRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateAsset response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateAsset(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.visionai.v1alpha1.IAsset, + protos.google.cloud.visionai.v1alpha1.IUpdateAssetRequest | undefined, + {} | undefined, + ]) => { + this._log.info('updateAsset response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Reads an asset inside corpus. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the asset to retrieve. + * Format: + * projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.visionai.v1alpha1.Asset|Asset}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/warehouse.get_asset.js + * region_tag:visionai_v1alpha1_generated_Warehouse_GetAsset_async + */ + getAsset( + request?: protos.google.cloud.visionai.v1alpha1.IGetAssetRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IAsset, + protos.google.cloud.visionai.v1alpha1.IGetAssetRequest | undefined, + {} | undefined, + ] + >; + getAsset( + request: protos.google.cloud.visionai.v1alpha1.IGetAssetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.IAsset, + protos.google.cloud.visionai.v1alpha1.IGetAssetRequest | null | undefined, + {} | null | undefined + >, + ): void; + getAsset( + request: protos.google.cloud.visionai.v1alpha1.IGetAssetRequest, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.IAsset, + protos.google.cloud.visionai.v1alpha1.IGetAssetRequest | null | undefined, + {} | null | undefined + >, + ): void; + getAsset( + request?: protos.google.cloud.visionai.v1alpha1.IGetAssetRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.visionai.v1alpha1.IAsset, + | protos.google.cloud.visionai.v1alpha1.IGetAssetRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.visionai.v1alpha1.IAsset, + protos.google.cloud.visionai.v1alpha1.IGetAssetRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IAsset, + protos.google.cloud.visionai.v1alpha1.IGetAssetRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('getAsset request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.visionai.v1alpha1.IAsset, + | protos.google.cloud.visionai.v1alpha1.IGetAssetRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getAsset response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getAsset(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.visionai.v1alpha1.IAsset, + protos.google.cloud.visionai.v1alpha1.IGetAssetRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getAsset response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Gets corpus details inside a project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the corpus to retrieve. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.visionai.v1alpha1.Corpus|Corpus}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/warehouse.get_corpus.js + * region_tag:visionai_v1alpha1_generated_Warehouse_GetCorpus_async + */ + getCorpus( + request?: protos.google.cloud.visionai.v1alpha1.IGetCorpusRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.ICorpus, + protos.google.cloud.visionai.v1alpha1.IGetCorpusRequest | undefined, + {} | undefined, + ] + >; + getCorpus( + request: protos.google.cloud.visionai.v1alpha1.IGetCorpusRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.ICorpus, + | protos.google.cloud.visionai.v1alpha1.IGetCorpusRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getCorpus( + request: protos.google.cloud.visionai.v1alpha1.IGetCorpusRequest, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.ICorpus, + | protos.google.cloud.visionai.v1alpha1.IGetCorpusRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getCorpus( + request?: protos.google.cloud.visionai.v1alpha1.IGetCorpusRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.visionai.v1alpha1.ICorpus, + | protos.google.cloud.visionai.v1alpha1.IGetCorpusRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.visionai.v1alpha1.ICorpus, + | protos.google.cloud.visionai.v1alpha1.IGetCorpusRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.ICorpus, + protos.google.cloud.visionai.v1alpha1.IGetCorpusRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('getCorpus request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.visionai.v1alpha1.ICorpus, + | protos.google.cloud.visionai.v1alpha1.IGetCorpusRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getCorpus response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getCorpus(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.visionai.v1alpha1.ICorpus, + protos.google.cloud.visionai.v1alpha1.IGetCorpusRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getCorpus response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Updates a corpus in a project. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.visionai.v1alpha1.Corpus} request.corpus + * Required. The corpus which replaces the resource on the server. + * @param {google.protobuf.FieldMask} request.updateMask + * The list of fields to be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.visionai.v1alpha1.Corpus|Corpus}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/warehouse.update_corpus.js + * region_tag:visionai_v1alpha1_generated_Warehouse_UpdateCorpus_async + */ + updateCorpus( + request?: protos.google.cloud.visionai.v1alpha1.IUpdateCorpusRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.ICorpus, + protos.google.cloud.visionai.v1alpha1.IUpdateCorpusRequest | undefined, + {} | undefined, + ] + >; + updateCorpus( + request: protos.google.cloud.visionai.v1alpha1.IUpdateCorpusRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.ICorpus, + | protos.google.cloud.visionai.v1alpha1.IUpdateCorpusRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateCorpus( + request: protos.google.cloud.visionai.v1alpha1.IUpdateCorpusRequest, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.ICorpus, + | protos.google.cloud.visionai.v1alpha1.IUpdateCorpusRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateCorpus( + request?: protos.google.cloud.visionai.v1alpha1.IUpdateCorpusRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.visionai.v1alpha1.ICorpus, + | protos.google.cloud.visionai.v1alpha1.IUpdateCorpusRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.visionai.v1alpha1.ICorpus, + | protos.google.cloud.visionai.v1alpha1.IUpdateCorpusRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.ICorpus, + protos.google.cloud.visionai.v1alpha1.IUpdateCorpusRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'corpus.name': request.corpus!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('updateCorpus request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.visionai.v1alpha1.ICorpus, + | protos.google.cloud.visionai.v1alpha1.IUpdateCorpusRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateCorpus response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateCorpus(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.visionai.v1alpha1.ICorpus, + ( + | protos.google.cloud.visionai.v1alpha1.IUpdateCorpusRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateCorpus response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Deletes a corpus only if its empty. + * Returns empty response. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the corpus to delete. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/warehouse.delete_corpus.js + * region_tag:visionai_v1alpha1_generated_Warehouse_DeleteCorpus_async + */ + deleteCorpus( + request?: protos.google.cloud.visionai.v1alpha1.IDeleteCorpusRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IDeleteCorpusRequest | undefined, + {} | undefined, + ] + >; + deleteCorpus( + request: protos.google.cloud.visionai.v1alpha1.IDeleteCorpusRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.visionai.v1alpha1.IDeleteCorpusRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteCorpus( + request: protos.google.cloud.visionai.v1alpha1.IDeleteCorpusRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.visionai.v1alpha1.IDeleteCorpusRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteCorpus( + request?: protos.google.cloud.visionai.v1alpha1.IDeleteCorpusRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.visionai.v1alpha1.IDeleteCorpusRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.visionai.v1alpha1.IDeleteCorpusRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IDeleteCorpusRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('deleteCorpus request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.visionai.v1alpha1.IDeleteCorpusRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteCorpus response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteCorpus(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.visionai.v1alpha1.IDeleteCorpusRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteCorpus response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Creates data schema inside corpus. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource where this data schema will be created. + * Format: projects/* /locations/* /corpora/* + * @param {google.cloud.visionai.v1alpha1.DataSchema} request.dataSchema + * Required. The data schema to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.visionai.v1alpha1.DataSchema|DataSchema}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/warehouse.create_data_schema.js + * region_tag:visionai_v1alpha1_generated_Warehouse_CreateDataSchema_async + */ + createDataSchema( + request?: protos.google.cloud.visionai.v1alpha1.ICreateDataSchemaRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IDataSchema, + ( + | protos.google.cloud.visionai.v1alpha1.ICreateDataSchemaRequest + | undefined + ), + {} | undefined, + ] + >; + createDataSchema( + request: protos.google.cloud.visionai.v1alpha1.ICreateDataSchemaRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.IDataSchema, + | protos.google.cloud.visionai.v1alpha1.ICreateDataSchemaRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createDataSchema( + request: protos.google.cloud.visionai.v1alpha1.ICreateDataSchemaRequest, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.IDataSchema, + | protos.google.cloud.visionai.v1alpha1.ICreateDataSchemaRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createDataSchema( + request?: protos.google.cloud.visionai.v1alpha1.ICreateDataSchemaRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.visionai.v1alpha1.IDataSchema, + | protos.google.cloud.visionai.v1alpha1.ICreateDataSchemaRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.visionai.v1alpha1.IDataSchema, + | protos.google.cloud.visionai.v1alpha1.ICreateDataSchemaRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IDataSchema, + ( + | protos.google.cloud.visionai.v1alpha1.ICreateDataSchemaRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('createDataSchema request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.visionai.v1alpha1.IDataSchema, + | protos.google.cloud.visionai.v1alpha1.ICreateDataSchemaRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createDataSchema response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createDataSchema(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.visionai.v1alpha1.IDataSchema, + ( + | protos.google.cloud.visionai.v1alpha1.ICreateDataSchemaRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createDataSchema response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Updates data schema inside corpus. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.visionai.v1alpha1.DataSchema} request.dataSchema + * Required. The data schema's `name` field is used to identify the data schema to be + * updated. Format: + * projects/{project_number}/locations/{location}/corpora/{corpus}/dataSchemas/{data_schema} + * @param {google.protobuf.FieldMask} request.updateMask + * The list of fields to be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.visionai.v1alpha1.DataSchema|DataSchema}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/warehouse.update_data_schema.js + * region_tag:visionai_v1alpha1_generated_Warehouse_UpdateDataSchema_async + */ + updateDataSchema( + request?: protos.google.cloud.visionai.v1alpha1.IUpdateDataSchemaRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IDataSchema, + ( + | protos.google.cloud.visionai.v1alpha1.IUpdateDataSchemaRequest + | undefined + ), + {} | undefined, + ] + >; + updateDataSchema( + request: protos.google.cloud.visionai.v1alpha1.IUpdateDataSchemaRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.IDataSchema, + | protos.google.cloud.visionai.v1alpha1.IUpdateDataSchemaRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateDataSchema( + request: protos.google.cloud.visionai.v1alpha1.IUpdateDataSchemaRequest, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.IDataSchema, + | protos.google.cloud.visionai.v1alpha1.IUpdateDataSchemaRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateDataSchema( + request?: protos.google.cloud.visionai.v1alpha1.IUpdateDataSchemaRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.visionai.v1alpha1.IDataSchema, + | protos.google.cloud.visionai.v1alpha1.IUpdateDataSchemaRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.visionai.v1alpha1.IDataSchema, + | protos.google.cloud.visionai.v1alpha1.IUpdateDataSchemaRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IDataSchema, + ( + | protos.google.cloud.visionai.v1alpha1.IUpdateDataSchemaRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'data_schema.name': request.dataSchema!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('updateDataSchema request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.visionai.v1alpha1.IDataSchema, + | protos.google.cloud.visionai.v1alpha1.IUpdateDataSchemaRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateDataSchema response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateDataSchema(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.visionai.v1alpha1.IDataSchema, + ( + | protos.google.cloud.visionai.v1alpha1.IUpdateDataSchemaRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateDataSchema response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Gets data schema inside corpus. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the data schema to retrieve. + * Format: + * projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/dataSchemas/{data_schema_id} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.visionai.v1alpha1.DataSchema|DataSchema}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/warehouse.get_data_schema.js + * region_tag:visionai_v1alpha1_generated_Warehouse_GetDataSchema_async + */ + getDataSchema( + request?: protos.google.cloud.visionai.v1alpha1.IGetDataSchemaRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IDataSchema, + protos.google.cloud.visionai.v1alpha1.IGetDataSchemaRequest | undefined, + {} | undefined, + ] + >; + getDataSchema( + request: protos.google.cloud.visionai.v1alpha1.IGetDataSchemaRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.IDataSchema, + | protos.google.cloud.visionai.v1alpha1.IGetDataSchemaRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getDataSchema( + request: protos.google.cloud.visionai.v1alpha1.IGetDataSchemaRequest, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.IDataSchema, + | protos.google.cloud.visionai.v1alpha1.IGetDataSchemaRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getDataSchema( + request?: protos.google.cloud.visionai.v1alpha1.IGetDataSchemaRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.visionai.v1alpha1.IDataSchema, + | protos.google.cloud.visionai.v1alpha1.IGetDataSchemaRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.visionai.v1alpha1.IDataSchema, + | protos.google.cloud.visionai.v1alpha1.IGetDataSchemaRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IDataSchema, + protos.google.cloud.visionai.v1alpha1.IGetDataSchemaRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('getDataSchema request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.visionai.v1alpha1.IDataSchema, + | protos.google.cloud.visionai.v1alpha1.IGetDataSchemaRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getDataSchema response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getDataSchema(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.visionai.v1alpha1.IDataSchema, + ( + | protos.google.cloud.visionai.v1alpha1.IGetDataSchemaRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getDataSchema response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Deletes data schema inside corpus. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the data schema to delete. + * Format: + * projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/dataSchemas/{data_schema_id} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/warehouse.delete_data_schema.js + * region_tag:visionai_v1alpha1_generated_Warehouse_DeleteDataSchema_async + */ + deleteDataSchema( + request?: protos.google.cloud.visionai.v1alpha1.IDeleteDataSchemaRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.visionai.v1alpha1.IDeleteDataSchemaRequest + | undefined + ), + {} | undefined, + ] + >; + deleteDataSchema( + request: protos.google.cloud.visionai.v1alpha1.IDeleteDataSchemaRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.visionai.v1alpha1.IDeleteDataSchemaRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteDataSchema( + request: protos.google.cloud.visionai.v1alpha1.IDeleteDataSchemaRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.visionai.v1alpha1.IDeleteDataSchemaRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteDataSchema( + request?: protos.google.cloud.visionai.v1alpha1.IDeleteDataSchemaRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.visionai.v1alpha1.IDeleteDataSchemaRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.visionai.v1alpha1.IDeleteDataSchemaRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.visionai.v1alpha1.IDeleteDataSchemaRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('deleteDataSchema request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.visionai.v1alpha1.IDeleteDataSchemaRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteDataSchema response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteDataSchema(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.visionai.v1alpha1.IDeleteDataSchemaRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteDataSchema response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Creates annotation inside asset. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource where this annotation will be created. + * Format: projects/* /locations/* /corpora/* /assets/* + * @param {google.cloud.visionai.v1alpha1.Annotation} request.annotation + * Required. The annotation to create. + * @param {string} [request.annotationId] + * Optional. The ID to use for the annotation, which will become the final component of + * the annotation's resource name if user choose to specify. Otherwise, + * annotation id will be generated by system. + * + * This value should be up to 63 characters, and valid characters + * are /{@link protos.0-9|a-z}-/. The first character must be a letter, the last could be + * a letter or a number. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.visionai.v1alpha1.Annotation|Annotation}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/warehouse.create_annotation.js + * region_tag:visionai_v1alpha1_generated_Warehouse_CreateAnnotation_async + */ + createAnnotation( + request?: protos.google.cloud.visionai.v1alpha1.ICreateAnnotationRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IAnnotation, + ( + | protos.google.cloud.visionai.v1alpha1.ICreateAnnotationRequest + | undefined + ), + {} | undefined, + ] + >; + createAnnotation( + request: protos.google.cloud.visionai.v1alpha1.ICreateAnnotationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.IAnnotation, + | protos.google.cloud.visionai.v1alpha1.ICreateAnnotationRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createAnnotation( + request: protos.google.cloud.visionai.v1alpha1.ICreateAnnotationRequest, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.IAnnotation, + | protos.google.cloud.visionai.v1alpha1.ICreateAnnotationRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createAnnotation( + request?: protos.google.cloud.visionai.v1alpha1.ICreateAnnotationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.visionai.v1alpha1.IAnnotation, + | protos.google.cloud.visionai.v1alpha1.ICreateAnnotationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.visionai.v1alpha1.IAnnotation, + | protos.google.cloud.visionai.v1alpha1.ICreateAnnotationRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IAnnotation, + ( + | protos.google.cloud.visionai.v1alpha1.ICreateAnnotationRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('createAnnotation request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.visionai.v1alpha1.IAnnotation, + | protos.google.cloud.visionai.v1alpha1.ICreateAnnotationRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createAnnotation response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createAnnotation(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.visionai.v1alpha1.IAnnotation, + ( + | protos.google.cloud.visionai.v1alpha1.ICreateAnnotationRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createAnnotation response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Reads annotation inside asset. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the annotation to retrieve. + * Format: + * projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.visionai.v1alpha1.Annotation|Annotation}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/warehouse.get_annotation.js + * region_tag:visionai_v1alpha1_generated_Warehouse_GetAnnotation_async + */ + getAnnotation( + request?: protos.google.cloud.visionai.v1alpha1.IGetAnnotationRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IAnnotation, + protos.google.cloud.visionai.v1alpha1.IGetAnnotationRequest | undefined, + {} | undefined, + ] + >; + getAnnotation( + request: protos.google.cloud.visionai.v1alpha1.IGetAnnotationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.IAnnotation, + | protos.google.cloud.visionai.v1alpha1.IGetAnnotationRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getAnnotation( + request: protos.google.cloud.visionai.v1alpha1.IGetAnnotationRequest, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.IAnnotation, + | protos.google.cloud.visionai.v1alpha1.IGetAnnotationRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getAnnotation( + request?: protos.google.cloud.visionai.v1alpha1.IGetAnnotationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.visionai.v1alpha1.IAnnotation, + | protos.google.cloud.visionai.v1alpha1.IGetAnnotationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.visionai.v1alpha1.IAnnotation, + | protos.google.cloud.visionai.v1alpha1.IGetAnnotationRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IAnnotation, + protos.google.cloud.visionai.v1alpha1.IGetAnnotationRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('getAnnotation request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.visionai.v1alpha1.IAnnotation, + | protos.google.cloud.visionai.v1alpha1.IGetAnnotationRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getAnnotation response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getAnnotation(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.visionai.v1alpha1.IAnnotation, + ( + | protos.google.cloud.visionai.v1alpha1.IGetAnnotationRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getAnnotation response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Updates annotation inside asset. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.visionai.v1alpha1.Annotation} request.annotation + * Required. The annotation to update. + * The annotation's `name` field is used to identify the annotation to be + * updated. Format: + * projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation} + * @param {google.protobuf.FieldMask} request.updateMask + * The list of fields to be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.visionai.v1alpha1.Annotation|Annotation}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/warehouse.update_annotation.js + * region_tag:visionai_v1alpha1_generated_Warehouse_UpdateAnnotation_async + */ + updateAnnotation( + request?: protos.google.cloud.visionai.v1alpha1.IUpdateAnnotationRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IAnnotation, + ( + | protos.google.cloud.visionai.v1alpha1.IUpdateAnnotationRequest + | undefined + ), + {} | undefined, + ] + >; + updateAnnotation( + request: protos.google.cloud.visionai.v1alpha1.IUpdateAnnotationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.IAnnotation, + | protos.google.cloud.visionai.v1alpha1.IUpdateAnnotationRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateAnnotation( + request: protos.google.cloud.visionai.v1alpha1.IUpdateAnnotationRequest, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.IAnnotation, + | protos.google.cloud.visionai.v1alpha1.IUpdateAnnotationRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateAnnotation( + request?: protos.google.cloud.visionai.v1alpha1.IUpdateAnnotationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.visionai.v1alpha1.IAnnotation, + | protos.google.cloud.visionai.v1alpha1.IUpdateAnnotationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.visionai.v1alpha1.IAnnotation, + | protos.google.cloud.visionai.v1alpha1.IUpdateAnnotationRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IAnnotation, + ( + | protos.google.cloud.visionai.v1alpha1.IUpdateAnnotationRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'annotation.name': request.annotation!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('updateAnnotation request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.visionai.v1alpha1.IAnnotation, + | protos.google.cloud.visionai.v1alpha1.IUpdateAnnotationRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateAnnotation response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateAnnotation(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.visionai.v1alpha1.IAnnotation, + ( + | protos.google.cloud.visionai.v1alpha1.IUpdateAnnotationRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateAnnotation response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Deletes annotation inside asset. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the annotation to delete. + * Format: + * projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/warehouse.delete_annotation.js + * region_tag:visionai_v1alpha1_generated_Warehouse_DeleteAnnotation_async + */ + deleteAnnotation( + request?: protos.google.cloud.visionai.v1alpha1.IDeleteAnnotationRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.visionai.v1alpha1.IDeleteAnnotationRequest + | undefined + ), + {} | undefined, + ] + >; + deleteAnnotation( + request: protos.google.cloud.visionai.v1alpha1.IDeleteAnnotationRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.visionai.v1alpha1.IDeleteAnnotationRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteAnnotation( + request: protos.google.cloud.visionai.v1alpha1.IDeleteAnnotationRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.visionai.v1alpha1.IDeleteAnnotationRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteAnnotation( + request?: protos.google.cloud.visionai.v1alpha1.IDeleteAnnotationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.visionai.v1alpha1.IDeleteAnnotationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.visionai.v1alpha1.IDeleteAnnotationRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.visionai.v1alpha1.IDeleteAnnotationRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('deleteAnnotation request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.visionai.v1alpha1.IDeleteAnnotationRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteAnnotation response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteAnnotation(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.visionai.v1alpha1.IDeleteAnnotationRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteAnnotation response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Generates clips for downloading. The api takes in a time range, and + * generates a clip of the first content available after start_time and + * before end_time, which may overflow beyond these bounds. + * Returned clips are truncated if the total size of the clips are larger + * than 100MB. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the asset to request clips for. + * Form: + * 'projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}' + * @param {google.cloud.visionai.v1alpha1.Partition.TemporalPartition} request.temporalPartition + * Required. The time range to request clips for. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.visionai.v1alpha1.ClipAssetResponse|ClipAssetResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/warehouse.clip_asset.js + * region_tag:visionai_v1alpha1_generated_Warehouse_ClipAsset_async + */ + clipAsset( + request?: protos.google.cloud.visionai.v1alpha1.IClipAssetRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IClipAssetResponse, + protos.google.cloud.visionai.v1alpha1.IClipAssetRequest | undefined, + {} | undefined, + ] + >; + clipAsset( + request: protos.google.cloud.visionai.v1alpha1.IClipAssetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.IClipAssetResponse, + | protos.google.cloud.visionai.v1alpha1.IClipAssetRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + clipAsset( + request: protos.google.cloud.visionai.v1alpha1.IClipAssetRequest, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.IClipAssetResponse, + | protos.google.cloud.visionai.v1alpha1.IClipAssetRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + clipAsset( + request?: protos.google.cloud.visionai.v1alpha1.IClipAssetRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.visionai.v1alpha1.IClipAssetResponse, + | protos.google.cloud.visionai.v1alpha1.IClipAssetRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.visionai.v1alpha1.IClipAssetResponse, + | protos.google.cloud.visionai.v1alpha1.IClipAssetRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IClipAssetResponse, + protos.google.cloud.visionai.v1alpha1.IClipAssetRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('clipAsset request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.visionai.v1alpha1.IClipAssetResponse, + | protos.google.cloud.visionai.v1alpha1.IClipAssetRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('clipAsset response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .clipAsset(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.visionai.v1alpha1.IClipAssetResponse, + protos.google.cloud.visionai.v1alpha1.IClipAssetRequest | undefined, + {} | undefined, + ]) => { + this._log.info('clipAsset response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Generates a uri for an HLS manifest. The api takes in a collection of time + * ranges, and generates a URI for an HLS manifest that covers all the + * requested time ranges. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the asset to request clips for. + * Form: + * 'projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}' + * @param {number[]} request.temporalPartitions + * Required. The time range to request clips for. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.visionai.v1alpha1.GenerateHlsUriResponse|GenerateHlsUriResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/warehouse.generate_hls_uri.js + * region_tag:visionai_v1alpha1_generated_Warehouse_GenerateHlsUri_async + */ + generateHlsUri( + request?: protos.google.cloud.visionai.v1alpha1.IGenerateHlsUriRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IGenerateHlsUriResponse, + protos.google.cloud.visionai.v1alpha1.IGenerateHlsUriRequest | undefined, + {} | undefined, + ] + >; + generateHlsUri( + request: protos.google.cloud.visionai.v1alpha1.IGenerateHlsUriRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.IGenerateHlsUriResponse, + | protos.google.cloud.visionai.v1alpha1.IGenerateHlsUriRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + generateHlsUri( + request: protos.google.cloud.visionai.v1alpha1.IGenerateHlsUriRequest, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.IGenerateHlsUriResponse, + | protos.google.cloud.visionai.v1alpha1.IGenerateHlsUriRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + generateHlsUri( + request?: protos.google.cloud.visionai.v1alpha1.IGenerateHlsUriRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.visionai.v1alpha1.IGenerateHlsUriResponse, + | protos.google.cloud.visionai.v1alpha1.IGenerateHlsUriRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.visionai.v1alpha1.IGenerateHlsUriResponse, + | protos.google.cloud.visionai.v1alpha1.IGenerateHlsUriRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IGenerateHlsUriResponse, + protos.google.cloud.visionai.v1alpha1.IGenerateHlsUriRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('generateHlsUri request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.visionai.v1alpha1.IGenerateHlsUriResponse, + | protos.google.cloud.visionai.v1alpha1.IGenerateHlsUriRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('generateHlsUri response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .generateHlsUri(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.visionai.v1alpha1.IGenerateHlsUriResponse, + ( + | protos.google.cloud.visionai.v1alpha1.IGenerateHlsUriRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('generateHlsUri response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Creates a search configuration inside a corpus. + * + * Please follow the rules below to create a valid CreateSearchConfigRequest. + * --- General Rules --- + * 1. Request.search_config_id must not be associated with an existing + * SearchConfig. + * 2. Request must contain at least one non-empty search_criteria_property or + * facet_property. + * 3. mapped_fields must not be empty, and must map to existing UGA keys. + * 4. All mapped_fields must be of the same type. + * 5. All mapped_fields must share the same granularity. + * 6. All mapped_fields must share the same semantic SearchConfig match + * options. + * For property-specific rules, please reference the comments for + * FacetProperty and SearchCriteriaProperty. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource where this search configuration will be created. + * Format: projects/* /locations/* /corpora/* + * @param {google.cloud.visionai.v1alpha1.SearchConfig} request.searchConfig + * Required. The search config to create. + * @param {string} request.searchConfigId + * Required. ID to use for the new search config. Will become the final component of the + * SearchConfig's resource name. This value should be up to 63 characters, and + * valid characters are /{@link protos.0-9|a-z}-_/. The first character must be a letter, + * the last could be a letter or a number. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.visionai.v1alpha1.SearchConfig|SearchConfig}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/warehouse.create_search_config.js + * region_tag:visionai_v1alpha1_generated_Warehouse_CreateSearchConfig_async + */ + createSearchConfig( + request?: protos.google.cloud.visionai.v1alpha1.ICreateSearchConfigRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.ISearchConfig, + ( + | protos.google.cloud.visionai.v1alpha1.ICreateSearchConfigRequest + | undefined + ), + {} | undefined, + ] + >; + createSearchConfig( + request: protos.google.cloud.visionai.v1alpha1.ICreateSearchConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.ISearchConfig, + | protos.google.cloud.visionai.v1alpha1.ICreateSearchConfigRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createSearchConfig( + request: protos.google.cloud.visionai.v1alpha1.ICreateSearchConfigRequest, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.ISearchConfig, + | protos.google.cloud.visionai.v1alpha1.ICreateSearchConfigRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createSearchConfig( + request?: protos.google.cloud.visionai.v1alpha1.ICreateSearchConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.visionai.v1alpha1.ISearchConfig, + | protos.google.cloud.visionai.v1alpha1.ICreateSearchConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.visionai.v1alpha1.ISearchConfig, + | protos.google.cloud.visionai.v1alpha1.ICreateSearchConfigRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.ISearchConfig, + ( + | protos.google.cloud.visionai.v1alpha1.ICreateSearchConfigRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('createSearchConfig request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.visionai.v1alpha1.ISearchConfig, + | protos.google.cloud.visionai.v1alpha1.ICreateSearchConfigRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createSearchConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createSearchConfig(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.visionai.v1alpha1.ISearchConfig, + ( + | protos.google.cloud.visionai.v1alpha1.ICreateSearchConfigRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createSearchConfig response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Updates a search configuration inside a corpus. + * + * Please follow the rules below to create a valid UpdateSearchConfigRequest. + * --- General Rules --- + * 1. Request.search_configuration.name must already exist. + * 2. Request must contain at least one non-empty search_criteria_property or + * facet_property. + * 3. mapped_fields must not be empty, and must map to existing UGA keys. + * 4. All mapped_fields must be of the same type. + * 5. All mapped_fields must share the same granularity. + * 6. All mapped_fields must share the same semantic SearchConfig match + * options. + * For property-specific rules, please reference the comments for + * FacetProperty and SearchCriteriaProperty. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.visionai.v1alpha1.SearchConfig} request.searchConfig + * Required. The search configuration to update. + * + * The search configuration's `name` field is used to identify the resource to + * be updated. Format: + * projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config} + * @param {google.protobuf.FieldMask} request.updateMask + * The list of fields to be updated. If left unset, all field paths will be + * updated/overwritten. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.visionai.v1alpha1.SearchConfig|SearchConfig}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/warehouse.update_search_config.js + * region_tag:visionai_v1alpha1_generated_Warehouse_UpdateSearchConfig_async + */ + updateSearchConfig( + request?: protos.google.cloud.visionai.v1alpha1.IUpdateSearchConfigRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.ISearchConfig, + ( + | protos.google.cloud.visionai.v1alpha1.IUpdateSearchConfigRequest + | undefined + ), + {} | undefined, + ] + >; + updateSearchConfig( + request: protos.google.cloud.visionai.v1alpha1.IUpdateSearchConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.ISearchConfig, + | protos.google.cloud.visionai.v1alpha1.IUpdateSearchConfigRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateSearchConfig( + request: protos.google.cloud.visionai.v1alpha1.IUpdateSearchConfigRequest, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.ISearchConfig, + | protos.google.cloud.visionai.v1alpha1.IUpdateSearchConfigRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateSearchConfig( + request?: protos.google.cloud.visionai.v1alpha1.IUpdateSearchConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.visionai.v1alpha1.ISearchConfig, + | protos.google.cloud.visionai.v1alpha1.IUpdateSearchConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.visionai.v1alpha1.ISearchConfig, + | protos.google.cloud.visionai.v1alpha1.IUpdateSearchConfigRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.ISearchConfig, + ( + | protos.google.cloud.visionai.v1alpha1.IUpdateSearchConfigRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'search_config.name': request.searchConfig!.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('updateSearchConfig request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.visionai.v1alpha1.ISearchConfig, + | protos.google.cloud.visionai.v1alpha1.IUpdateSearchConfigRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateSearchConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateSearchConfig(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.visionai.v1alpha1.ISearchConfig, + ( + | protos.google.cloud.visionai.v1alpha1.IUpdateSearchConfigRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateSearchConfig response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Gets a search configuration inside a corpus. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the search configuration to retrieve. + * Format: + * projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.visionai.v1alpha1.SearchConfig|SearchConfig}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/warehouse.get_search_config.js + * region_tag:visionai_v1alpha1_generated_Warehouse_GetSearchConfig_async + */ + getSearchConfig( + request?: protos.google.cloud.visionai.v1alpha1.IGetSearchConfigRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.ISearchConfig, + protos.google.cloud.visionai.v1alpha1.IGetSearchConfigRequest | undefined, + {} | undefined, + ] + >; + getSearchConfig( + request: protos.google.cloud.visionai.v1alpha1.IGetSearchConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.ISearchConfig, + | protos.google.cloud.visionai.v1alpha1.IGetSearchConfigRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getSearchConfig( + request: protos.google.cloud.visionai.v1alpha1.IGetSearchConfigRequest, + callback: Callback< + protos.google.cloud.visionai.v1alpha1.ISearchConfig, + | protos.google.cloud.visionai.v1alpha1.IGetSearchConfigRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getSearchConfig( + request?: protos.google.cloud.visionai.v1alpha1.IGetSearchConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.visionai.v1alpha1.ISearchConfig, + | protos.google.cloud.visionai.v1alpha1.IGetSearchConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.visionai.v1alpha1.ISearchConfig, + | protos.google.cloud.visionai.v1alpha1.IGetSearchConfigRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.ISearchConfig, + protos.google.cloud.visionai.v1alpha1.IGetSearchConfigRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('getSearchConfig request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.visionai.v1alpha1.ISearchConfig, + | protos.google.cloud.visionai.v1alpha1.IGetSearchConfigRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getSearchConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getSearchConfig(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.visionai.v1alpha1.ISearchConfig, + ( + | protos.google.cloud.visionai.v1alpha1.IGetSearchConfigRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getSearchConfig response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Deletes a search configuration inside a corpus. + * + * For a DeleteSearchConfigRequest to be valid, + * Request.search_configuration.name must already exist. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the search configuration to delete. + * Format: + * projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/warehouse.delete_search_config.js + * region_tag:visionai_v1alpha1_generated_Warehouse_DeleteSearchConfig_async + */ + deleteSearchConfig( + request?: protos.google.cloud.visionai.v1alpha1.IDeleteSearchConfigRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.visionai.v1alpha1.IDeleteSearchConfigRequest + | undefined + ), + {} | undefined, + ] + >; + deleteSearchConfig( + request: protos.google.cloud.visionai.v1alpha1.IDeleteSearchConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.visionai.v1alpha1.IDeleteSearchConfigRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteSearchConfig( + request: protos.google.cloud.visionai.v1alpha1.IDeleteSearchConfigRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.visionai.v1alpha1.IDeleteSearchConfigRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteSearchConfig( + request?: protos.google.cloud.visionai.v1alpha1.IDeleteSearchConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.visionai.v1alpha1.IDeleteSearchConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.visionai.v1alpha1.IDeleteSearchConfigRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.visionai.v1alpha1.IDeleteSearchConfigRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('deleteSearchConfig request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.visionai.v1alpha1.IDeleteSearchConfigRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteSearchConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteSearchConfig(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.visionai.v1alpha1.IDeleteSearchConfigRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteSearchConfig response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Ingests data for the asset. It is not allowed to ingest a data chunk which + * is already expired according to TTL. + * This method is only available via the gRPC API (not HTTP since + * bi-directional streaming is not supported via HTTP). + * + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which is both readable and writable. It accepts objects + * representing {@link protos.google.cloud.visionai.v1alpha1.IngestAssetRequest|IngestAssetRequest} for write() method, and + * will emit objects representing {@link protos.google.cloud.visionai.v1alpha1.IngestAssetResponse|IngestAssetResponse} on 'data' event asynchronously. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#bi-directional-streaming | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/warehouse.ingest_asset.js + * region_tag:visionai_v1alpha1_generated_Warehouse_IngestAsset_async + */ + ingestAsset(options?: CallOptions): gax.CancellableStream { + this.initialize().catch((err) => { + throw err; + }); + this._log.info('ingestAsset stream %j', options); + return this.innerApiCalls.ingestAsset(null, options); + } + + /** + * Deletes asset inside corpus. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the asset to delete. + * Format: + * projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/warehouse.delete_asset.js + * region_tag:visionai_v1alpha1_generated_Warehouse_DeleteAsset_async + */ + deleteAsset( + request?: protos.google.cloud.visionai.v1alpha1.IDeleteAssetRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IDeleteAssetMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deleteAsset( + request: protos.google.cloud.visionai.v1alpha1.IDeleteAssetRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IDeleteAssetMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + deleteAsset( + request: protos.google.cloud.visionai.v1alpha1.IDeleteAssetRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IDeleteAssetMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + deleteAsset( + request?: protos.google.cloud.visionai.v1alpha1.IDeleteAssetRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IDeleteAssetMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IDeleteAssetMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IDeleteAssetMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IDeleteAssetMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteAsset response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteAsset request %j', request); + return this.innerApiCalls + .deleteAsset(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IDeleteAssetMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteAsset response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `deleteAsset()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/warehouse.delete_asset.js + * region_tag:visionai_v1alpha1_generated_Warehouse_DeleteAsset_async + */ + async checkDeleteAssetProgress( + name: string, + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.visionai.v1alpha1.DeleteAssetMetadata + > + > { + this._log.info('deleteAsset long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteAsset, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.visionai.v1alpha1.DeleteAssetMetadata + >; + } + /** + * Creates a corpus inside a project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Form: `projects/{project_number}/locations/{location_id}` + * @param {google.cloud.visionai.v1alpha1.Corpus} request.corpus + * Required. The corpus to be created. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/warehouse.create_corpus.js + * region_tag:visionai_v1alpha1_generated_Warehouse_CreateCorpus_async + */ + createCorpus( + request?: protos.google.cloud.visionai.v1alpha1.ICreateCorpusRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.cloud.visionai.v1alpha1.ICorpus, + protos.google.cloud.visionai.v1alpha1.ICreateCorpusMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createCorpus( + request: protos.google.cloud.visionai.v1alpha1.ICreateCorpusRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.ICorpus, + protos.google.cloud.visionai.v1alpha1.ICreateCorpusMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createCorpus( + request: protos.google.cloud.visionai.v1alpha1.ICreateCorpusRequest, + callback: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.ICorpus, + protos.google.cloud.visionai.v1alpha1.ICreateCorpusMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createCorpus( + request?: protos.google.cloud.visionai.v1alpha1.ICreateCorpusRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.ICorpus, + protos.google.cloud.visionai.v1alpha1.ICreateCorpusMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.ICorpus, + protos.google.cloud.visionai.v1alpha1.ICreateCorpusMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.cloud.visionai.v1alpha1.ICorpus, + protos.google.cloud.visionai.v1alpha1.ICreateCorpusMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.visionai.v1alpha1.ICorpus, + protos.google.cloud.visionai.v1alpha1.ICreateCorpusMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createCorpus response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createCorpus request %j', request); + return this.innerApiCalls + .createCorpus(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.visionai.v1alpha1.ICorpus, + protos.google.cloud.visionai.v1alpha1.ICreateCorpusMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createCorpus response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `createCorpus()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/warehouse.create_corpus.js + * region_tag:visionai_v1alpha1_generated_Warehouse_CreateCorpus_async + */ + async checkCreateCorpusProgress( + name: string, + ): Promise< + LROperation< + protos.google.cloud.visionai.v1alpha1.Corpus, + protos.google.cloud.visionai.v1alpha1.CreateCorpusMetadata + > + > { + this._log.info('createCorpus long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createCorpus, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.cloud.visionai.v1alpha1.Corpus, + protos.google.cloud.visionai.v1alpha1.CreateCorpusMetadata + >; + } + /** + * Lists an list of assets inside corpus. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of assets. + * Format: + * projects/{project_number}/locations/{location}/corpora/{corpus} + * @param {number} request.pageSize + * The maximum number of assets to return. The service may return fewer than + * this value. + * If unspecified, at most 50 assets will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListAssets` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListAssets` must match + * the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.visionai.v1alpha1.Asset|Asset}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listAssetsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listAssets( + request?: protos.google.cloud.visionai.v1alpha1.IListAssetsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IAsset[], + protos.google.cloud.visionai.v1alpha1.IListAssetsRequest | null, + protos.google.cloud.visionai.v1alpha1.IListAssetsResponse, + ] + >; + listAssets( + request: protos.google.cloud.visionai.v1alpha1.IListAssetsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListAssetsRequest, + | protos.google.cloud.visionai.v1alpha1.IListAssetsResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.IAsset + >, + ): void; + listAssets( + request: protos.google.cloud.visionai.v1alpha1.IListAssetsRequest, + callback: PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListAssetsRequest, + | protos.google.cloud.visionai.v1alpha1.IListAssetsResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.IAsset + >, + ): void; + listAssets( + request?: protos.google.cloud.visionai.v1alpha1.IListAssetsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListAssetsRequest, + | protos.google.cloud.visionai.v1alpha1.IListAssetsResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.IAsset + >, + callback?: PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListAssetsRequest, + | protos.google.cloud.visionai.v1alpha1.IListAssetsResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.IAsset + >, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IAsset[], + protos.google.cloud.visionai.v1alpha1.IListAssetsRequest | null, + protos.google.cloud.visionai.v1alpha1.IListAssetsResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListAssetsRequest, + | protos.google.cloud.visionai.v1alpha1.IListAssetsResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.IAsset + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listAssets values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listAssets request %j', request); + return this.innerApiCalls + .listAssets(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.visionai.v1alpha1.IAsset[], + protos.google.cloud.visionai.v1alpha1.IListAssetsRequest | null, + protos.google.cloud.visionai.v1alpha1.IListAssetsResponse, + ]) => { + this._log.info('listAssets values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listAssets`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of assets. + * Format: + * projects/{project_number}/locations/{location}/corpora/{corpus} + * @param {number} request.pageSize + * The maximum number of assets to return. The service may return fewer than + * this value. + * If unspecified, at most 50 assets will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListAssets` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListAssets` must match + * the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.visionai.v1alpha1.Asset|Asset} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listAssetsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listAssetsStream( + request?: protos.google.cloud.visionai.v1alpha1.IListAssetsRequest, + options?: CallOptions, + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listAssets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listAssets stream %j', request); + return this.descriptors.page.listAssets.createStream( + this.innerApiCalls.listAssets as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listAssets`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of assets. + * Format: + * projects/{project_number}/locations/{location}/corpora/{corpus} + * @param {number} request.pageSize + * The maximum number of assets to return. The service may return fewer than + * this value. + * If unspecified, at most 50 assets will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListAssets` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListAssets` must match + * the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.visionai.v1alpha1.Asset|Asset}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/warehouse.list_assets.js + * region_tag:visionai_v1alpha1_generated_Warehouse_ListAssets_async + */ + listAssetsAsync( + request?: protos.google.cloud.visionai.v1alpha1.IListAssetsRequest, + options?: CallOptions, + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listAssets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listAssets iterate %j', request); + return this.descriptors.page.listAssets.asyncIterate( + this.innerApiCalls['listAssets'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + /** + * Lists all corpora in a project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the project from which to list corpora. + * @param {number} request.pageSize + * Requested page size. API may return fewer results than requested. + * If negative, INVALID_ARGUMENT error will be returned. + * If unspecified or 0, API will pick a default size, which is 10. + * If the requested page size is larger than the maximum size, API will pick + * use the maximum size, which is 20. + * @param {string} request.pageToken + * A token identifying a page of results for the server to return. + * Typically obtained via {@link protos.|ListCorpora.next_page_token} of the previous + * {@link protos.google.cloud.visionai.v1alpha1.Warehouse.ListCorpora|Warehouse.ListCorpora} call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.visionai.v1alpha1.Corpus|Corpus}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listCorporaAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listCorpora( + request?: protos.google.cloud.visionai.v1alpha1.IListCorporaRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.ICorpus[], + protos.google.cloud.visionai.v1alpha1.IListCorporaRequest | null, + protos.google.cloud.visionai.v1alpha1.IListCorporaResponse, + ] + >; + listCorpora( + request: protos.google.cloud.visionai.v1alpha1.IListCorporaRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListCorporaRequest, + | protos.google.cloud.visionai.v1alpha1.IListCorporaResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.ICorpus + >, + ): void; + listCorpora( + request: protos.google.cloud.visionai.v1alpha1.IListCorporaRequest, + callback: PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListCorporaRequest, + | protos.google.cloud.visionai.v1alpha1.IListCorporaResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.ICorpus + >, + ): void; + listCorpora( + request?: protos.google.cloud.visionai.v1alpha1.IListCorporaRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListCorporaRequest, + | protos.google.cloud.visionai.v1alpha1.IListCorporaResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.ICorpus + >, + callback?: PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListCorporaRequest, + | protos.google.cloud.visionai.v1alpha1.IListCorporaResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.ICorpus + >, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.ICorpus[], + protos.google.cloud.visionai.v1alpha1.IListCorporaRequest | null, + protos.google.cloud.visionai.v1alpha1.IListCorporaResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListCorporaRequest, + | protos.google.cloud.visionai.v1alpha1.IListCorporaResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.ICorpus + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listCorpora values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listCorpora request %j', request); + return this.innerApiCalls + .listCorpora(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.visionai.v1alpha1.ICorpus[], + protos.google.cloud.visionai.v1alpha1.IListCorporaRequest | null, + protos.google.cloud.visionai.v1alpha1.IListCorporaResponse, + ]) => { + this._log.info('listCorpora values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listCorpora`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the project from which to list corpora. + * @param {number} request.pageSize + * Requested page size. API may return fewer results than requested. + * If negative, INVALID_ARGUMENT error will be returned. + * If unspecified or 0, API will pick a default size, which is 10. + * If the requested page size is larger than the maximum size, API will pick + * use the maximum size, which is 20. + * @param {string} request.pageToken + * A token identifying a page of results for the server to return. + * Typically obtained via {@link protos.|ListCorpora.next_page_token} of the previous + * {@link protos.google.cloud.visionai.v1alpha1.Warehouse.ListCorpora|Warehouse.ListCorpora} call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.visionai.v1alpha1.Corpus|Corpus} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listCorporaAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listCorporaStream( + request?: protos.google.cloud.visionai.v1alpha1.IListCorporaRequest, + options?: CallOptions, + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listCorpora']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listCorpora stream %j', request); + return this.descriptors.page.listCorpora.createStream( + this.innerApiCalls.listCorpora as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listCorpora`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the project from which to list corpora. + * @param {number} request.pageSize + * Requested page size. API may return fewer results than requested. + * If negative, INVALID_ARGUMENT error will be returned. + * If unspecified or 0, API will pick a default size, which is 10. + * If the requested page size is larger than the maximum size, API will pick + * use the maximum size, which is 20. + * @param {string} request.pageToken + * A token identifying a page of results for the server to return. + * Typically obtained via {@link protos.|ListCorpora.next_page_token} of the previous + * {@link protos.google.cloud.visionai.v1alpha1.Warehouse.ListCorpora|Warehouse.ListCorpora} call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.visionai.v1alpha1.Corpus|Corpus}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/warehouse.list_corpora.js + * region_tag:visionai_v1alpha1_generated_Warehouse_ListCorpora_async + */ + listCorporaAsync( + request?: protos.google.cloud.visionai.v1alpha1.IListCorporaRequest, + options?: CallOptions, + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listCorpora']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listCorpora iterate %j', request); + return this.descriptors.page.listCorpora.asyncIterate( + this.innerApiCalls['listCorpora'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + /** + * Lists a list of data schemas inside corpus. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of data schemas. + * Format: + * projects/{project_number}/locations/{location_id}/corpora/{corpus_id} + * @param {number} request.pageSize + * The maximum number of data schemas to return. The service may return fewer + * than this value. If unspecified, at most 50 data schemas will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListDataSchemas` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListDataSchemas` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.visionai.v1alpha1.DataSchema|DataSchema}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listDataSchemasAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listDataSchemas( + request?: protos.google.cloud.visionai.v1alpha1.IListDataSchemasRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IDataSchema[], + protos.google.cloud.visionai.v1alpha1.IListDataSchemasRequest | null, + protos.google.cloud.visionai.v1alpha1.IListDataSchemasResponse, + ] + >; + listDataSchemas( + request: protos.google.cloud.visionai.v1alpha1.IListDataSchemasRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListDataSchemasRequest, + | protos.google.cloud.visionai.v1alpha1.IListDataSchemasResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.IDataSchema + >, + ): void; + listDataSchemas( + request: protos.google.cloud.visionai.v1alpha1.IListDataSchemasRequest, + callback: PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListDataSchemasRequest, + | protos.google.cloud.visionai.v1alpha1.IListDataSchemasResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.IDataSchema + >, + ): void; + listDataSchemas( + request?: protos.google.cloud.visionai.v1alpha1.IListDataSchemasRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListDataSchemasRequest, + | protos.google.cloud.visionai.v1alpha1.IListDataSchemasResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.IDataSchema + >, + callback?: PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListDataSchemasRequest, + | protos.google.cloud.visionai.v1alpha1.IListDataSchemasResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.IDataSchema + >, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IDataSchema[], + protos.google.cloud.visionai.v1alpha1.IListDataSchemasRequest | null, + protos.google.cloud.visionai.v1alpha1.IListDataSchemasResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListDataSchemasRequest, + | protos.google.cloud.visionai.v1alpha1.IListDataSchemasResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.IDataSchema + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listDataSchemas values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listDataSchemas request %j', request); + return this.innerApiCalls + .listDataSchemas(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.visionai.v1alpha1.IDataSchema[], + protos.google.cloud.visionai.v1alpha1.IListDataSchemasRequest | null, + protos.google.cloud.visionai.v1alpha1.IListDataSchemasResponse, + ]) => { + this._log.info('listDataSchemas values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listDataSchemas`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of data schemas. + * Format: + * projects/{project_number}/locations/{location_id}/corpora/{corpus_id} + * @param {number} request.pageSize + * The maximum number of data schemas to return. The service may return fewer + * than this value. If unspecified, at most 50 data schemas will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListDataSchemas` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListDataSchemas` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.visionai.v1alpha1.DataSchema|DataSchema} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listDataSchemasAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listDataSchemasStream( + request?: protos.google.cloud.visionai.v1alpha1.IListDataSchemasRequest, + options?: CallOptions, + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listDataSchemas']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listDataSchemas stream %j', request); + return this.descriptors.page.listDataSchemas.createStream( + this.innerApiCalls.listDataSchemas as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listDataSchemas`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of data schemas. + * Format: + * projects/{project_number}/locations/{location_id}/corpora/{corpus_id} + * @param {number} request.pageSize + * The maximum number of data schemas to return. The service may return fewer + * than this value. If unspecified, at most 50 data schemas will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListDataSchemas` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListDataSchemas` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.visionai.v1alpha1.DataSchema|DataSchema}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/warehouse.list_data_schemas.js + * region_tag:visionai_v1alpha1_generated_Warehouse_ListDataSchemas_async + */ + listDataSchemasAsync( + request?: protos.google.cloud.visionai.v1alpha1.IListDataSchemasRequest, + options?: CallOptions, + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listDataSchemas']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listDataSchemas iterate %j', request); + return this.descriptors.page.listDataSchemas.asyncIterate( + this.innerApiCalls['listDataSchemas'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + /** + * Lists a list of annotations inside asset. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * The parent, which owns this collection of annotations. + * Format: + * projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset} + * @param {number} request.pageSize + * The maximum number of annotations to return. The service may return fewer + * than this value. If unspecified, at most 50 annotations will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListAnnotations` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListAnnotations` must + * match the call that provided the page token. + * @param {string} request.filter + * The filter applied to the returned list. + * We only support filtering for the following fields: + * `partition.temporal_partition.start_time`, + * `partition.temporal_partition.end_time`, and `key`. + * Timestamps are specified in the RFC-3339 format, and only one restriction + * may be applied per field, joined by conjunctions. + * Format: + * "partition.temporal_partition.start_time > "2012-04-21T11:30:00-04:00" AND + * partition.temporal_partition.end_time < "2012-04-22T11:30:00-04:00" AND + * key = "example_key"" + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.visionai.v1alpha1.Annotation|Annotation}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listAnnotationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listAnnotations( + request?: protos.google.cloud.visionai.v1alpha1.IListAnnotationsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IAnnotation[], + protos.google.cloud.visionai.v1alpha1.IListAnnotationsRequest | null, + protos.google.cloud.visionai.v1alpha1.IListAnnotationsResponse, + ] + >; + listAnnotations( + request: protos.google.cloud.visionai.v1alpha1.IListAnnotationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListAnnotationsRequest, + | protos.google.cloud.visionai.v1alpha1.IListAnnotationsResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.IAnnotation + >, + ): void; + listAnnotations( + request: protos.google.cloud.visionai.v1alpha1.IListAnnotationsRequest, + callback: PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListAnnotationsRequest, + | protos.google.cloud.visionai.v1alpha1.IListAnnotationsResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.IAnnotation + >, + ): void; + listAnnotations( + request?: protos.google.cloud.visionai.v1alpha1.IListAnnotationsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListAnnotationsRequest, + | protos.google.cloud.visionai.v1alpha1.IListAnnotationsResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.IAnnotation + >, + callback?: PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListAnnotationsRequest, + | protos.google.cloud.visionai.v1alpha1.IListAnnotationsResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.IAnnotation + >, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.IAnnotation[], + protos.google.cloud.visionai.v1alpha1.IListAnnotationsRequest | null, + protos.google.cloud.visionai.v1alpha1.IListAnnotationsResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListAnnotationsRequest, + | protos.google.cloud.visionai.v1alpha1.IListAnnotationsResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.IAnnotation + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listAnnotations values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listAnnotations request %j', request); + return this.innerApiCalls + .listAnnotations(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.visionai.v1alpha1.IAnnotation[], + protos.google.cloud.visionai.v1alpha1.IListAnnotationsRequest | null, + protos.google.cloud.visionai.v1alpha1.IListAnnotationsResponse, + ]) => { + this._log.info('listAnnotations values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listAnnotations`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * The parent, which owns this collection of annotations. + * Format: + * projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset} + * @param {number} request.pageSize + * The maximum number of annotations to return. The service may return fewer + * than this value. If unspecified, at most 50 annotations will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListAnnotations` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListAnnotations` must + * match the call that provided the page token. + * @param {string} request.filter + * The filter applied to the returned list. + * We only support filtering for the following fields: + * `partition.temporal_partition.start_time`, + * `partition.temporal_partition.end_time`, and `key`. + * Timestamps are specified in the RFC-3339 format, and only one restriction + * may be applied per field, joined by conjunctions. + * Format: + * "partition.temporal_partition.start_time > "2012-04-21T11:30:00-04:00" AND + * partition.temporal_partition.end_time < "2012-04-22T11:30:00-04:00" AND + * key = "example_key"" + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.visionai.v1alpha1.Annotation|Annotation} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listAnnotationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listAnnotationsStream( + request?: protos.google.cloud.visionai.v1alpha1.IListAnnotationsRequest, + options?: CallOptions, + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listAnnotations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listAnnotations stream %j', request); + return this.descriptors.page.listAnnotations.createStream( + this.innerApiCalls.listAnnotations as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listAnnotations`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * The parent, which owns this collection of annotations. + * Format: + * projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset} + * @param {number} request.pageSize + * The maximum number of annotations to return. The service may return fewer + * than this value. If unspecified, at most 50 annotations will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListAnnotations` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListAnnotations` must + * match the call that provided the page token. + * @param {string} request.filter + * The filter applied to the returned list. + * We only support filtering for the following fields: + * `partition.temporal_partition.start_time`, + * `partition.temporal_partition.end_time`, and `key`. + * Timestamps are specified in the RFC-3339 format, and only one restriction + * may be applied per field, joined by conjunctions. + * Format: + * "partition.temporal_partition.start_time > "2012-04-21T11:30:00-04:00" AND + * partition.temporal_partition.end_time < "2012-04-22T11:30:00-04:00" AND + * key = "example_key"" + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.visionai.v1alpha1.Annotation|Annotation}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/warehouse.list_annotations.js + * region_tag:visionai_v1alpha1_generated_Warehouse_ListAnnotations_async + */ + listAnnotationsAsync( + request?: protos.google.cloud.visionai.v1alpha1.IListAnnotationsRequest, + options?: CallOptions, + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listAnnotations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listAnnotations iterate %j', request); + return this.descriptors.page.listAnnotations.asyncIterate( + this.innerApiCalls['listAnnotations'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + /** + * Lists all search configurations inside a corpus. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of search configurations. + * Format: + * projects/{project_number}/locations/{location}/corpora/{corpus} + * @param {number} request.pageSize + * The maximum number of search configurations to return. The service may + * return fewer than this value. If unspecified, a page size of 50 will be + * used. The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListSearchConfigs` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListSearchConfigs` must match the call that provided the page + * token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.visionai.v1alpha1.SearchConfig|SearchConfig}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listSearchConfigsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSearchConfigs( + request?: protos.google.cloud.visionai.v1alpha1.IListSearchConfigsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.ISearchConfig[], + protos.google.cloud.visionai.v1alpha1.IListSearchConfigsRequest | null, + protos.google.cloud.visionai.v1alpha1.IListSearchConfigsResponse, + ] + >; + listSearchConfigs( + request: protos.google.cloud.visionai.v1alpha1.IListSearchConfigsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListSearchConfigsRequest, + | protos.google.cloud.visionai.v1alpha1.IListSearchConfigsResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.ISearchConfig + >, + ): void; + listSearchConfigs( + request: protos.google.cloud.visionai.v1alpha1.IListSearchConfigsRequest, + callback: PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListSearchConfigsRequest, + | protos.google.cloud.visionai.v1alpha1.IListSearchConfigsResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.ISearchConfig + >, + ): void; + listSearchConfigs( + request?: protos.google.cloud.visionai.v1alpha1.IListSearchConfigsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListSearchConfigsRequest, + | protos.google.cloud.visionai.v1alpha1.IListSearchConfigsResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.ISearchConfig + >, + callback?: PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListSearchConfigsRequest, + | protos.google.cloud.visionai.v1alpha1.IListSearchConfigsResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.ISearchConfig + >, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.ISearchConfig[], + protos.google.cloud.visionai.v1alpha1.IListSearchConfigsRequest | null, + protos.google.cloud.visionai.v1alpha1.IListSearchConfigsResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.visionai.v1alpha1.IListSearchConfigsRequest, + | protos.google.cloud.visionai.v1alpha1.IListSearchConfigsResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.ISearchConfig + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listSearchConfigs values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listSearchConfigs request %j', request); + return this.innerApiCalls + .listSearchConfigs(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.visionai.v1alpha1.ISearchConfig[], + protos.google.cloud.visionai.v1alpha1.IListSearchConfigsRequest | null, + protos.google.cloud.visionai.v1alpha1.IListSearchConfigsResponse, + ]) => { + this._log.info('listSearchConfigs values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listSearchConfigs`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of search configurations. + * Format: + * projects/{project_number}/locations/{location}/corpora/{corpus} + * @param {number} request.pageSize + * The maximum number of search configurations to return. The service may + * return fewer than this value. If unspecified, a page size of 50 will be + * used. The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListSearchConfigs` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListSearchConfigs` must match the call that provided the page + * token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.visionai.v1alpha1.SearchConfig|SearchConfig} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listSearchConfigsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSearchConfigsStream( + request?: protos.google.cloud.visionai.v1alpha1.IListSearchConfigsRequest, + options?: CallOptions, + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listSearchConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listSearchConfigs stream %j', request); + return this.descriptors.page.listSearchConfigs.createStream( + this.innerApiCalls.listSearchConfigs as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listSearchConfigs`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of search configurations. + * Format: + * projects/{project_number}/locations/{location}/corpora/{corpus} + * @param {number} request.pageSize + * The maximum number of search configurations to return. The service may + * return fewer than this value. If unspecified, a page size of 50 will be + * used. The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListSearchConfigs` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListSearchConfigs` must match the call that provided the page + * token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.visionai.v1alpha1.SearchConfig|SearchConfig}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/warehouse.list_search_configs.js + * region_tag:visionai_v1alpha1_generated_Warehouse_ListSearchConfigs_async + */ + listSearchConfigsAsync( + request?: protos.google.cloud.visionai.v1alpha1.IListSearchConfigsRequest, + options?: CallOptions, + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listSearchConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listSearchConfigs iterate %j', request); + return this.descriptors.page.listSearchConfigs.asyncIterate( + this.innerApiCalls['listSearchConfigs'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + /** + * Search media asset. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.corpus + * Required. The parent corpus to search. + * Form: `projects/{project_id}/locations/{location_id}/corpora/{corpus_id}' + * @param {number} request.pageSize + * The number of results to be returned in this page. If it's 0, the server + * will decide the appropriate page_size. + * @param {string} request.pageToken + * The continuation token to fetch the next page. If empty, it means it is + * fetching the first page. + * @param {google.cloud.visionai.v1alpha1.DateTimeRangeArray} request.contentTimeRanges + * Time ranges that matching video content must fall within. If no ranges are + * provided, there will be no time restriction. This field is treated just + * like the criteria below, but defined separately for convenience as it is + * used frequently. Note that if the end_time is in the future, it will be + * clamped to the time the request was received. + * @param {number[]} request.criteria + * Criteria applied to search results. + * @param {number[]} request.facetSelections + * Stores most recent facet selection state. Only facet groups with user's + * selection will be presented here. Selection state is either selected or + * unselected. Only selected facet buckets will be used as search criteria. + * @param {string[]} request.resultAnnotationKeys + * A list of annotation keys to specify the annotations to be retrieved and + * returned with each search result. + * Annotation granularity must be GRANULARITY_ASSET_LEVEL and its search + * strategy must not be NO_SEARCH. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.visionai.v1alpha1.SearchResultItem|SearchResultItem}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `searchAssetsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + searchAssets( + request?: protos.google.cloud.visionai.v1alpha1.ISearchAssetsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.ISearchResultItem[], + protos.google.cloud.visionai.v1alpha1.ISearchAssetsRequest | null, + protos.google.cloud.visionai.v1alpha1.ISearchAssetsResponse, + ] + >; + searchAssets( + request: protos.google.cloud.visionai.v1alpha1.ISearchAssetsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.visionai.v1alpha1.ISearchAssetsRequest, + | protos.google.cloud.visionai.v1alpha1.ISearchAssetsResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.ISearchResultItem + >, + ): void; + searchAssets( + request: protos.google.cloud.visionai.v1alpha1.ISearchAssetsRequest, + callback: PaginationCallback< + protos.google.cloud.visionai.v1alpha1.ISearchAssetsRequest, + | protos.google.cloud.visionai.v1alpha1.ISearchAssetsResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.ISearchResultItem + >, + ): void; + searchAssets( + request?: protos.google.cloud.visionai.v1alpha1.ISearchAssetsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.visionai.v1alpha1.ISearchAssetsRequest, + | protos.google.cloud.visionai.v1alpha1.ISearchAssetsResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.ISearchResultItem + >, + callback?: PaginationCallback< + protos.google.cloud.visionai.v1alpha1.ISearchAssetsRequest, + | protos.google.cloud.visionai.v1alpha1.ISearchAssetsResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.ISearchResultItem + >, + ): Promise< + [ + protos.google.cloud.visionai.v1alpha1.ISearchResultItem[], + protos.google.cloud.visionai.v1alpha1.ISearchAssetsRequest | null, + protos.google.cloud.visionai.v1alpha1.ISearchAssetsResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + corpus: request.corpus ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.visionai.v1alpha1.ISearchAssetsRequest, + | protos.google.cloud.visionai.v1alpha1.ISearchAssetsResponse + | null + | undefined, + protos.google.cloud.visionai.v1alpha1.ISearchResultItem + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('searchAssets values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('searchAssets request %j', request); + return this.innerApiCalls + .searchAssets(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.visionai.v1alpha1.ISearchResultItem[], + protos.google.cloud.visionai.v1alpha1.ISearchAssetsRequest | null, + protos.google.cloud.visionai.v1alpha1.ISearchAssetsResponse, + ]) => { + this._log.info('searchAssets values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `searchAssets`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.corpus + * Required. The parent corpus to search. + * Form: `projects/{project_id}/locations/{location_id}/corpora/{corpus_id}' + * @param {number} request.pageSize + * The number of results to be returned in this page. If it's 0, the server + * will decide the appropriate page_size. + * @param {string} request.pageToken + * The continuation token to fetch the next page. If empty, it means it is + * fetching the first page. + * @param {google.cloud.visionai.v1alpha1.DateTimeRangeArray} request.contentTimeRanges + * Time ranges that matching video content must fall within. If no ranges are + * provided, there will be no time restriction. This field is treated just + * like the criteria below, but defined separately for convenience as it is + * used frequently. Note that if the end_time is in the future, it will be + * clamped to the time the request was received. + * @param {number[]} request.criteria + * Criteria applied to search results. + * @param {number[]} request.facetSelections + * Stores most recent facet selection state. Only facet groups with user's + * selection will be presented here. Selection state is either selected or + * unselected. Only selected facet buckets will be used as search criteria. + * @param {string[]} request.resultAnnotationKeys + * A list of annotation keys to specify the annotations to be retrieved and + * returned with each search result. + * Annotation granularity must be GRANULARITY_ASSET_LEVEL and its search + * strategy must not be NO_SEARCH. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.visionai.v1alpha1.SearchResultItem|SearchResultItem} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `searchAssetsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + searchAssetsStream( + request?: protos.google.cloud.visionai.v1alpha1.ISearchAssetsRequest, + options?: CallOptions, + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + corpus: request.corpus ?? '', + }); + const defaultCallSettings = this._defaults['searchAssets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('searchAssets stream %j', request); + return this.descriptors.page.searchAssets.createStream( + this.innerApiCalls.searchAssets as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `searchAssets`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.corpus + * Required. The parent corpus to search. + * Form: `projects/{project_id}/locations/{location_id}/corpora/{corpus_id}' + * @param {number} request.pageSize + * The number of results to be returned in this page. If it's 0, the server + * will decide the appropriate page_size. + * @param {string} request.pageToken + * The continuation token to fetch the next page. If empty, it means it is + * fetching the first page. + * @param {google.cloud.visionai.v1alpha1.DateTimeRangeArray} request.contentTimeRanges + * Time ranges that matching video content must fall within. If no ranges are + * provided, there will be no time restriction. This field is treated just + * like the criteria below, but defined separately for convenience as it is + * used frequently. Note that if the end_time is in the future, it will be + * clamped to the time the request was received. + * @param {number[]} request.criteria + * Criteria applied to search results. + * @param {number[]} request.facetSelections + * Stores most recent facet selection state. Only facet groups with user's + * selection will be presented here. Selection state is either selected or + * unselected. Only selected facet buckets will be used as search criteria. + * @param {string[]} request.resultAnnotationKeys + * A list of annotation keys to specify the annotations to be retrieved and + * returned with each search result. + * Annotation granularity must be GRANULARITY_ASSET_LEVEL and its search + * strategy must not be NO_SEARCH. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.visionai.v1alpha1.SearchResultItem|SearchResultItem}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha1/warehouse.search_assets.js + * region_tag:visionai_v1alpha1_generated_Warehouse_SearchAssets_async + */ + searchAssetsAsync( + request?: protos.google.cloud.visionai.v1alpha1.ISearchAssetsRequest, + options?: CallOptions, + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + corpus: request.corpus ?? '', + }); + const defaultCallSettings = this._defaults['searchAssets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('searchAssets iterate %j', request); + return this.descriptors.page.searchAssets.asyncIterate( + this.innerApiCalls['searchAssets'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + /** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + ): Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.getIamPolicy(request, options, callback); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + ): Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.setIamPolicy(request, options, callback); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + ): Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { + return this.iamClient.testIamPermissions(request, options, callback); + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + /** + * Lists information about the supported locations for this service. Returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions, + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions, + ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.cancelOperation(request, options, callback); + } + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified analysis resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @param {string} analysis + * @returns {string} Resource name string. + */ + analysisPath( + project: string, + location: string, + cluster: string, + analysis: string, + ) { + return this.pathTemplates.analysisPathTemplate.render({ + project: project, + location: location, + cluster: cluster, + analysis: analysis, + }); + } + + /** + * Parse the project from Analysis resource. + * + * @param {string} analysisName + * A fully-qualified path representing Analysis resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnalysisName(analysisName: string) { + return this.pathTemplates.analysisPathTemplate.match(analysisName).project; + } + + /** + * Parse the location from Analysis resource. + * + * @param {string} analysisName + * A fully-qualified path representing Analysis resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnalysisName(analysisName: string) { + return this.pathTemplates.analysisPathTemplate.match(analysisName).location; + } + + /** + * Parse the cluster from Analysis resource. + * + * @param {string} analysisName + * A fully-qualified path representing Analysis resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromAnalysisName(analysisName: string) { + return this.pathTemplates.analysisPathTemplate.match(analysisName).cluster; + } + + /** + * Parse the analysis from Analysis resource. + * + * @param {string} analysisName + * A fully-qualified path representing Analysis resource. + * @returns {string} A string representing the analysis. + */ + matchAnalysisFromAnalysisName(analysisName: string) { + return this.pathTemplates.analysisPathTemplate.match(analysisName).analysis; + } + + /** + * Return a fully-qualified annotation resource name string. + * + * @param {string} project_number + * @param {string} location + * @param {string} corpus + * @param {string} asset + * @param {string} annotation + * @returns {string} Resource name string. + */ + annotationPath( + projectNumber: string, + location: string, + corpus: string, + asset: string, + annotation: string, + ) { + return this.pathTemplates.annotationPathTemplate.render({ + project_number: projectNumber, + location: location, + corpus: corpus, + asset: asset, + annotation: annotation, + }); + } + + /** + * Parse the project_number from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the project_number. + */ + matchProjectNumberFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .project_number; + } + + /** + * Parse the location from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .location; + } + + /** + * Parse the corpus from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the corpus. + */ + matchCorpusFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .corpus; + } + + /** + * Parse the asset from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the asset. + */ + matchAssetFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .asset; + } + + /** + * Parse the annotation from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the annotation. + */ + matchAnnotationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .annotation; + } + + /** + * Return a fully-qualified application resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} application + * @returns {string} Resource name string. + */ + applicationPath(project: string, location: string, application: string) { + return this.pathTemplates.applicationPathTemplate.render({ + project: project, + location: location, + application: application, + }); + } + + /** + * Parse the project from Application resource. + * + * @param {string} applicationName + * A fully-qualified path representing Application resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApplicationName(applicationName: string) { + return this.pathTemplates.applicationPathTemplate.match(applicationName) + .project; + } + + /** + * Parse the location from Application resource. + * + * @param {string} applicationName + * A fully-qualified path representing Application resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApplicationName(applicationName: string) { + return this.pathTemplates.applicationPathTemplate.match(applicationName) + .location; + } + + /** + * Parse the application from Application resource. + * + * @param {string} applicationName + * A fully-qualified path representing Application resource. + * @returns {string} A string representing the application. + */ + matchApplicationFromApplicationName(applicationName: string) { + return this.pathTemplates.applicationPathTemplate.match(applicationName) + .application; + } + + /** + * Return a fully-qualified asset resource name string. + * + * @param {string} project_number + * @param {string} location + * @param {string} corpus + * @param {string} asset + * @returns {string} Resource name string. + */ + assetPath( + projectNumber: string, + location: string, + corpus: string, + asset: string, + ) { + return this.pathTemplates.assetPathTemplate.render({ + project_number: projectNumber, + location: location, + corpus: corpus, + asset: asset, + }); + } + + /** + * Parse the project_number from Asset resource. + * + * @param {string} assetName + * A fully-qualified path representing Asset resource. + * @returns {string} A string representing the project_number. + */ + matchProjectNumberFromAssetName(assetName: string) { + return this.pathTemplates.assetPathTemplate.match(assetName).project_number; + } + + /** + * Parse the location from Asset resource. + * + * @param {string} assetName + * A fully-qualified path representing Asset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAssetName(assetName: string) { + return this.pathTemplates.assetPathTemplate.match(assetName).location; + } + + /** + * Parse the corpus from Asset resource. + * + * @param {string} assetName + * A fully-qualified path representing Asset resource. + * @returns {string} A string representing the corpus. + */ + matchCorpusFromAssetName(assetName: string) { + return this.pathTemplates.assetPathTemplate.match(assetName).corpus; + } + + /** + * Parse the asset from Asset resource. + * + * @param {string} assetName + * A fully-qualified path representing Asset resource. + * @returns {string} A string representing the asset. + */ + matchAssetFromAssetName(assetName: string) { + return this.pathTemplates.assetPathTemplate.match(assetName).asset; + } + + /** + * Return a fully-qualified channel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @param {string} channel + * @returns {string} Resource name string. + */ + channelPath( + project: string, + location: string, + cluster: string, + channel: string, + ) { + return this.pathTemplates.channelPathTemplate.render({ + project: project, + location: location, + cluster: cluster, + channel: channel, + }); + } + + /** + * Parse the project from Channel resource. + * + * @param {string} channelName + * A fully-qualified path representing Channel resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChannelName(channelName: string) { + return this.pathTemplates.channelPathTemplate.match(channelName).project; + } + + /** + * Parse the location from Channel resource. + * + * @param {string} channelName + * A fully-qualified path representing Channel resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChannelName(channelName: string) { + return this.pathTemplates.channelPathTemplate.match(channelName).location; + } + + /** + * Parse the cluster from Channel resource. + * + * @param {string} channelName + * A fully-qualified path representing Channel resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromChannelName(channelName: string) { + return this.pathTemplates.channelPathTemplate.match(channelName).cluster; + } + + /** + * Parse the channel from Channel resource. + * + * @param {string} channelName + * A fully-qualified path representing Channel resource. + * @returns {string} A string representing the channel. + */ + matchChannelFromChannelName(channelName: string) { + return this.pathTemplates.channelPathTemplate.match(channelName).channel; + } + + /** + * Return a fully-qualified cluster resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @returns {string} Resource name string. + */ + clusterPath(project: string, location: string, cluster: string) { + return this.pathTemplates.clusterPathTemplate.render({ + project: project, + location: location, + cluster: cluster, + }); + } + + /** + * Parse the project from Cluster resource. + * + * @param {string} clusterName + * A fully-qualified path representing Cluster resource. + * @returns {string} A string representing the project. + */ + matchProjectFromClusterName(clusterName: string) { + return this.pathTemplates.clusterPathTemplate.match(clusterName).project; + } + + /** + * Parse the location from Cluster resource. + * + * @param {string} clusterName + * A fully-qualified path representing Cluster resource. + * @returns {string} A string representing the location. + */ + matchLocationFromClusterName(clusterName: string) { + return this.pathTemplates.clusterPathTemplate.match(clusterName).location; + } + + /** + * Parse the cluster from Cluster resource. + * + * @param {string} clusterName + * A fully-qualified path representing Cluster resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromClusterName(clusterName: string) { + return this.pathTemplates.clusterPathTemplate.match(clusterName).cluster; + } + + /** + * Return a fully-qualified corpus resource name string. + * + * @param {string} project_number + * @param {string} location + * @param {string} corpus + * @returns {string} Resource name string. + */ + corpusPath(projectNumber: string, location: string, corpus: string) { + return this.pathTemplates.corpusPathTemplate.render({ + project_number: projectNumber, + location: location, + corpus: corpus, + }); + } + + /** + * Parse the project_number from Corpus resource. + * + * @param {string} corpusName + * A fully-qualified path representing Corpus resource. + * @returns {string} A string representing the project_number. + */ + matchProjectNumberFromCorpusName(corpusName: string) { + return this.pathTemplates.corpusPathTemplate.match(corpusName) + .project_number; + } + + /** + * Parse the location from Corpus resource. + * + * @param {string} corpusName + * A fully-qualified path representing Corpus resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCorpusName(corpusName: string) { + return this.pathTemplates.corpusPathTemplate.match(corpusName).location; + } + + /** + * Parse the corpus from Corpus resource. + * + * @param {string} corpusName + * A fully-qualified path representing Corpus resource. + * @returns {string} A string representing the corpus. + */ + matchCorpusFromCorpusName(corpusName: string) { + return this.pathTemplates.corpusPathTemplate.match(corpusName).corpus; + } + + /** + * Return a fully-qualified dataSchema resource name string. + * + * @param {string} project_number + * @param {string} location + * @param {string} corpus + * @param {string} data_schema + * @returns {string} Resource name string. + */ + dataSchemaPath( + projectNumber: string, + location: string, + corpus: string, + dataSchema: string, + ) { + return this.pathTemplates.dataSchemaPathTemplate.render({ + project_number: projectNumber, + location: location, + corpus: corpus, + data_schema: dataSchema, + }); + } + + /** + * Parse the project_number from DataSchema resource. + * + * @param {string} dataSchemaName + * A fully-qualified path representing DataSchema resource. + * @returns {string} A string representing the project_number. + */ + matchProjectNumberFromDataSchemaName(dataSchemaName: string) { + return this.pathTemplates.dataSchemaPathTemplate.match(dataSchemaName) + .project_number; + } + + /** + * Parse the location from DataSchema resource. + * + * @param {string} dataSchemaName + * A fully-qualified path representing DataSchema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataSchemaName(dataSchemaName: string) { + return this.pathTemplates.dataSchemaPathTemplate.match(dataSchemaName) + .location; + } + + /** + * Parse the corpus from DataSchema resource. + * + * @param {string} dataSchemaName + * A fully-qualified path representing DataSchema resource. + * @returns {string} A string representing the corpus. + */ + matchCorpusFromDataSchemaName(dataSchemaName: string) { + return this.pathTemplates.dataSchemaPathTemplate.match(dataSchemaName) + .corpus; + } + + /** + * Parse the data_schema from DataSchema resource. + * + * @param {string} dataSchemaName + * A fully-qualified path representing DataSchema resource. + * @returns {string} A string representing the data_schema. + */ + matchDataSchemaFromDataSchemaName(dataSchemaName: string) { + return this.pathTemplates.dataSchemaPathTemplate.match(dataSchemaName) + .data_schema; + } + + /** + * Return a fully-qualified draft resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} application + * @param {string} draft + * @returns {string} Resource name string. + */ + draftPath( + project: string, + location: string, + application: string, + draft: string, + ) { + return this.pathTemplates.draftPathTemplate.render({ + project: project, + location: location, + application: application, + draft: draft, + }); + } + + /** + * Parse the project from Draft resource. + * + * @param {string} draftName + * A fully-qualified path representing Draft resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDraftName(draftName: string) { + return this.pathTemplates.draftPathTemplate.match(draftName).project; + } + + /** + * Parse the location from Draft resource. + * + * @param {string} draftName + * A fully-qualified path representing Draft resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDraftName(draftName: string) { + return this.pathTemplates.draftPathTemplate.match(draftName).location; + } + + /** + * Parse the application from Draft resource. + * + * @param {string} draftName + * A fully-qualified path representing Draft resource. + * @returns {string} A string representing the application. + */ + matchApplicationFromDraftName(draftName: string) { + return this.pathTemplates.draftPathTemplate.match(draftName).application; + } + + /** + * Parse the draft from Draft resource. + * + * @param {string} draftName + * A fully-qualified path representing Draft resource. + * @returns {string} A string representing the draft. + */ + matchDraftFromDraftName(draftName: string) { + return this.pathTemplates.draftPathTemplate.match(draftName).draft; + } + + /** + * Return a fully-qualified event resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @param {string} event + * @returns {string} Resource name string. + */ + eventPath(project: string, location: string, cluster: string, event: string) { + return this.pathTemplates.eventPathTemplate.render({ + project: project, + location: location, + cluster: cluster, + event: event, + }); + } + + /** + * Parse the project from Event resource. + * + * @param {string} eventName + * A fully-qualified path representing Event resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEventName(eventName: string) { + return this.pathTemplates.eventPathTemplate.match(eventName).project; + } + + /** + * Parse the location from Event resource. + * + * @param {string} eventName + * A fully-qualified path representing Event resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEventName(eventName: string) { + return this.pathTemplates.eventPathTemplate.match(eventName).location; + } + + /** + * Parse the cluster from Event resource. + * + * @param {string} eventName + * A fully-qualified path representing Event resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromEventName(eventName: string) { + return this.pathTemplates.eventPathTemplate.match(eventName).cluster; + } + + /** + * Parse the event from Event resource. + * + * @param {string} eventName + * A fully-qualified path representing Event resource. + * @returns {string} A string representing the event. + */ + matchEventFromEventName(eventName: string) { + return this.pathTemplates.eventPathTemplate.match(eventName).event; + } + + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} application + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath( + project: string, + location: string, + application: string, + instance: string, + ) { + return this.pathTemplates.instancePathTemplate.render({ + project: project, + location: location, + application: application, + instance: instance, + }); + } + + /** + * Parse the project from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).project; + } + + /** + * Parse the location from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).location; + } + + /** + * Parse the application from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the application. + */ + matchApplicationFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName) + .application; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + + /** + * Return a fully-qualified processor resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} processor + * @returns {string} Resource name string. + */ + processorPath(project: string, location: string, processor: string) { + return this.pathTemplates.processorPathTemplate.render({ + project: project, + location: location, + processor: processor, + }); + } + + /** + * Parse the project from Processor resource. + * + * @param {string} processorName + * A fully-qualified path representing Processor resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProcessorName(processorName: string) { + return this.pathTemplates.processorPathTemplate.match(processorName) + .project; + } + + /** + * Parse the location from Processor resource. + * + * @param {string} processorName + * A fully-qualified path representing Processor resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProcessorName(processorName: string) { + return this.pathTemplates.processorPathTemplate.match(processorName) + .location; + } + + /** + * Parse the processor from Processor resource. + * + * @param {string} processorName + * A fully-qualified path representing Processor resource. + * @returns {string} A string representing the processor. + */ + matchProcessorFromProcessorName(processorName: string) { + return this.pathTemplates.processorPathTemplate.match(processorName) + .processor; + } + + /** + * Return a fully-qualified searchConfig resource name string. + * + * @param {string} project_number + * @param {string} location + * @param {string} corpus + * @param {string} search_config + * @returns {string} Resource name string. + */ + searchConfigPath( + projectNumber: string, + location: string, + corpus: string, + searchConfig: string, + ) { + return this.pathTemplates.searchConfigPathTemplate.render({ + project_number: projectNumber, + location: location, + corpus: corpus, + search_config: searchConfig, + }); + } + + /** + * Parse the project_number from SearchConfig resource. + * + * @param {string} searchConfigName + * A fully-qualified path representing SearchConfig resource. + * @returns {string} A string representing the project_number. + */ + matchProjectNumberFromSearchConfigName(searchConfigName: string) { + return this.pathTemplates.searchConfigPathTemplate.match(searchConfigName) + .project_number; + } + + /** + * Parse the location from SearchConfig resource. + * + * @param {string} searchConfigName + * A fully-qualified path representing SearchConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSearchConfigName(searchConfigName: string) { + return this.pathTemplates.searchConfigPathTemplate.match(searchConfigName) + .location; + } + + /** + * Parse the corpus from SearchConfig resource. + * + * @param {string} searchConfigName + * A fully-qualified path representing SearchConfig resource. + * @returns {string} A string representing the corpus. + */ + matchCorpusFromSearchConfigName(searchConfigName: string) { + return this.pathTemplates.searchConfigPathTemplate.match(searchConfigName) + .corpus; + } + + /** + * Parse the search_config from SearchConfig resource. + * + * @param {string} searchConfigName + * A fully-qualified path representing SearchConfig resource. + * @returns {string} A string representing the search_config. + */ + matchSearchConfigFromSearchConfigName(searchConfigName: string) { + return this.pathTemplates.searchConfigPathTemplate.match(searchConfigName) + .search_config; + } + + /** + * Return a fully-qualified series resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @param {string} series + * @returns {string} Resource name string. + */ + seriesPath( + project: string, + location: string, + cluster: string, + series: string, + ) { + return this.pathTemplates.seriesPathTemplate.render({ + project: project, + location: location, + cluster: cluster, + series: series, + }); + } + + /** + * Parse the project from Series resource. + * + * @param {string} seriesName + * A fully-qualified path representing Series resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSeriesName(seriesName: string) { + return this.pathTemplates.seriesPathTemplate.match(seriesName).project; + } + + /** + * Parse the location from Series resource. + * + * @param {string} seriesName + * A fully-qualified path representing Series resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSeriesName(seriesName: string) { + return this.pathTemplates.seriesPathTemplate.match(seriesName).location; + } + + /** + * Parse the cluster from Series resource. + * + * @param {string} seriesName + * A fully-qualified path representing Series resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromSeriesName(seriesName: string) { + return this.pathTemplates.seriesPathTemplate.match(seriesName).cluster; + } + + /** + * Parse the series from Series resource. + * + * @param {string} seriesName + * A fully-qualified path representing Series resource. + * @returns {string} A string representing the series. + */ + matchSeriesFromSeriesName(seriesName: string) { + return this.pathTemplates.seriesPathTemplate.match(seriesName).series; + } + + /** + * Return a fully-qualified stream resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @param {string} stream + * @returns {string} Resource name string. + */ + streamPath( + project: string, + location: string, + cluster: string, + stream: string, + ) { + return this.pathTemplates.streamPathTemplate.render({ + project: project, + location: location, + cluster: cluster, + stream: stream, + }); + } + + /** + * Parse the project from Stream resource. + * + * @param {string} streamName + * A fully-qualified path representing Stream resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStreamName(streamName: string) { + return this.pathTemplates.streamPathTemplate.match(streamName).project; + } + + /** + * Parse the location from Stream resource. + * + * @param {string} streamName + * A fully-qualified path representing Stream resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStreamName(streamName: string) { + return this.pathTemplates.streamPathTemplate.match(streamName).location; + } + + /** + * Parse the cluster from Stream resource. + * + * @param {string} streamName + * A fully-qualified path representing Stream resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromStreamName(streamName: string) { + return this.pathTemplates.streamPathTemplate.match(streamName).cluster; + } + + /** + * Parse the stream from Stream resource. + * + * @param {string} streamName + * A fully-qualified path representing Stream resource. + * @returns {string} A string representing the stream. + */ + matchStreamFromStreamName(streamName: string) { + return this.pathTemplates.streamPathTemplate.match(streamName).stream; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.warehouseStub && !this._terminated) { + return this.warehouseStub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.iamClient.close().catch((err) => { + throw err; + }); + this.locationsClient.close().catch((err) => { + throw err; + }); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-visionai/src/v1alpha1/warehouse_client_config.json b/packages/google-cloud-visionai/src/v1alpha1/warehouse_client_config.json new file mode 100644 index 000000000000..50a5295ff83e --- /dev/null +++ b/packages/google-cloud-visionai/src/v1alpha1/warehouse_client_config.json @@ -0,0 +1,156 @@ +{ + "interfaces": { + "google.cloud.visionai.v1alpha1.Warehouse": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "44183339c3ec233f7d8e740ee644b7ceb1a77fc3": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 2.5, + "max_retry_delay_millis": 120000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateAsset": { + "timeout_millis": 120000, + "retry_codes_name": "idempotent", + "retry_params_name": "44183339c3ec233f7d8e740ee644b7ceb1a77fc3" + }, + "UpdateAsset": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetAsset": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListAssets": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteAsset": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateCorpus": { + "timeout_millis": 120000, + "retry_codes_name": "idempotent", + "retry_params_name": "44183339c3ec233f7d8e740ee644b7ceb1a77fc3" + }, + "GetCorpus": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateCorpus": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListCorpora": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteCorpus": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateDataSchema": { + "timeout_millis": 120000, + "retry_codes_name": "idempotent", + "retry_params_name": "44183339c3ec233f7d8e740ee644b7ceb1a77fc3" + }, + "UpdateDataSchema": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetDataSchema": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteDataSchema": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListDataSchemas": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateAnnotation": { + "timeout_millis": 120000, + "retry_codes_name": "idempotent", + "retry_params_name": "44183339c3ec233f7d8e740ee644b7ceb1a77fc3" + }, + "GetAnnotation": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListAnnotations": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateAnnotation": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteAnnotation": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "IngestAsset": { + "timeout_millis": 120000, + "retry_codes_name": "idempotent", + "retry_params_name": "44183339c3ec233f7d8e740ee644b7ceb1a77fc3" + }, + "ClipAsset": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GenerateHlsUri": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateSearchConfig": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateSearchConfig": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetSearchConfig": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteSearchConfig": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListSearchConfigs": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SearchAssets": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-visionai/src/v1alpha1/warehouse_proto_list.json b/packages/google-cloud-visionai/src/v1alpha1/warehouse_proto_list.json new file mode 100644 index 000000000000..437d97a901a4 --- /dev/null +++ b/packages/google-cloud-visionai/src/v1alpha1/warehouse_proto_list.json @@ -0,0 +1,13 @@ +[ + "../../protos/google/cloud/visionai/v1alpha1/annotations.proto", + "../../protos/google/cloud/visionai/v1alpha1/common.proto", + "../../protos/google/cloud/visionai/v1alpha1/lva.proto", + "../../protos/google/cloud/visionai/v1alpha1/lva_resources.proto", + "../../protos/google/cloud/visionai/v1alpha1/lva_service.proto", + "../../protos/google/cloud/visionai/v1alpha1/platform.proto", + "../../protos/google/cloud/visionai/v1alpha1/streaming_resources.proto", + "../../protos/google/cloud/visionai/v1alpha1/streaming_service.proto", + "../../protos/google/cloud/visionai/v1alpha1/streams_resources.proto", + "../../protos/google/cloud/visionai/v1alpha1/streams_service.proto", + "../../protos/google/cloud/visionai/v1alpha1/warehouse.proto" +] diff --git a/packages/google-cloud-visionai/test/gapic_app_platform_v1alpha1.ts b/packages/google-cloud-visionai/test/gapic_app_platform_v1alpha1.ts new file mode 100644 index 000000000000..e6621d80c3e9 --- /dev/null +++ b/packages/google-cloud-visionai/test/gapic_app_platform_v1alpha1.ts @@ -0,0 +1,7696 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import { SinonStub } from 'sinon'; +import { describe, it } from 'mocha'; +import * as appplatformModule from '../src'; + +import { PassThrough } from 'stream'; + +import { + protobuf, + LROperation, + operationsProtos, + IamProtos, + LocationProtos, +} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json'), +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, { defaults: true }); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject, + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error, +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error, +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error, +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error, +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error, +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({ done: true, value: undefined }); + } + return Promise.resolve({ done: false, value: responses![counter++] }); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1alpha1.AppPlatformClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'visionai.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = + appplatformModule.v1alpha1.AppPlatformClient.servicePath; + assert.strictEqual(servicePath, 'visionai.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + appplatformModule.v1alpha1.AppPlatformClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'visionai.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'visionai.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'visionai.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new appplatformModule.v1alpha1.AppPlatformClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'visionai.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'visionai.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new appplatformModule.v1alpha1.AppPlatformClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = appplatformModule.v1alpha1.AppPlatformClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.appPlatformStub, undefined); + await client.initialize(); + assert(client.appPlatformStub); + }); + + it('has close method for the initialized client', (done) => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.initialize().catch((err) => { + throw err; + }); + assert(client.appPlatformStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has close method for the non-initialized client', (done) => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.appPlatformStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('getApplication', () => { + it('invokes getApplication without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GetApplicationRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GetApplicationRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Application(), + ); + client.innerApiCalls.getApplication = stubSimpleCall(expectedResponse); + const [response] = await client.getApplication(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getApplication as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getApplication as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApplication without error using callback', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GetApplicationRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GetApplicationRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Application(), + ); + client.innerApiCalls.getApplication = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getApplication( + request, + ( + err?: Error | null, + result?: protos.google.cloud.visionai.v1alpha1.IApplication | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getApplication as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getApplication as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApplication with error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GetApplicationRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GetApplicationRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getApplication = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getApplication(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getApplication as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getApplication as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApplication with closed client', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GetApplicationRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GetApplicationRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getApplication(request), expectedError); + }); + }); + + describe('getInstance', () => { + it('invokes getInstance without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GetInstanceRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GetInstanceRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Instance(), + ); + client.innerApiCalls.getInstance = stubSimpleCall(expectedResponse); + const [response] = await client.getInstance(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInstance without error using callback', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GetInstanceRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GetInstanceRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Instance(), + ); + client.innerApiCalls.getInstance = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getInstance( + request, + ( + err?: Error | null, + result?: protos.google.cloud.visionai.v1alpha1.IInstance | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInstance with error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GetInstanceRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GetInstanceRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getInstance = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getInstance(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInstance with closed client', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GetInstanceRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GetInstanceRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getInstance(request), expectedError); + }); + }); + + describe('getDraft', () => { + it('invokes getDraft without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GetDraftRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GetDraftRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Draft(), + ); + client.innerApiCalls.getDraft = stubSimpleCall(expectedResponse); + const [response] = await client.getDraft(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getDraft as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDraft as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDraft without error using callback', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GetDraftRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GetDraftRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Draft(), + ); + client.innerApiCalls.getDraft = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDraft( + request, + ( + err?: Error | null, + result?: protos.google.cloud.visionai.v1alpha1.IDraft | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getDraft as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDraft as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDraft with error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GetDraftRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GetDraftRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getDraft = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getDraft(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getDraft as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDraft as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDraft with closed client', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GetDraftRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GetDraftRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getDraft(request), expectedError); + }); + }); + + describe('listPrebuiltProcessors', () => { + it('invokes listPrebuiltProcessors without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsResponse(), + ); + client.innerApiCalls.listPrebuiltProcessors = + stubSimpleCall(expectedResponse); + const [response] = await client.listPrebuiltProcessors(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listPrebuiltProcessors as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPrebuiltProcessors as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPrebuiltProcessors without error using callback', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsResponse(), + ); + client.innerApiCalls.listPrebuiltProcessors = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listPrebuiltProcessors( + request, + ( + err?: Error | null, + result?: protos.google.cloud.visionai.v1alpha1.IListPrebuiltProcessorsResponse | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listPrebuiltProcessors as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPrebuiltProcessors as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPrebuiltProcessors with error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listPrebuiltProcessors = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.listPrebuiltProcessors(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.listPrebuiltProcessors as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPrebuiltProcessors as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPrebuiltProcessors with closed client', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListPrebuiltProcessorsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects( + client.listPrebuiltProcessors(request), + expectedError, + ); + }); + }); + + describe('getProcessor', () => { + it('invokes getProcessor without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GetProcessorRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GetProcessorRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Processor(), + ); + client.innerApiCalls.getProcessor = stubSimpleCall(expectedResponse); + const [response] = await client.getProcessor(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getProcessor as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getProcessor as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getProcessor without error using callback', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GetProcessorRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GetProcessorRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Processor(), + ); + client.innerApiCalls.getProcessor = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getProcessor( + request, + ( + err?: Error | null, + result?: protos.google.cloud.visionai.v1alpha1.IProcessor | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getProcessor as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getProcessor as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getProcessor with error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GetProcessorRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GetProcessorRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getProcessor = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getProcessor(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getProcessor as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getProcessor as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getProcessor with closed client', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GetProcessorRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GetProcessorRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getProcessor(request), expectedError); + }); + }); + + describe('createApplication', () => { + it('invokes createApplication without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.CreateApplicationRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.CreateApplicationRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createApplication = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createApplication(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createApplication as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createApplication as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createApplication without error using callback', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.CreateApplicationRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.CreateApplicationRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createApplication = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createApplication( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.visionai.v1alpha1.IApplication, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.visionai.v1alpha1.IApplication, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createApplication as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createApplication as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createApplication with call error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.CreateApplicationRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.CreateApplicationRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createApplication = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.createApplication(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createApplication as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createApplication as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createApplication with LRO error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.CreateApplicationRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.CreateApplicationRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createApplication = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.createApplication(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createApplication as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createApplication as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateApplicationProgress without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateApplicationProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateApplicationProgress with error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkCreateApplicationProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateApplication', () => { + it('invokes updateApplication without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateApplicationRequest(), + ); + request.application ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateApplicationRequest', + ['application', 'name'], + ); + request.application.name = defaultValue1; + const expectedHeaderRequestParams = `application.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.updateApplication = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateApplication(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateApplication as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateApplication as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateApplication without error using callback', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateApplicationRequest(), + ); + request.application ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateApplicationRequest', + ['application', 'name'], + ); + request.application.name = defaultValue1; + const expectedHeaderRequestParams = `application.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.updateApplication = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateApplication( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.visionai.v1alpha1.IApplication, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.visionai.v1alpha1.IApplication, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateApplication as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateApplication as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateApplication with call error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateApplicationRequest(), + ); + request.application ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateApplicationRequest', + ['application', 'name'], + ); + request.application.name = defaultValue1; + const expectedHeaderRequestParams = `application.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateApplication = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateApplication(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateApplication as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateApplication as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateApplication with LRO error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateApplicationRequest(), + ); + request.application ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateApplicationRequest', + ['application', 'name'], + ); + request.application.name = defaultValue1; + const expectedHeaderRequestParams = `application.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateApplication = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.updateApplication(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateApplication as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateApplication as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateApplicationProgress without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateApplicationProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateApplicationProgress with error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkUpdateApplicationProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteApplication', () => { + it('invokes deleteApplication without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeleteApplicationRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeleteApplicationRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.deleteApplication = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteApplication(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteApplication as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteApplication as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteApplication without error using callback', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeleteApplicationRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeleteApplicationRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.deleteApplication = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteApplication( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteApplication as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteApplication as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteApplication with call error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeleteApplicationRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeleteApplicationRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteApplication = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteApplication(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteApplication as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteApplication as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteApplication with LRO error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeleteApplicationRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeleteApplicationRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteApplication = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.deleteApplication(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteApplication as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteApplication as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteApplicationProgress without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteApplicationProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteApplicationProgress with error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkDeleteApplicationProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deployApplication', () => { + it('invokes deployApplication without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeployApplicationRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeployApplicationRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.deployApplication = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deployApplication(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deployApplication as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deployApplication as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deployApplication without error using callback', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeployApplicationRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeployApplicationRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.deployApplication = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deployApplication( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.visionai.v1alpha1.IDeployApplicationResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.visionai.v1alpha1.IDeployApplicationResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deployApplication as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deployApplication as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deployApplication with call error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeployApplicationRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeployApplicationRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deployApplication = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.deployApplication(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deployApplication as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deployApplication as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deployApplication with LRO error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeployApplicationRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeployApplicationRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deployApplication = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.deployApplication(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deployApplication as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deployApplication as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeployApplicationProgress without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeployApplicationProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeployApplicationProgress with error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkDeployApplicationProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('undeployApplication', () => { + it('invokes undeployApplication without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UndeployApplicationRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UndeployApplicationRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.undeployApplication = + stubLongRunningCall(expectedResponse); + const [operation] = await client.undeployApplication(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.undeployApplication as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeployApplication as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeployApplication without error using callback', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UndeployApplicationRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UndeployApplicationRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.undeployApplication = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.undeployApplication( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.visionai.v1alpha1.IUndeployApplicationResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.visionai.v1alpha1.IUndeployApplicationResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.undeployApplication as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeployApplication as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeployApplication with call error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UndeployApplicationRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UndeployApplicationRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.undeployApplication = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.undeployApplication(request), expectedError); + const actualRequest = ( + client.innerApiCalls.undeployApplication as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeployApplication as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeployApplication with LRO error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UndeployApplicationRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UndeployApplicationRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.undeployApplication = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.undeployApplication(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.undeployApplication as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeployApplication as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUndeployApplicationProgress without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUndeployApplicationProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUndeployApplicationProgress with error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkUndeployApplicationProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('addApplicationStreamInput', () => { + it('invokes addApplicationStreamInput without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.AddApplicationStreamInputRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.AddApplicationStreamInputRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.addApplicationStreamInput = + stubLongRunningCall(expectedResponse); + const [operation] = await client.addApplicationStreamInput(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.addApplicationStreamInput as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.addApplicationStreamInput as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes addApplicationStreamInput without error using callback', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.AddApplicationStreamInputRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.AddApplicationStreamInputRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.addApplicationStreamInput = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.addApplicationStreamInput( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.visionai.v1alpha1.IAddApplicationStreamInputResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.visionai.v1alpha1.IAddApplicationStreamInputResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.addApplicationStreamInput as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.addApplicationStreamInput as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes addApplicationStreamInput with call error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.AddApplicationStreamInputRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.AddApplicationStreamInputRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.addApplicationStreamInput = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects( + client.addApplicationStreamInput(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.addApplicationStreamInput as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.addApplicationStreamInput as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes addApplicationStreamInput with LRO error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.AddApplicationStreamInputRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.AddApplicationStreamInputRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.addApplicationStreamInput = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.addApplicationStreamInput(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.addApplicationStreamInput as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.addApplicationStreamInput as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkAddApplicationStreamInputProgress without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = + await client.checkAddApplicationStreamInputProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkAddApplicationStreamInputProgress with error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkAddApplicationStreamInputProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('removeApplicationStreamInput', () => { + it('invokes removeApplicationStreamInput without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.removeApplicationStreamInput = + stubLongRunningCall(expectedResponse); + const [operation] = await client.removeApplicationStreamInput(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.removeApplicationStreamInput as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.removeApplicationStreamInput as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes removeApplicationStreamInput without error using callback', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.removeApplicationStreamInput = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.removeApplicationStreamInput( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.visionai.v1alpha1.IRemoveApplicationStreamInputResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.visionai.v1alpha1.IRemoveApplicationStreamInputResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.removeApplicationStreamInput as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.removeApplicationStreamInput as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes removeApplicationStreamInput with call error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.removeApplicationStreamInput = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects( + client.removeApplicationStreamInput(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.removeApplicationStreamInput as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.removeApplicationStreamInput as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes removeApplicationStreamInput with LRO error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.RemoveApplicationStreamInputRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.removeApplicationStreamInput = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.removeApplicationStreamInput(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.removeApplicationStreamInput as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.removeApplicationStreamInput as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkRemoveApplicationStreamInputProgress without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = + await client.checkRemoveApplicationStreamInputProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRemoveApplicationStreamInputProgress with error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkRemoveApplicationStreamInputProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateApplicationStreamInput', () => { + it('invokes updateApplicationStreamInput without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.updateApplicationStreamInput = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateApplicationStreamInput(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateApplicationStreamInput as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateApplicationStreamInput as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateApplicationStreamInput without error using callback', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.updateApplicationStreamInput = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateApplicationStreamInput( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.visionai.v1alpha1.IUpdateApplicationStreamInputResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.visionai.v1alpha1.IUpdateApplicationStreamInputResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateApplicationStreamInput as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateApplicationStreamInput as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateApplicationStreamInput with call error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateApplicationStreamInput = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects( + client.updateApplicationStreamInput(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.updateApplicationStreamInput as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateApplicationStreamInput as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateApplicationStreamInput with LRO error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateApplicationStreamInputRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateApplicationStreamInput = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.updateApplicationStreamInput(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateApplicationStreamInput as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateApplicationStreamInput as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateApplicationStreamInputProgress without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = + await client.checkUpdateApplicationStreamInputProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateApplicationStreamInputProgress with error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkUpdateApplicationStreamInputProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createApplicationInstances', () => { + it('invokes createApplicationInstances without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.CreateApplicationInstancesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.CreateApplicationInstancesRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createApplicationInstances = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createApplicationInstances(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createApplicationInstances as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createApplicationInstances as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createApplicationInstances without error using callback', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.CreateApplicationInstancesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.CreateApplicationInstancesRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createApplicationInstances = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createApplicationInstances( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.visionai.v1alpha1.ICreateApplicationInstancesResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.visionai.v1alpha1.ICreateApplicationInstancesResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createApplicationInstances as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createApplicationInstances as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createApplicationInstances with call error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.CreateApplicationInstancesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.CreateApplicationInstancesRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createApplicationInstances = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects( + client.createApplicationInstances(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.createApplicationInstances as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createApplicationInstances as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createApplicationInstances with LRO error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.CreateApplicationInstancesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.CreateApplicationInstancesRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createApplicationInstances = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.createApplicationInstances(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createApplicationInstances as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createApplicationInstances as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateApplicationInstancesProgress without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = + await client.checkCreateApplicationInstancesProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateApplicationInstancesProgress with error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkCreateApplicationInstancesProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteApplicationInstances', () => { + it('invokes deleteApplicationInstances without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeleteApplicationInstancesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeleteApplicationInstancesRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.deleteApplicationInstances = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteApplicationInstances(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteApplicationInstances as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteApplicationInstances as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteApplicationInstances without error using callback', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeleteApplicationInstancesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeleteApplicationInstancesRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.deleteApplicationInstances = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteApplicationInstances( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.visionai.v1alpha1.IInstance, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.visionai.v1alpha1.IInstance, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteApplicationInstances as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteApplicationInstances as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteApplicationInstances with call error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeleteApplicationInstancesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeleteApplicationInstancesRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteApplicationInstances = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects( + client.deleteApplicationInstances(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.deleteApplicationInstances as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteApplicationInstances as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteApplicationInstances with LRO error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeleteApplicationInstancesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeleteApplicationInstancesRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteApplicationInstances = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.deleteApplicationInstances(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteApplicationInstances as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteApplicationInstances as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteApplicationInstancesProgress without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = + await client.checkDeleteApplicationInstancesProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteApplicationInstancesProgress with error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkDeleteApplicationInstancesProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateApplicationInstances', () => { + it('invokes updateApplicationInstances without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.updateApplicationInstances = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateApplicationInstances(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateApplicationInstances as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateApplicationInstances as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateApplicationInstances without error using callback', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.updateApplicationInstances = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateApplicationInstances( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.visionai.v1alpha1.IUpdateApplicationInstancesResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.visionai.v1alpha1.IUpdateApplicationInstancesResponse, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateApplicationInstances as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateApplicationInstances as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateApplicationInstances with call error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateApplicationInstances = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects( + client.updateApplicationInstances(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.updateApplicationInstances as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateApplicationInstances as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateApplicationInstances with LRO error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateApplicationInstancesRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateApplicationInstances = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.updateApplicationInstances(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateApplicationInstances as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateApplicationInstances as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateApplicationInstancesProgress without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = + await client.checkUpdateApplicationInstancesProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateApplicationInstancesProgress with error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkUpdateApplicationInstancesProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createDraft', () => { + it('invokes createDraft without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.CreateDraftRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.CreateDraftRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createDraft = stubLongRunningCall(expectedResponse); + const [operation] = await client.createDraft(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createDraft as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDraft as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDraft without error using callback', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.CreateDraftRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.CreateDraftRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createDraft = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createDraft( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.visionai.v1alpha1.IDraft, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.visionai.v1alpha1.IDraft, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createDraft as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDraft as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDraft with call error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.CreateDraftRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.CreateDraftRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createDraft = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.createDraft(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createDraft as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDraft as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDraft with LRO error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.CreateDraftRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.CreateDraftRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createDraft = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.createDraft(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createDraft as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDraft as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateDraftProgress without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateDraftProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateDraftProgress with error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.checkCreateDraftProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateDraft', () => { + it('invokes updateDraft without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateDraftRequest(), + ); + request.draft ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateDraftRequest', + ['draft', 'name'], + ); + request.draft.name = defaultValue1; + const expectedHeaderRequestParams = `draft.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.updateDraft = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateDraft(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateDraft as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDraft as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDraft without error using callback', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateDraftRequest(), + ); + request.draft ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateDraftRequest', + ['draft', 'name'], + ); + request.draft.name = defaultValue1; + const expectedHeaderRequestParams = `draft.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.updateDraft = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateDraft( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.visionai.v1alpha1.IDraft, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.visionai.v1alpha1.IDraft, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateDraft as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDraft as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDraft with call error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateDraftRequest(), + ); + request.draft ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateDraftRequest', + ['draft', 'name'], + ); + request.draft.name = defaultValue1; + const expectedHeaderRequestParams = `draft.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDraft = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateDraft(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateDraft as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDraft as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDraft with LRO error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateDraftRequest(), + ); + request.draft ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateDraftRequest', + ['draft', 'name'], + ); + request.draft.name = defaultValue1; + const expectedHeaderRequestParams = `draft.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDraft = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.updateDraft(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateDraft as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDraft as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateDraftProgress without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateDraftProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateDraftProgress with error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.checkUpdateDraftProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteDraft', () => { + it('invokes deleteDraft without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeleteDraftRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeleteDraftRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.deleteDraft = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteDraft(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteDraft as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDraft as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDraft without error using callback', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeleteDraftRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeleteDraftRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.deleteDraft = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteDraft( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteDraft as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDraft as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDraft with call error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeleteDraftRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeleteDraftRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDraft = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteDraft(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteDraft as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDraft as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDraft with LRO error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeleteDraftRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeleteDraftRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDraft = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.deleteDraft(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteDraft as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDraft as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteDraftProgress without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteDraftProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteDraftProgress with error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.checkDeleteDraftProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createProcessor', () => { + it('invokes createProcessor without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.CreateProcessorRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.CreateProcessorRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createProcessor = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createProcessor(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createProcessor as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createProcessor as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createProcessor without error using callback', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.CreateProcessorRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.CreateProcessorRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createProcessor = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createProcessor( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.visionai.v1alpha1.IProcessor, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.visionai.v1alpha1.IProcessor, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createProcessor as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createProcessor as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createProcessor with call error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.CreateProcessorRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.CreateProcessorRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createProcessor = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.createProcessor(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createProcessor as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createProcessor as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createProcessor with LRO error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.CreateProcessorRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.CreateProcessorRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createProcessor = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.createProcessor(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createProcessor as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createProcessor as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateProcessorProgress without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateProcessorProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateProcessorProgress with error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkCreateProcessorProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateProcessor', () => { + it('invokes updateProcessor without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateProcessorRequest(), + ); + request.processor ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateProcessorRequest', + ['processor', 'name'], + ); + request.processor.name = defaultValue1; + const expectedHeaderRequestParams = `processor.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.updateProcessor = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateProcessor(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateProcessor as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateProcessor as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateProcessor without error using callback', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateProcessorRequest(), + ); + request.processor ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateProcessorRequest', + ['processor', 'name'], + ); + request.processor.name = defaultValue1; + const expectedHeaderRequestParams = `processor.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.updateProcessor = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateProcessor( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.visionai.v1alpha1.IProcessor, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.visionai.v1alpha1.IProcessor, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateProcessor as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateProcessor as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateProcessor with call error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateProcessorRequest(), + ); + request.processor ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateProcessorRequest', + ['processor', 'name'], + ); + request.processor.name = defaultValue1; + const expectedHeaderRequestParams = `processor.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateProcessor = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateProcessor(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateProcessor as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateProcessor as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateProcessor with LRO error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateProcessorRequest(), + ); + request.processor ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateProcessorRequest', + ['processor', 'name'], + ); + request.processor.name = defaultValue1; + const expectedHeaderRequestParams = `processor.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateProcessor = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.updateProcessor(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateProcessor as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateProcessor as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateProcessorProgress without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateProcessorProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateProcessorProgress with error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkUpdateProcessorProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteProcessor', () => { + it('invokes deleteProcessor without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeleteProcessorRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeleteProcessorRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.deleteProcessor = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteProcessor(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteProcessor as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteProcessor as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteProcessor without error using callback', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeleteProcessorRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeleteProcessorRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.deleteProcessor = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteProcessor( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteProcessor as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteProcessor as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteProcessor with call error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeleteProcessorRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeleteProcessorRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteProcessor = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteProcessor(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteProcessor as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteProcessor as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteProcessor with LRO error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeleteProcessorRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeleteProcessorRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteProcessor = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.deleteProcessor(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteProcessor as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteProcessor as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteProcessorProgress without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteProcessorProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteProcessorProgress with error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkDeleteProcessorProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listApplications', () => { + it('invokes listApplications without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListApplicationsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListApplicationsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Application(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Application(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Application(), + ), + ]; + client.innerApiCalls.listApplications = stubSimpleCall(expectedResponse); + const [response] = await client.listApplications(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listApplications as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listApplications as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApplications without error using callback', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListApplicationsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListApplicationsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Application(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Application(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Application(), + ), + ]; + client.innerApiCalls.listApplications = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listApplications( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.visionai.v1alpha1.IApplication[] + | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listApplications as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listApplications as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApplications with error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListApplicationsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListApplicationsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listApplications = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listApplications(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listApplications as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listApplications as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApplicationsStream without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListApplicationsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListApplicationsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Application(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Application(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Application(), + ), + ]; + client.descriptors.page.listApplications.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listApplicationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.visionai.v1alpha1.Application[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.visionai.v1alpha1.Application) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listApplications.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listApplications, request), + ); + assert( + (client.descriptors.page.listApplications.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listApplicationsStream with error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListApplicationsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListApplicationsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listApplications.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listApplicationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.visionai.v1alpha1.Application[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.visionai.v1alpha1.Application) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listApplications.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listApplications, request), + ); + assert( + (client.descriptors.page.listApplications.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listApplications without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListApplicationsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListApplicationsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Application(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Application(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Application(), + ), + ]; + client.descriptors.page.listApplications.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.visionai.v1alpha1.IApplication[] = + []; + const iterable = client.listApplicationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listApplications.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listApplications.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listApplications with error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListApplicationsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListApplicationsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listApplications.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listApplicationsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.visionai.v1alpha1.IApplication[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listApplications.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listApplications.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + + describe('listInstances', () => { + it('invokes listInstances without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListInstancesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListInstancesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Instance(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Instance(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Instance(), + ), + ]; + client.innerApiCalls.listInstances = stubSimpleCall(expectedResponse); + const [response] = await client.listInstances(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listInstances as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listInstances as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInstances without error using callback', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListInstancesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListInstancesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Instance(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Instance(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Instance(), + ), + ]; + client.innerApiCalls.listInstances = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listInstances( + request, + ( + err?: Error | null, + result?: protos.google.cloud.visionai.v1alpha1.IInstance[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listInstances as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listInstances as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInstances with error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListInstancesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListInstancesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listInstances = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listInstances(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listInstances as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listInstances as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInstancesStream without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListInstancesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListInstancesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Instance(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Instance(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Instance(), + ), + ]; + client.descriptors.page.listInstances.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listInstancesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.visionai.v1alpha1.Instance[] = []; + stream.on( + 'data', + (response: protos.google.cloud.visionai.v1alpha1.Instance) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listInstances, request), + ); + assert( + (client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listInstancesStream with error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListInstancesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListInstancesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listInstances.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listInstancesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.visionai.v1alpha1.Instance[] = []; + stream.on( + 'data', + (response: protos.google.cloud.visionai.v1alpha1.Instance) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listInstances, request), + ); + assert( + (client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listInstances without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListInstancesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListInstancesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Instance(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Instance(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Instance(), + ), + ]; + client.descriptors.page.listInstances.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.visionai.v1alpha1.IInstance[] = []; + const iterable = client.listInstancesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listInstances.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listInstances.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listInstances with error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListInstancesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListInstancesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listInstances.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listInstancesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.visionai.v1alpha1.IInstance[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listInstances.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listInstances.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + + describe('listDrafts', () => { + it('invokes listDrafts without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListDraftsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListDraftsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Draft(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Draft(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Draft(), + ), + ]; + client.innerApiCalls.listDrafts = stubSimpleCall(expectedResponse); + const [response] = await client.listDrafts(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listDrafts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDrafts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDrafts without error using callback', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListDraftsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListDraftsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Draft(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Draft(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Draft(), + ), + ]; + client.innerApiCalls.listDrafts = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDrafts( + request, + ( + err?: Error | null, + result?: protos.google.cloud.visionai.v1alpha1.IDraft[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listDrafts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDrafts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDrafts with error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListDraftsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListDraftsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDrafts = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listDrafts(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listDrafts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDrafts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDraftsStream without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListDraftsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListDraftsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Draft(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Draft(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Draft(), + ), + ]; + client.descriptors.page.listDrafts.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listDraftsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.visionai.v1alpha1.Draft[] = []; + stream.on( + 'data', + (response: protos.google.cloud.visionai.v1alpha1.Draft) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listDrafts.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listDrafts, request), + ); + assert( + (client.descriptors.page.listDrafts.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listDraftsStream with error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListDraftsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListDraftsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDrafts.createStream = stubPageStreamingCall( + undefined, + expectedError, + ); + const stream = client.listDraftsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.visionai.v1alpha1.Draft[] = []; + stream.on( + 'data', + (response: protos.google.cloud.visionai.v1alpha1.Draft) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listDrafts.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listDrafts, request), + ); + assert( + (client.descriptors.page.listDrafts.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listDrafts without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListDraftsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListDraftsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Draft(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Draft(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Draft(), + ), + ]; + client.descriptors.page.listDrafts.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.visionai.v1alpha1.IDraft[] = []; + const iterable = client.listDraftsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listDrafts.asyncIterate as SinonStub).getCall( + 0, + ).args[1], + request, + ); + assert( + (client.descriptors.page.listDrafts.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listDrafts with error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListDraftsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListDraftsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDrafts.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError, + ); + const iterable = client.listDraftsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.visionai.v1alpha1.IDraft[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listDrafts.asyncIterate as SinonStub).getCall( + 0, + ).args[1], + request, + ); + assert( + (client.descriptors.page.listDrafts.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + + describe('listProcessors', () => { + it('invokes listProcessors without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListProcessorsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListProcessorsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Processor(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Processor(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Processor(), + ), + ]; + client.innerApiCalls.listProcessors = stubSimpleCall(expectedResponse); + const [response] = await client.listProcessors(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listProcessors as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listProcessors as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listProcessors without error using callback', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListProcessorsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListProcessorsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Processor(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Processor(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Processor(), + ), + ]; + client.innerApiCalls.listProcessors = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listProcessors( + request, + ( + err?: Error | null, + result?: protos.google.cloud.visionai.v1alpha1.IProcessor[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listProcessors as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listProcessors as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listProcessors with error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListProcessorsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListProcessorsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listProcessors = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listProcessors(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listProcessors as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listProcessors as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listProcessorsStream without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListProcessorsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListProcessorsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Processor(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Processor(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Processor(), + ), + ]; + client.descriptors.page.listProcessors.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listProcessorsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.visionai.v1alpha1.Processor[] = []; + stream.on( + 'data', + (response: protos.google.cloud.visionai.v1alpha1.Processor) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listProcessors.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listProcessors, request), + ); + assert( + (client.descriptors.page.listProcessors.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listProcessorsStream with error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListProcessorsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListProcessorsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listProcessors.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listProcessorsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.visionai.v1alpha1.Processor[] = []; + stream.on( + 'data', + (response: protos.google.cloud.visionai.v1alpha1.Processor) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listProcessors.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listProcessors, request), + ); + assert( + (client.descriptors.page.listProcessors.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listProcessors without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListProcessorsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListProcessorsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Processor(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Processor(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Processor(), + ), + ]; + client.descriptors.page.listProcessors.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.visionai.v1alpha1.IProcessor[] = []; + const iterable = client.listProcessorsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listProcessors.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listProcessors.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listProcessors with error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListProcessorsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListProcessorsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listProcessors.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listProcessorsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.visionai.v1alpha1.IProcessor[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listProcessors.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listProcessors.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy(), + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes getIamPolicy without error using callback', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy(), + ); + client.iamClient.getIamPolicy = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client + .getIamPolicy( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.Policy | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub).getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.getIamPolicy(request, expectedOptions), + expectedError, + ); + assert( + (client.iamClient.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy(), + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes setIamPolicy without error using callback', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy(), + ); + client.iamClient.setIamPolicy = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client + .setIamPolicy( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.Policy | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub).getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.setIamPolicy(request, expectedOptions), + expectedError, + ); + assert( + (client.iamClient.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse(), + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions( + request, + expectedOptions, + ); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes testIamPermissions without error using callback', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse(), + ); + client.iamClient.testIamPermissions = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client + .testIamPermissions( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.TestIamPermissionsResponse | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub).getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.testIamPermissions(request, expectedOptions), + expectedError, + ); + assert( + (client.iamClient.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError, + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest(), + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request), + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest(), + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + client.operationsClient.getOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient + .getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest(), + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(async () => { + await client.getOperation(request); + }, expectedError); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request), + ); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest(), + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.operationsClient.cancelOperation = + stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request), + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest(), + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.operationsClient.cancelOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient + .cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub).getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest(), + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(async () => { + await client.cancelOperation(request); + }, expectedError); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request), + ); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest(), + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.operationsClient.deleteOperation = + stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request), + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest(), + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.operationsClient.deleteOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient + .deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub).getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest(), + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(async () => { + await client.deleteOperation(request); + }, expectedError); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request), + ); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest(), + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse(), + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse(), + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse(), + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.IOperation[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest(), + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.IOperation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + }); + }); + + describe('Path templates', () => { + describe('analysis', async () => { + const fakePath = '/rendered/path/analysis'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cluster: 'clusterValue', + analysis: 'analysisValue', + }; + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.analysisPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.analysisPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('analysisPath', () => { + const result = client.analysisPath( + 'projectValue', + 'locationValue', + 'clusterValue', + 'analysisValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.analysisPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAnalysisName', () => { + const result = client.matchProjectFromAnalysisName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.analysisPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAnalysisName', () => { + const result = client.matchLocationFromAnalysisName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.analysisPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchClusterFromAnalysisName', () => { + const result = client.matchClusterFromAnalysisName(fakePath); + assert.strictEqual(result, 'clusterValue'); + assert( + (client.pathTemplates.analysisPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAnalysisFromAnalysisName', () => { + const result = client.matchAnalysisFromAnalysisName(fakePath); + assert.strictEqual(result, 'analysisValue'); + assert( + (client.pathTemplates.analysisPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('annotation', async () => { + const fakePath = '/rendered/path/annotation'; + const expectedParameters = { + project_number: 'projectNumberValue', + location: 'locationValue', + corpus: 'corpusValue', + asset: 'assetValue', + annotation: 'annotationValue', + }; + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.annotationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.annotationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('annotationPath', () => { + const result = client.annotationPath( + 'projectNumberValue', + 'locationValue', + 'corpusValue', + 'assetValue', + 'annotationValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.annotationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectNumberFromAnnotationName', () => { + const result = client.matchProjectNumberFromAnnotationName(fakePath); + assert.strictEqual(result, 'projectNumberValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAnnotationName', () => { + const result = client.matchLocationFromAnnotationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchCorpusFromAnnotationName', () => { + const result = client.matchCorpusFromAnnotationName(fakePath); + assert.strictEqual(result, 'corpusValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAssetFromAnnotationName', () => { + const result = client.matchAssetFromAnnotationName(fakePath); + assert.strictEqual(result, 'assetValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAnnotationFromAnnotationName', () => { + const result = client.matchAnnotationFromAnnotationName(fakePath); + assert.strictEqual(result, 'annotationValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('application', async () => { + const fakePath = '/rendered/path/application'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + application: 'applicationValue', + }; + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.applicationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.applicationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('applicationPath', () => { + const result = client.applicationPath( + 'projectValue', + 'locationValue', + 'applicationValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.applicationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromApplicationName', () => { + const result = client.matchProjectFromApplicationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.applicationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromApplicationName', () => { + const result = client.matchLocationFromApplicationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.applicationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchApplicationFromApplicationName', () => { + const result = client.matchApplicationFromApplicationName(fakePath); + assert.strictEqual(result, 'applicationValue'); + assert( + (client.pathTemplates.applicationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('asset', async () => { + const fakePath = '/rendered/path/asset'; + const expectedParameters = { + project_number: 'projectNumberValue', + location: 'locationValue', + corpus: 'corpusValue', + asset: 'assetValue', + }; + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.assetPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.assetPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('assetPath', () => { + const result = client.assetPath( + 'projectNumberValue', + 'locationValue', + 'corpusValue', + 'assetValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.assetPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectNumberFromAssetName', () => { + const result = client.matchProjectNumberFromAssetName(fakePath); + assert.strictEqual(result, 'projectNumberValue'); + assert( + (client.pathTemplates.assetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAssetName', () => { + const result = client.matchLocationFromAssetName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.assetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchCorpusFromAssetName', () => { + const result = client.matchCorpusFromAssetName(fakePath); + assert.strictEqual(result, 'corpusValue'); + assert( + (client.pathTemplates.assetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAssetFromAssetName', () => { + const result = client.matchAssetFromAssetName(fakePath); + assert.strictEqual(result, 'assetValue'); + assert( + (client.pathTemplates.assetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('channel', async () => { + const fakePath = '/rendered/path/channel'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cluster: 'clusterValue', + channel: 'channelValue', + }; + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.channelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.channelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('channelPath', () => { + const result = client.channelPath( + 'projectValue', + 'locationValue', + 'clusterValue', + 'channelValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.channelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromChannelName', () => { + const result = client.matchProjectFromChannelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.channelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromChannelName', () => { + const result = client.matchLocationFromChannelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.channelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchClusterFromChannelName', () => { + const result = client.matchClusterFromChannelName(fakePath); + assert.strictEqual(result, 'clusterValue'); + assert( + (client.pathTemplates.channelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchChannelFromChannelName', () => { + const result = client.matchChannelFromChannelName(fakePath); + assert.strictEqual(result, 'channelValue'); + assert( + (client.pathTemplates.channelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('cluster', async () => { + const fakePath = '/rendered/path/cluster'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cluster: 'clusterValue', + }; + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.clusterPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.clusterPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('clusterPath', () => { + const result = client.clusterPath( + 'projectValue', + 'locationValue', + 'clusterValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.clusterPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromClusterName', () => { + const result = client.matchProjectFromClusterName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.clusterPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromClusterName', () => { + const result = client.matchLocationFromClusterName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.clusterPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchClusterFromClusterName', () => { + const result = client.matchClusterFromClusterName(fakePath); + assert.strictEqual(result, 'clusterValue'); + assert( + (client.pathTemplates.clusterPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('corpus', async () => { + const fakePath = '/rendered/path/corpus'; + const expectedParameters = { + project_number: 'projectNumberValue', + location: 'locationValue', + corpus: 'corpusValue', + }; + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.corpusPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.corpusPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('corpusPath', () => { + const result = client.corpusPath( + 'projectNumberValue', + 'locationValue', + 'corpusValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.corpusPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectNumberFromCorpusName', () => { + const result = client.matchProjectNumberFromCorpusName(fakePath); + assert.strictEqual(result, 'projectNumberValue'); + assert( + (client.pathTemplates.corpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromCorpusName', () => { + const result = client.matchLocationFromCorpusName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.corpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchCorpusFromCorpusName', () => { + const result = client.matchCorpusFromCorpusName(fakePath); + assert.strictEqual(result, 'corpusValue'); + assert( + (client.pathTemplates.corpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('dataSchema', async () => { + const fakePath = '/rendered/path/dataSchema'; + const expectedParameters = { + project_number: 'projectNumberValue', + location: 'locationValue', + corpus: 'corpusValue', + data_schema: 'dataSchemaValue', + }; + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.dataSchemaPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.dataSchemaPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('dataSchemaPath', () => { + const result = client.dataSchemaPath( + 'projectNumberValue', + 'locationValue', + 'corpusValue', + 'dataSchemaValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.dataSchemaPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectNumberFromDataSchemaName', () => { + const result = client.matchProjectNumberFromDataSchemaName(fakePath); + assert.strictEqual(result, 'projectNumberValue'); + assert( + (client.pathTemplates.dataSchemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromDataSchemaName', () => { + const result = client.matchLocationFromDataSchemaName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.dataSchemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchCorpusFromDataSchemaName', () => { + const result = client.matchCorpusFromDataSchemaName(fakePath); + assert.strictEqual(result, 'corpusValue'); + assert( + (client.pathTemplates.dataSchemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDataSchemaFromDataSchemaName', () => { + const result = client.matchDataSchemaFromDataSchemaName(fakePath); + assert.strictEqual(result, 'dataSchemaValue'); + assert( + (client.pathTemplates.dataSchemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('draft', async () => { + const fakePath = '/rendered/path/draft'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + application: 'applicationValue', + draft: 'draftValue', + }; + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.draftPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.draftPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('draftPath', () => { + const result = client.draftPath( + 'projectValue', + 'locationValue', + 'applicationValue', + 'draftValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.draftPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromDraftName', () => { + const result = client.matchProjectFromDraftName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.draftPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromDraftName', () => { + const result = client.matchLocationFromDraftName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.draftPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchApplicationFromDraftName', () => { + const result = client.matchApplicationFromDraftName(fakePath); + assert.strictEqual(result, 'applicationValue'); + assert( + (client.pathTemplates.draftPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDraftFromDraftName', () => { + const result = client.matchDraftFromDraftName(fakePath); + assert.strictEqual(result, 'draftValue'); + assert( + (client.pathTemplates.draftPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('event', async () => { + const fakePath = '/rendered/path/event'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cluster: 'clusterValue', + event: 'eventValue', + }; + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.eventPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.eventPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('eventPath', () => { + const result = client.eventPath( + 'projectValue', + 'locationValue', + 'clusterValue', + 'eventValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.eventPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEventName', () => { + const result = client.matchProjectFromEventName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.eventPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEventName', () => { + const result = client.matchLocationFromEventName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.eventPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchClusterFromEventName', () => { + const result = client.matchClusterFromEventName(fakePath); + assert.strictEqual(result, 'clusterValue'); + assert( + (client.pathTemplates.eventPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEventFromEventName', () => { + const result = client.matchEventFromEventName(fakePath); + assert.strictEqual(result, 'eventValue'); + assert( + (client.pathTemplates.eventPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('instance', async () => { + const fakePath = '/rendered/path/instance'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + application: 'applicationValue', + instance: 'instanceValue', + }; + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.instancePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.instancePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath( + 'projectValue', + 'locationValue', + 'applicationValue', + 'instanceValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromInstanceName', () => { + const result = client.matchProjectFromInstanceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromInstanceName', () => { + const result = client.matchLocationFromInstanceName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchApplicationFromInstanceName', () => { + const result = client.matchApplicationFromInstanceName(fakePath); + assert.strictEqual(result, 'applicationValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('location', async () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.locationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.locationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath('projectValue', 'locationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('processor', async () => { + const fakePath = '/rendered/path/processor'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + processor: 'processorValue', + }; + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.processorPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.processorPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('processorPath', () => { + const result = client.processorPath( + 'projectValue', + 'locationValue', + 'processorValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.processorPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProcessorName', () => { + const result = client.matchProjectFromProcessorName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.processorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProcessorName', () => { + const result = client.matchLocationFromProcessorName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.processorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchProcessorFromProcessorName', () => { + const result = client.matchProcessorFromProcessorName(fakePath); + assert.strictEqual(result, 'processorValue'); + assert( + (client.pathTemplates.processorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('project', async () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('searchConfig', async () => { + const fakePath = '/rendered/path/searchConfig'; + const expectedParameters = { + project_number: 'projectNumberValue', + location: 'locationValue', + corpus: 'corpusValue', + search_config: 'searchConfigValue', + }; + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.searchConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.searchConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('searchConfigPath', () => { + const result = client.searchConfigPath( + 'projectNumberValue', + 'locationValue', + 'corpusValue', + 'searchConfigValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.searchConfigPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectNumberFromSearchConfigName', () => { + const result = client.matchProjectNumberFromSearchConfigName(fakePath); + assert.strictEqual(result, 'projectNumberValue'); + assert( + (client.pathTemplates.searchConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromSearchConfigName', () => { + const result = client.matchLocationFromSearchConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.searchConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchCorpusFromSearchConfigName', () => { + const result = client.matchCorpusFromSearchConfigName(fakePath); + assert.strictEqual(result, 'corpusValue'); + assert( + (client.pathTemplates.searchConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSearchConfigFromSearchConfigName', () => { + const result = client.matchSearchConfigFromSearchConfigName(fakePath); + assert.strictEqual(result, 'searchConfigValue'); + assert( + (client.pathTemplates.searchConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('series', async () => { + const fakePath = '/rendered/path/series'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cluster: 'clusterValue', + series: 'seriesValue', + }; + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.seriesPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.seriesPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('seriesPath', () => { + const result = client.seriesPath( + 'projectValue', + 'locationValue', + 'clusterValue', + 'seriesValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.seriesPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSeriesName', () => { + const result = client.matchProjectFromSeriesName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.seriesPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromSeriesName', () => { + const result = client.matchLocationFromSeriesName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.seriesPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchClusterFromSeriesName', () => { + const result = client.matchClusterFromSeriesName(fakePath); + assert.strictEqual(result, 'clusterValue'); + assert( + (client.pathTemplates.seriesPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSeriesFromSeriesName', () => { + const result = client.matchSeriesFromSeriesName(fakePath); + assert.strictEqual(result, 'seriesValue'); + assert( + (client.pathTemplates.seriesPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('stream', async () => { + const fakePath = '/rendered/path/stream'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cluster: 'clusterValue', + stream: 'streamValue', + }; + const client = new appplatformModule.v1alpha1.AppPlatformClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.streamPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.streamPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('streamPath', () => { + const result = client.streamPath( + 'projectValue', + 'locationValue', + 'clusterValue', + 'streamValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.streamPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromStreamName', () => { + const result = client.matchProjectFromStreamName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.streamPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromStreamName', () => { + const result = client.matchLocationFromStreamName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.streamPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchClusterFromStreamName', () => { + const result = client.matchClusterFromStreamName(fakePath); + assert.strictEqual(result, 'clusterValue'); + assert( + (client.pathTemplates.streamPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchStreamFromStreamName', () => { + const result = client.matchStreamFromStreamName(fakePath); + assert.strictEqual(result, 'streamValue'); + assert( + (client.pathTemplates.streamPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-visionai/test/gapic_live_video_analytics_v1alpha1.ts b/packages/google-cloud-visionai/test/gapic_live_video_analytics_v1alpha1.ts new file mode 100644 index 000000000000..1e550bf21348 --- /dev/null +++ b/packages/google-cloud-visionai/test/gapic_live_video_analytics_v1alpha1.ts @@ -0,0 +1,3442 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import { SinonStub } from 'sinon'; +import { describe, it } from 'mocha'; +import * as livevideoanalyticsModule from '../src'; + +import { PassThrough } from 'stream'; + +import { + protobuf, + LROperation, + operationsProtos, + IamProtos, + LocationProtos, +} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json'), +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, { defaults: true }); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject, + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error, +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error, +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error, +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error, +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error, +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({ done: true, value: undefined }); + } + return Promise.resolve({ done: false, value: responses![counter++] }); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1alpha1.LiveVideoAnalyticsClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'visionai.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = + livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient + .servicePath; + assert.strictEqual(servicePath, 'visionai.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient + .apiEndpoint; + assert.strictEqual(apiEndpoint, 'visionai.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'visionai.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'visionai.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'visionai.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'visionai.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = + livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.liveVideoAnalyticsStub, undefined); + await client.initialize(); + assert(client.liveVideoAnalyticsStub); + }); + + it('has close method for the initialized client', (done) => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.initialize().catch((err) => { + throw err; + }); + assert(client.liveVideoAnalyticsStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has close method for the non-initialized client', (done) => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.liveVideoAnalyticsStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('getAnalysis', () => { + it('invokes getAnalysis without error', async () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GetAnalysisRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GetAnalysisRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Analysis(), + ); + client.innerApiCalls.getAnalysis = stubSimpleCall(expectedResponse); + const [response] = await client.getAnalysis(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getAnalysis as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAnalysis as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAnalysis without error using callback', async () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GetAnalysisRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GetAnalysisRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Analysis(), + ); + client.innerApiCalls.getAnalysis = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getAnalysis( + request, + ( + err?: Error | null, + result?: protos.google.cloud.visionai.v1alpha1.IAnalysis | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getAnalysis as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAnalysis as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAnalysis with error', async () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GetAnalysisRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GetAnalysisRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getAnalysis = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getAnalysis(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getAnalysis as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAnalysis as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAnalysis with closed client', async () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GetAnalysisRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GetAnalysisRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getAnalysis(request), expectedError); + }); + }); + + describe('createAnalysis', () => { + it('invokes createAnalysis without error', async () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.CreateAnalysisRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.CreateAnalysisRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createAnalysis = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createAnalysis(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createAnalysis as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAnalysis as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAnalysis without error using callback', async () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.CreateAnalysisRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.CreateAnalysisRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createAnalysis = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createAnalysis( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.visionai.v1alpha1.IAnalysis, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.visionai.v1alpha1.IAnalysis, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createAnalysis as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAnalysis as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAnalysis with call error', async () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.CreateAnalysisRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.CreateAnalysisRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createAnalysis = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.createAnalysis(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createAnalysis as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAnalysis as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAnalysis with LRO error', async () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.CreateAnalysisRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.CreateAnalysisRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createAnalysis = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.createAnalysis(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createAnalysis as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAnalysis as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateAnalysisProgress without error', async () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateAnalysisProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateAnalysisProgress with error', async () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkCreateAnalysisProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateAnalysis', () => { + it('invokes updateAnalysis without error', async () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateAnalysisRequest(), + ); + request.analysis ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateAnalysisRequest', + ['analysis', 'name'], + ); + request.analysis.name = defaultValue1; + const expectedHeaderRequestParams = `analysis.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.updateAnalysis = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateAnalysis(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateAnalysis as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAnalysis as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAnalysis without error using callback', async () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateAnalysisRequest(), + ); + request.analysis ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateAnalysisRequest', + ['analysis', 'name'], + ); + request.analysis.name = defaultValue1; + const expectedHeaderRequestParams = `analysis.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.updateAnalysis = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateAnalysis( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.visionai.v1alpha1.IAnalysis, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.visionai.v1alpha1.IAnalysis, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateAnalysis as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAnalysis as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAnalysis with call error', async () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateAnalysisRequest(), + ); + request.analysis ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateAnalysisRequest', + ['analysis', 'name'], + ); + request.analysis.name = defaultValue1; + const expectedHeaderRequestParams = `analysis.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateAnalysis = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateAnalysis(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateAnalysis as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAnalysis as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAnalysis with LRO error', async () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateAnalysisRequest(), + ); + request.analysis ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateAnalysisRequest', + ['analysis', 'name'], + ); + request.analysis.name = defaultValue1; + const expectedHeaderRequestParams = `analysis.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateAnalysis = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.updateAnalysis(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateAnalysis as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAnalysis as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateAnalysisProgress without error', async () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateAnalysisProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateAnalysisProgress with error', async () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkUpdateAnalysisProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteAnalysis', () => { + it('invokes deleteAnalysis without error', async () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeleteAnalysisRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeleteAnalysisRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.deleteAnalysis = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteAnalysis(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteAnalysis as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAnalysis as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAnalysis without error using callback', async () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeleteAnalysisRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeleteAnalysisRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.deleteAnalysis = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteAnalysis( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteAnalysis as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAnalysis as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAnalysis with call error', async () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeleteAnalysisRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeleteAnalysisRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteAnalysis = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteAnalysis(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteAnalysis as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAnalysis as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAnalysis with LRO error', async () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeleteAnalysisRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeleteAnalysisRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteAnalysis = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.deleteAnalysis(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteAnalysis as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAnalysis as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteAnalysisProgress without error', async () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteAnalysisProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteAnalysisProgress with error', async () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkDeleteAnalysisProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listAnalyses', () => { + it('invokes listAnalyses without error', async () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListAnalysesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListAnalysesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Analysis(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Analysis(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Analysis(), + ), + ]; + client.innerApiCalls.listAnalyses = stubSimpleCall(expectedResponse); + const [response] = await client.listAnalyses(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listAnalyses as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAnalyses as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAnalyses without error using callback', async () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListAnalysesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListAnalysesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Analysis(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Analysis(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Analysis(), + ), + ]; + client.innerApiCalls.listAnalyses = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAnalyses( + request, + ( + err?: Error | null, + result?: protos.google.cloud.visionai.v1alpha1.IAnalysis[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listAnalyses as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAnalyses as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAnalyses with error', async () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListAnalysesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListAnalysesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listAnalyses = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listAnalyses(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listAnalyses as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAnalyses as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAnalysesStream without error', async () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListAnalysesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListAnalysesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Analysis(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Analysis(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Analysis(), + ), + ]; + client.descriptors.page.listAnalyses.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listAnalysesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.visionai.v1alpha1.Analysis[] = []; + stream.on( + 'data', + (response: protos.google.cloud.visionai.v1alpha1.Analysis) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listAnalyses.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listAnalyses, request), + ); + assert( + (client.descriptors.page.listAnalyses.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listAnalysesStream with error', async () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListAnalysesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListAnalysesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAnalyses.createStream = stubPageStreamingCall( + undefined, + expectedError, + ); + const stream = client.listAnalysesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.visionai.v1alpha1.Analysis[] = []; + stream.on( + 'data', + (response: protos.google.cloud.visionai.v1alpha1.Analysis) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listAnalyses.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listAnalyses, request), + ); + assert( + (client.descriptors.page.listAnalyses.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listAnalyses without error', async () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListAnalysesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListAnalysesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Analysis(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Analysis(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Analysis(), + ), + ]; + client.descriptors.page.listAnalyses.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.visionai.v1alpha1.IAnalysis[] = []; + const iterable = client.listAnalysesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listAnalyses.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listAnalyses.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listAnalyses with error', async () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListAnalysesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListAnalysesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAnalyses.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listAnalysesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.visionai.v1alpha1.IAnalysis[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listAnalyses.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listAnalyses.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy(), + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes getIamPolicy without error using callback', async () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy(), + ); + client.iamClient.getIamPolicy = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client + .getIamPolicy( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.Policy | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub).getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.getIamPolicy(request, expectedOptions), + expectedError, + ); + assert( + (client.iamClient.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy(), + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes setIamPolicy without error using callback', async () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy(), + ); + client.iamClient.setIamPolicy = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client + .setIamPolicy( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.Policy | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub).getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.setIamPolicy(request, expectedOptions), + expectedError, + ); + assert( + (client.iamClient.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse(), + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions( + request, + expectedOptions, + ); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes testIamPermissions without error using callback', async () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse(), + ); + client.iamClient.testIamPermissions = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client + .testIamPermissions( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.TestIamPermissionsResponse | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub).getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.testIamPermissions(request, expectedOptions), + expectedError, + ); + assert( + (client.iamClient.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError, + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest(), + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request), + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest(), + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + client.operationsClient.getOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient + .getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest(), + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(async () => { + await client.getOperation(request); + }, expectedError); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request), + ); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest(), + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.operationsClient.cancelOperation = + stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request), + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest(), + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.operationsClient.cancelOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient + .cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub).getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest(), + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(async () => { + await client.cancelOperation(request); + }, expectedError); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request), + ); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest(), + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.operationsClient.deleteOperation = + stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request), + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest(), + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.operationsClient.deleteOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient + .deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub).getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest(), + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(async () => { + await client.deleteOperation(request); + }, expectedError); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request), + ); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest(), + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse(), + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse(), + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse(), + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.IOperation[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + }); + it('uses async iteration with listOperations with error', async () => { + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest(), + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.IOperation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + }); + }); + + describe('Path templates', () => { + describe('analysis', async () => { + const fakePath = '/rendered/path/analysis'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cluster: 'clusterValue', + analysis: 'analysisValue', + }; + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.analysisPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.analysisPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('analysisPath', () => { + const result = client.analysisPath( + 'projectValue', + 'locationValue', + 'clusterValue', + 'analysisValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.analysisPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAnalysisName', () => { + const result = client.matchProjectFromAnalysisName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.analysisPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAnalysisName', () => { + const result = client.matchLocationFromAnalysisName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.analysisPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchClusterFromAnalysisName', () => { + const result = client.matchClusterFromAnalysisName(fakePath); + assert.strictEqual(result, 'clusterValue'); + assert( + (client.pathTemplates.analysisPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAnalysisFromAnalysisName', () => { + const result = client.matchAnalysisFromAnalysisName(fakePath); + assert.strictEqual(result, 'analysisValue'); + assert( + (client.pathTemplates.analysisPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('annotation', async () => { + const fakePath = '/rendered/path/annotation'; + const expectedParameters = { + project_number: 'projectNumberValue', + location: 'locationValue', + corpus: 'corpusValue', + asset: 'assetValue', + annotation: 'annotationValue', + }; + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.annotationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.annotationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('annotationPath', () => { + const result = client.annotationPath( + 'projectNumberValue', + 'locationValue', + 'corpusValue', + 'assetValue', + 'annotationValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.annotationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectNumberFromAnnotationName', () => { + const result = client.matchProjectNumberFromAnnotationName(fakePath); + assert.strictEqual(result, 'projectNumberValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAnnotationName', () => { + const result = client.matchLocationFromAnnotationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchCorpusFromAnnotationName', () => { + const result = client.matchCorpusFromAnnotationName(fakePath); + assert.strictEqual(result, 'corpusValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAssetFromAnnotationName', () => { + const result = client.matchAssetFromAnnotationName(fakePath); + assert.strictEqual(result, 'assetValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAnnotationFromAnnotationName', () => { + const result = client.matchAnnotationFromAnnotationName(fakePath); + assert.strictEqual(result, 'annotationValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('application', async () => { + const fakePath = '/rendered/path/application'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + application: 'applicationValue', + }; + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.applicationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.applicationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('applicationPath', () => { + const result = client.applicationPath( + 'projectValue', + 'locationValue', + 'applicationValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.applicationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromApplicationName', () => { + const result = client.matchProjectFromApplicationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.applicationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromApplicationName', () => { + const result = client.matchLocationFromApplicationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.applicationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchApplicationFromApplicationName', () => { + const result = client.matchApplicationFromApplicationName(fakePath); + assert.strictEqual(result, 'applicationValue'); + assert( + (client.pathTemplates.applicationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('asset', async () => { + const fakePath = '/rendered/path/asset'; + const expectedParameters = { + project_number: 'projectNumberValue', + location: 'locationValue', + corpus: 'corpusValue', + asset: 'assetValue', + }; + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.assetPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.assetPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('assetPath', () => { + const result = client.assetPath( + 'projectNumberValue', + 'locationValue', + 'corpusValue', + 'assetValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.assetPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectNumberFromAssetName', () => { + const result = client.matchProjectNumberFromAssetName(fakePath); + assert.strictEqual(result, 'projectNumberValue'); + assert( + (client.pathTemplates.assetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAssetName', () => { + const result = client.matchLocationFromAssetName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.assetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchCorpusFromAssetName', () => { + const result = client.matchCorpusFromAssetName(fakePath); + assert.strictEqual(result, 'corpusValue'); + assert( + (client.pathTemplates.assetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAssetFromAssetName', () => { + const result = client.matchAssetFromAssetName(fakePath); + assert.strictEqual(result, 'assetValue'); + assert( + (client.pathTemplates.assetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('channel', async () => { + const fakePath = '/rendered/path/channel'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cluster: 'clusterValue', + channel: 'channelValue', + }; + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.channelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.channelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('channelPath', () => { + const result = client.channelPath( + 'projectValue', + 'locationValue', + 'clusterValue', + 'channelValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.channelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromChannelName', () => { + const result = client.matchProjectFromChannelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.channelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromChannelName', () => { + const result = client.matchLocationFromChannelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.channelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchClusterFromChannelName', () => { + const result = client.matchClusterFromChannelName(fakePath); + assert.strictEqual(result, 'clusterValue'); + assert( + (client.pathTemplates.channelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchChannelFromChannelName', () => { + const result = client.matchChannelFromChannelName(fakePath); + assert.strictEqual(result, 'channelValue'); + assert( + (client.pathTemplates.channelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('cluster', async () => { + const fakePath = '/rendered/path/cluster'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cluster: 'clusterValue', + }; + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.clusterPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.clusterPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('clusterPath', () => { + const result = client.clusterPath( + 'projectValue', + 'locationValue', + 'clusterValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.clusterPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromClusterName', () => { + const result = client.matchProjectFromClusterName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.clusterPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromClusterName', () => { + const result = client.matchLocationFromClusterName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.clusterPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchClusterFromClusterName', () => { + const result = client.matchClusterFromClusterName(fakePath); + assert.strictEqual(result, 'clusterValue'); + assert( + (client.pathTemplates.clusterPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('corpus', async () => { + const fakePath = '/rendered/path/corpus'; + const expectedParameters = { + project_number: 'projectNumberValue', + location: 'locationValue', + corpus: 'corpusValue', + }; + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.corpusPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.corpusPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('corpusPath', () => { + const result = client.corpusPath( + 'projectNumberValue', + 'locationValue', + 'corpusValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.corpusPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectNumberFromCorpusName', () => { + const result = client.matchProjectNumberFromCorpusName(fakePath); + assert.strictEqual(result, 'projectNumberValue'); + assert( + (client.pathTemplates.corpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromCorpusName', () => { + const result = client.matchLocationFromCorpusName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.corpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchCorpusFromCorpusName', () => { + const result = client.matchCorpusFromCorpusName(fakePath); + assert.strictEqual(result, 'corpusValue'); + assert( + (client.pathTemplates.corpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('dataSchema', async () => { + const fakePath = '/rendered/path/dataSchema'; + const expectedParameters = { + project_number: 'projectNumberValue', + location: 'locationValue', + corpus: 'corpusValue', + data_schema: 'dataSchemaValue', + }; + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.dataSchemaPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.dataSchemaPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('dataSchemaPath', () => { + const result = client.dataSchemaPath( + 'projectNumberValue', + 'locationValue', + 'corpusValue', + 'dataSchemaValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.dataSchemaPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectNumberFromDataSchemaName', () => { + const result = client.matchProjectNumberFromDataSchemaName(fakePath); + assert.strictEqual(result, 'projectNumberValue'); + assert( + (client.pathTemplates.dataSchemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromDataSchemaName', () => { + const result = client.matchLocationFromDataSchemaName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.dataSchemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchCorpusFromDataSchemaName', () => { + const result = client.matchCorpusFromDataSchemaName(fakePath); + assert.strictEqual(result, 'corpusValue'); + assert( + (client.pathTemplates.dataSchemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDataSchemaFromDataSchemaName', () => { + const result = client.matchDataSchemaFromDataSchemaName(fakePath); + assert.strictEqual(result, 'dataSchemaValue'); + assert( + (client.pathTemplates.dataSchemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('draft', async () => { + const fakePath = '/rendered/path/draft'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + application: 'applicationValue', + draft: 'draftValue', + }; + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.draftPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.draftPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('draftPath', () => { + const result = client.draftPath( + 'projectValue', + 'locationValue', + 'applicationValue', + 'draftValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.draftPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromDraftName', () => { + const result = client.matchProjectFromDraftName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.draftPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromDraftName', () => { + const result = client.matchLocationFromDraftName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.draftPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchApplicationFromDraftName', () => { + const result = client.matchApplicationFromDraftName(fakePath); + assert.strictEqual(result, 'applicationValue'); + assert( + (client.pathTemplates.draftPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDraftFromDraftName', () => { + const result = client.matchDraftFromDraftName(fakePath); + assert.strictEqual(result, 'draftValue'); + assert( + (client.pathTemplates.draftPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('event', async () => { + const fakePath = '/rendered/path/event'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cluster: 'clusterValue', + event: 'eventValue', + }; + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.eventPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.eventPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('eventPath', () => { + const result = client.eventPath( + 'projectValue', + 'locationValue', + 'clusterValue', + 'eventValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.eventPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEventName', () => { + const result = client.matchProjectFromEventName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.eventPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEventName', () => { + const result = client.matchLocationFromEventName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.eventPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchClusterFromEventName', () => { + const result = client.matchClusterFromEventName(fakePath); + assert.strictEqual(result, 'clusterValue'); + assert( + (client.pathTemplates.eventPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEventFromEventName', () => { + const result = client.matchEventFromEventName(fakePath); + assert.strictEqual(result, 'eventValue'); + assert( + (client.pathTemplates.eventPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('instance', async () => { + const fakePath = '/rendered/path/instance'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + application: 'applicationValue', + instance: 'instanceValue', + }; + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.instancePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.instancePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath( + 'projectValue', + 'locationValue', + 'applicationValue', + 'instanceValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromInstanceName', () => { + const result = client.matchProjectFromInstanceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromInstanceName', () => { + const result = client.matchLocationFromInstanceName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchApplicationFromInstanceName', () => { + const result = client.matchApplicationFromInstanceName(fakePath); + assert.strictEqual(result, 'applicationValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('processor', async () => { + const fakePath = '/rendered/path/processor'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + processor: 'processorValue', + }; + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.processorPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.processorPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('processorPath', () => { + const result = client.processorPath( + 'projectValue', + 'locationValue', + 'processorValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.processorPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProcessorName', () => { + const result = client.matchProjectFromProcessorName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.processorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProcessorName', () => { + const result = client.matchLocationFromProcessorName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.processorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchProcessorFromProcessorName', () => { + const result = client.matchProcessorFromProcessorName(fakePath); + assert.strictEqual(result, 'processorValue'); + assert( + (client.pathTemplates.processorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('searchConfig', async () => { + const fakePath = '/rendered/path/searchConfig'; + const expectedParameters = { + project_number: 'projectNumberValue', + location: 'locationValue', + corpus: 'corpusValue', + search_config: 'searchConfigValue', + }; + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.searchConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.searchConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('searchConfigPath', () => { + const result = client.searchConfigPath( + 'projectNumberValue', + 'locationValue', + 'corpusValue', + 'searchConfigValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.searchConfigPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectNumberFromSearchConfigName', () => { + const result = client.matchProjectNumberFromSearchConfigName(fakePath); + assert.strictEqual(result, 'projectNumberValue'); + assert( + (client.pathTemplates.searchConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromSearchConfigName', () => { + const result = client.matchLocationFromSearchConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.searchConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchCorpusFromSearchConfigName', () => { + const result = client.matchCorpusFromSearchConfigName(fakePath); + assert.strictEqual(result, 'corpusValue'); + assert( + (client.pathTemplates.searchConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSearchConfigFromSearchConfigName', () => { + const result = client.matchSearchConfigFromSearchConfigName(fakePath); + assert.strictEqual(result, 'searchConfigValue'); + assert( + (client.pathTemplates.searchConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('series', async () => { + const fakePath = '/rendered/path/series'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cluster: 'clusterValue', + series: 'seriesValue', + }; + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.seriesPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.seriesPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('seriesPath', () => { + const result = client.seriesPath( + 'projectValue', + 'locationValue', + 'clusterValue', + 'seriesValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.seriesPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSeriesName', () => { + const result = client.matchProjectFromSeriesName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.seriesPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromSeriesName', () => { + const result = client.matchLocationFromSeriesName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.seriesPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchClusterFromSeriesName', () => { + const result = client.matchClusterFromSeriesName(fakePath); + assert.strictEqual(result, 'clusterValue'); + assert( + (client.pathTemplates.seriesPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSeriesFromSeriesName', () => { + const result = client.matchSeriesFromSeriesName(fakePath); + assert.strictEqual(result, 'seriesValue'); + assert( + (client.pathTemplates.seriesPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('stream', async () => { + const fakePath = '/rendered/path/stream'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cluster: 'clusterValue', + stream: 'streamValue', + }; + const client = + new livevideoanalyticsModule.v1alpha1.LiveVideoAnalyticsClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.streamPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.streamPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('streamPath', () => { + const result = client.streamPath( + 'projectValue', + 'locationValue', + 'clusterValue', + 'streamValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.streamPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromStreamName', () => { + const result = client.matchProjectFromStreamName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.streamPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromStreamName', () => { + const result = client.matchLocationFromStreamName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.streamPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchClusterFromStreamName', () => { + const result = client.matchClusterFromStreamName(fakePath); + assert.strictEqual(result, 'clusterValue'); + assert( + (client.pathTemplates.streamPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchStreamFromStreamName', () => { + const result = client.matchStreamFromStreamName(fakePath); + assert.strictEqual(result, 'streamValue'); + assert( + (client.pathTemplates.streamPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-visionai/test/gapic_streaming_service_v1alpha1.ts b/packages/google-cloud-visionai/test/gapic_streaming_service_v1alpha1.ts new file mode 100644 index 000000000000..b47ab3975794 --- /dev/null +++ b/packages/google-cloud-visionai/test/gapic_streaming_service_v1alpha1.ts @@ -0,0 +1,2712 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import { SinonStub } from 'sinon'; +import { describe, it } from 'mocha'; +import * as streamingserviceModule from '../src'; + +import { PassThrough } from 'stream'; + +import { protobuf, IamProtos, LocationProtos } from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json'), +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, { defaults: true }); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject, + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error, +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubBidiStreamingCall( + response?: ResponseType, + error?: Error, +) { + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error, +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({ done: true, value: undefined }); + } + return Promise.resolve({ done: false, value: responses![counter++] }); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1alpha1.StreamingServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = + new streamingserviceModule.v1alpha1.StreamingServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'visionai.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = + new streamingserviceModule.v1alpha1.StreamingServiceClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = + streamingserviceModule.v1alpha1.StreamingServiceClient.servicePath; + assert.strictEqual(servicePath, 'visionai.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + streamingserviceModule.v1alpha1.StreamingServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'visionai.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new streamingserviceModule.v1alpha1.StreamingServiceClient( + { universeDomain: 'example.com' }, + ); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'visionai.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new streamingserviceModule.v1alpha1.StreamingServiceClient( + { universe_domain: 'example.com' }, + ); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'visionai.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new streamingserviceModule.v1alpha1.StreamingServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'visionai.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new streamingserviceModule.v1alpha1.StreamingServiceClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'visionai.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new streamingserviceModule.v1alpha1.StreamingServiceClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = streamingserviceModule.v1alpha1.StreamingServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new streamingserviceModule.v1alpha1.StreamingServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new streamingserviceModule.v1alpha1.StreamingServiceClient( + { + fallback: true, + }, + ); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new streamingserviceModule.v1alpha1.StreamingServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + assert.strictEqual(client.streamingServiceStub, undefined); + await client.initialize(); + assert(client.streamingServiceStub); + }); + + it('has close method for the initialized client', (done) => { + const client = new streamingserviceModule.v1alpha1.StreamingServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + client.initialize().catch((err) => { + throw err; + }); + assert(client.streamingServiceStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has close method for the non-initialized client', (done) => { + const client = new streamingserviceModule.v1alpha1.StreamingServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + assert.strictEqual(client.streamingServiceStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new streamingserviceModule.v1alpha1.StreamingServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new streamingserviceModule.v1alpha1.StreamingServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('acquireLease', () => { + it('invokes acquireLease without error', async () => { + const client = new streamingserviceModule.v1alpha1.StreamingServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.AcquireLeaseRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.AcquireLeaseRequest', + ['series'], + ); + request.series = defaultValue1; + const expectedHeaderRequestParams = `series=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Lease(), + ); + client.innerApiCalls.acquireLease = stubSimpleCall(expectedResponse); + const [response] = await client.acquireLease(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.acquireLease as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.acquireLease as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes acquireLease without error using callback', async () => { + const client = new streamingserviceModule.v1alpha1.StreamingServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.AcquireLeaseRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.AcquireLeaseRequest', + ['series'], + ); + request.series = defaultValue1; + const expectedHeaderRequestParams = `series=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Lease(), + ); + client.innerApiCalls.acquireLease = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.acquireLease( + request, + ( + err?: Error | null, + result?: protos.google.cloud.visionai.v1alpha1.ILease | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.acquireLease as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.acquireLease as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes acquireLease with error', async () => { + const client = new streamingserviceModule.v1alpha1.StreamingServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.AcquireLeaseRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.AcquireLeaseRequest', + ['series'], + ); + request.series = defaultValue1; + const expectedHeaderRequestParams = `series=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.acquireLease = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.acquireLease(request), expectedError); + const actualRequest = ( + client.innerApiCalls.acquireLease as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.acquireLease as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes acquireLease with closed client', async () => { + const client = new streamingserviceModule.v1alpha1.StreamingServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.AcquireLeaseRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.AcquireLeaseRequest', + ['series'], + ); + request.series = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.acquireLease(request), expectedError); + }); + }); + + describe('renewLease', () => { + it('invokes renewLease without error', async () => { + const client = new streamingserviceModule.v1alpha1.StreamingServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.RenewLeaseRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.RenewLeaseRequest', + ['series'], + ); + request.series = defaultValue1; + const expectedHeaderRequestParams = `series=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Lease(), + ); + client.innerApiCalls.renewLease = stubSimpleCall(expectedResponse); + const [response] = await client.renewLease(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.renewLease as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.renewLease as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes renewLease without error using callback', async () => { + const client = new streamingserviceModule.v1alpha1.StreamingServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.RenewLeaseRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.RenewLeaseRequest', + ['series'], + ); + request.series = defaultValue1; + const expectedHeaderRequestParams = `series=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Lease(), + ); + client.innerApiCalls.renewLease = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.renewLease( + request, + ( + err?: Error | null, + result?: protos.google.cloud.visionai.v1alpha1.ILease | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.renewLease as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.renewLease as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes renewLease with error', async () => { + const client = new streamingserviceModule.v1alpha1.StreamingServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.RenewLeaseRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.RenewLeaseRequest', + ['series'], + ); + request.series = defaultValue1; + const expectedHeaderRequestParams = `series=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.renewLease = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.renewLease(request), expectedError); + const actualRequest = ( + client.innerApiCalls.renewLease as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.renewLease as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes renewLease with closed client', async () => { + const client = new streamingserviceModule.v1alpha1.StreamingServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.RenewLeaseRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.RenewLeaseRequest', + ['series'], + ); + request.series = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.renewLease(request), expectedError); + }); + }); + + describe('releaseLease', () => { + it('invokes releaseLease without error', async () => { + const client = new streamingserviceModule.v1alpha1.StreamingServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ReleaseLeaseRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ReleaseLeaseRequest', + ['series'], + ); + request.series = defaultValue1; + const expectedHeaderRequestParams = `series=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ReleaseLeaseResponse(), + ); + client.innerApiCalls.releaseLease = stubSimpleCall(expectedResponse); + const [response] = await client.releaseLease(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.releaseLease as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.releaseLease as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes releaseLease without error using callback', async () => { + const client = new streamingserviceModule.v1alpha1.StreamingServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ReleaseLeaseRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ReleaseLeaseRequest', + ['series'], + ); + request.series = defaultValue1; + const expectedHeaderRequestParams = `series=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ReleaseLeaseResponse(), + ); + client.innerApiCalls.releaseLease = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.releaseLease( + request, + ( + err?: Error | null, + result?: protos.google.cloud.visionai.v1alpha1.IReleaseLeaseResponse | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.releaseLease as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.releaseLease as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes releaseLease with error', async () => { + const client = new streamingserviceModule.v1alpha1.StreamingServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ReleaseLeaseRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ReleaseLeaseRequest', + ['series'], + ); + request.series = defaultValue1; + const expectedHeaderRequestParams = `series=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.releaseLease = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.releaseLease(request), expectedError); + const actualRequest = ( + client.innerApiCalls.releaseLease as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.releaseLease as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes releaseLease with closed client', async () => { + const client = new streamingserviceModule.v1alpha1.StreamingServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ReleaseLeaseRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ReleaseLeaseRequest', + ['series'], + ); + request.series = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.releaseLease(request), expectedError); + }); + }); + + describe('sendPackets', () => { + it('invokes sendPackets without error', async () => { + const client = new streamingserviceModule.v1alpha1.StreamingServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.SendPacketsRequest(), + ); + + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.SendPacketsResponse(), + ); + client.innerApiCalls.sendPackets = + stubBidiStreamingCall(expectedResponse); + const stream = client.sendPackets(); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + ( + response: protos.google.cloud.visionai.v1alpha1.SendPacketsResponse, + ) => { + resolve(response); + }, + ); + stream.on('error', (err: Error) => { + reject(err); + }); + stream.write(request); + stream.end(); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.sendPackets as SinonStub) + .getCall(0) + .calledWith(null), + ); + assert.deepStrictEqual( + ((stream as unknown as PassThrough)._transform as SinonStub).getCall(0) + .args[0], + request, + ); + }); + + it('invokes sendPackets with error', async () => { + const client = new streamingserviceModule.v1alpha1.StreamingServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.SendPacketsRequest(), + ); + const expectedError = new Error('expected'); + client.innerApiCalls.sendPackets = stubBidiStreamingCall( + undefined, + expectedError, + ); + const stream = client.sendPackets(); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + ( + response: protos.google.cloud.visionai.v1alpha1.SendPacketsResponse, + ) => { + resolve(response); + }, + ); + stream.on('error', (err: Error) => { + reject(err); + }); + stream.write(request); + stream.end(); + }); + await assert.rejects(promise, expectedError); + assert( + (client.innerApiCalls.sendPackets as SinonStub) + .getCall(0) + .calledWith(null), + ); + assert.deepStrictEqual( + ((stream as unknown as PassThrough)._transform as SinonStub).getCall(0) + .args[0], + request, + ); + }); + }); + + describe('receivePackets', () => { + it('invokes receivePackets without error', async () => { + const client = new streamingserviceModule.v1alpha1.StreamingServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ReceivePacketsRequest(), + ); + + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ReceivePacketsResponse(), + ); + client.innerApiCalls.receivePackets = + stubBidiStreamingCall(expectedResponse); + const stream = client.receivePackets(); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + ( + response: protos.google.cloud.visionai.v1alpha1.ReceivePacketsResponse, + ) => { + resolve(response); + }, + ); + stream.on('error', (err: Error) => { + reject(err); + }); + stream.write(request); + stream.end(); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.receivePackets as SinonStub) + .getCall(0) + .calledWith(null), + ); + assert.deepStrictEqual( + ((stream as unknown as PassThrough)._transform as SinonStub).getCall(0) + .args[0], + request, + ); + }); + + it('invokes receivePackets with error', async () => { + const client = new streamingserviceModule.v1alpha1.StreamingServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ReceivePacketsRequest(), + ); + const expectedError = new Error('expected'); + client.innerApiCalls.receivePackets = stubBidiStreamingCall( + undefined, + expectedError, + ); + const stream = client.receivePackets(); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + ( + response: protos.google.cloud.visionai.v1alpha1.ReceivePacketsResponse, + ) => { + resolve(response); + }, + ); + stream.on('error', (err: Error) => { + reject(err); + }); + stream.write(request); + stream.end(); + }); + await assert.rejects(promise, expectedError); + assert( + (client.innerApiCalls.receivePackets as SinonStub) + .getCall(0) + .calledWith(null), + ); + assert.deepStrictEqual( + ((stream as unknown as PassThrough)._transform as SinonStub).getCall(0) + .args[0], + request, + ); + }); + }); + + describe('receiveEvents', () => { + it('invokes receiveEvents without error', async () => { + const client = new streamingserviceModule.v1alpha1.StreamingServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ReceiveEventsRequest(), + ); + + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ReceiveEventsResponse(), + ); + client.innerApiCalls.receiveEvents = + stubBidiStreamingCall(expectedResponse); + const stream = client.receiveEvents(); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + ( + response: protos.google.cloud.visionai.v1alpha1.ReceiveEventsResponse, + ) => { + resolve(response); + }, + ); + stream.on('error', (err: Error) => { + reject(err); + }); + stream.write(request); + stream.end(); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.receiveEvents as SinonStub) + .getCall(0) + .calledWith(null), + ); + assert.deepStrictEqual( + ((stream as unknown as PassThrough)._transform as SinonStub).getCall(0) + .args[0], + request, + ); + }); + + it('invokes receiveEvents with error', async () => { + const client = new streamingserviceModule.v1alpha1.StreamingServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ReceiveEventsRequest(), + ); + const expectedError = new Error('expected'); + client.innerApiCalls.receiveEvents = stubBidiStreamingCall( + undefined, + expectedError, + ); + const stream = client.receiveEvents(); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + ( + response: protos.google.cloud.visionai.v1alpha1.ReceiveEventsResponse, + ) => { + resolve(response); + }, + ); + stream.on('error', (err: Error) => { + reject(err); + }); + stream.write(request); + stream.end(); + }); + await assert.rejects(promise, expectedError); + assert( + (client.innerApiCalls.receiveEvents as SinonStub) + .getCall(0) + .calledWith(null), + ); + assert.deepStrictEqual( + ((stream as unknown as PassThrough)._transform as SinonStub).getCall(0) + .args[0], + request, + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new streamingserviceModule.v1alpha1.StreamingServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy(), + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes getIamPolicy without error using callback', async () => { + const client = new streamingserviceModule.v1alpha1.StreamingServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy(), + ); + client.iamClient.getIamPolicy = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client + .getIamPolicy( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.Policy | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub).getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new streamingserviceModule.v1alpha1.StreamingServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.getIamPolicy(request, expectedOptions), + expectedError, + ); + assert( + (client.iamClient.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new streamingserviceModule.v1alpha1.StreamingServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy(), + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes setIamPolicy without error using callback', async () => { + const client = new streamingserviceModule.v1alpha1.StreamingServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy(), + ); + client.iamClient.setIamPolicy = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client + .setIamPolicy( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.Policy | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub).getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new streamingserviceModule.v1alpha1.StreamingServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.setIamPolicy(request, expectedOptions), + expectedError, + ); + assert( + (client.iamClient.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new streamingserviceModule.v1alpha1.StreamingServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse(), + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions( + request, + expectedOptions, + ); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes testIamPermissions without error using callback', async () => { + const client = new streamingserviceModule.v1alpha1.StreamingServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse(), + ); + client.iamClient.testIamPermissions = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client + .testIamPermissions( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.TestIamPermissionsResponse | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub).getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new streamingserviceModule.v1alpha1.StreamingServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.testIamPermissions(request, expectedOptions), + expectedError, + ); + assert( + (client.iamClient.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new streamingserviceModule.v1alpha1.StreamingServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = new streamingserviceModule.v1alpha1.StreamingServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new streamingserviceModule.v1alpha1.StreamingServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError, + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new streamingserviceModule.v1alpha1.StreamingServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new streamingserviceModule.v1alpha1.StreamingServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + }); + + describe('Path templates', () => { + describe('analysis', async () => { + const fakePath = '/rendered/path/analysis'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cluster: 'clusterValue', + analysis: 'analysisValue', + }; + const client = new streamingserviceModule.v1alpha1.StreamingServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.analysisPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.analysisPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('analysisPath', () => { + const result = client.analysisPath( + 'projectValue', + 'locationValue', + 'clusterValue', + 'analysisValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.analysisPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAnalysisName', () => { + const result = client.matchProjectFromAnalysisName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.analysisPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAnalysisName', () => { + const result = client.matchLocationFromAnalysisName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.analysisPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchClusterFromAnalysisName', () => { + const result = client.matchClusterFromAnalysisName(fakePath); + assert.strictEqual(result, 'clusterValue'); + assert( + (client.pathTemplates.analysisPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAnalysisFromAnalysisName', () => { + const result = client.matchAnalysisFromAnalysisName(fakePath); + assert.strictEqual(result, 'analysisValue'); + assert( + (client.pathTemplates.analysisPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('annotation', async () => { + const fakePath = '/rendered/path/annotation'; + const expectedParameters = { + project_number: 'projectNumberValue', + location: 'locationValue', + corpus: 'corpusValue', + asset: 'assetValue', + annotation: 'annotationValue', + }; + const client = new streamingserviceModule.v1alpha1.StreamingServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.annotationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.annotationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('annotationPath', () => { + const result = client.annotationPath( + 'projectNumberValue', + 'locationValue', + 'corpusValue', + 'assetValue', + 'annotationValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.annotationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectNumberFromAnnotationName', () => { + const result = client.matchProjectNumberFromAnnotationName(fakePath); + assert.strictEqual(result, 'projectNumberValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAnnotationName', () => { + const result = client.matchLocationFromAnnotationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchCorpusFromAnnotationName', () => { + const result = client.matchCorpusFromAnnotationName(fakePath); + assert.strictEqual(result, 'corpusValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAssetFromAnnotationName', () => { + const result = client.matchAssetFromAnnotationName(fakePath); + assert.strictEqual(result, 'assetValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAnnotationFromAnnotationName', () => { + const result = client.matchAnnotationFromAnnotationName(fakePath); + assert.strictEqual(result, 'annotationValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('application', async () => { + const fakePath = '/rendered/path/application'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + application: 'applicationValue', + }; + const client = new streamingserviceModule.v1alpha1.StreamingServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.applicationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.applicationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('applicationPath', () => { + const result = client.applicationPath( + 'projectValue', + 'locationValue', + 'applicationValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.applicationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromApplicationName', () => { + const result = client.matchProjectFromApplicationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.applicationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromApplicationName', () => { + const result = client.matchLocationFromApplicationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.applicationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchApplicationFromApplicationName', () => { + const result = client.matchApplicationFromApplicationName(fakePath); + assert.strictEqual(result, 'applicationValue'); + assert( + (client.pathTemplates.applicationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('asset', async () => { + const fakePath = '/rendered/path/asset'; + const expectedParameters = { + project_number: 'projectNumberValue', + location: 'locationValue', + corpus: 'corpusValue', + asset: 'assetValue', + }; + const client = new streamingserviceModule.v1alpha1.StreamingServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.assetPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.assetPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('assetPath', () => { + const result = client.assetPath( + 'projectNumberValue', + 'locationValue', + 'corpusValue', + 'assetValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.assetPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectNumberFromAssetName', () => { + const result = client.matchProjectNumberFromAssetName(fakePath); + assert.strictEqual(result, 'projectNumberValue'); + assert( + (client.pathTemplates.assetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAssetName', () => { + const result = client.matchLocationFromAssetName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.assetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchCorpusFromAssetName', () => { + const result = client.matchCorpusFromAssetName(fakePath); + assert.strictEqual(result, 'corpusValue'); + assert( + (client.pathTemplates.assetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAssetFromAssetName', () => { + const result = client.matchAssetFromAssetName(fakePath); + assert.strictEqual(result, 'assetValue'); + assert( + (client.pathTemplates.assetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('channel', async () => { + const fakePath = '/rendered/path/channel'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cluster: 'clusterValue', + channel: 'channelValue', + }; + const client = new streamingserviceModule.v1alpha1.StreamingServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.channelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.channelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('channelPath', () => { + const result = client.channelPath( + 'projectValue', + 'locationValue', + 'clusterValue', + 'channelValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.channelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromChannelName', () => { + const result = client.matchProjectFromChannelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.channelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromChannelName', () => { + const result = client.matchLocationFromChannelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.channelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchClusterFromChannelName', () => { + const result = client.matchClusterFromChannelName(fakePath); + assert.strictEqual(result, 'clusterValue'); + assert( + (client.pathTemplates.channelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchChannelFromChannelName', () => { + const result = client.matchChannelFromChannelName(fakePath); + assert.strictEqual(result, 'channelValue'); + assert( + (client.pathTemplates.channelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('cluster', async () => { + const fakePath = '/rendered/path/cluster'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cluster: 'clusterValue', + }; + const client = new streamingserviceModule.v1alpha1.StreamingServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.clusterPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.clusterPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('clusterPath', () => { + const result = client.clusterPath( + 'projectValue', + 'locationValue', + 'clusterValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.clusterPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromClusterName', () => { + const result = client.matchProjectFromClusterName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.clusterPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromClusterName', () => { + const result = client.matchLocationFromClusterName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.clusterPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchClusterFromClusterName', () => { + const result = client.matchClusterFromClusterName(fakePath); + assert.strictEqual(result, 'clusterValue'); + assert( + (client.pathTemplates.clusterPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('corpus', async () => { + const fakePath = '/rendered/path/corpus'; + const expectedParameters = { + project_number: 'projectNumberValue', + location: 'locationValue', + corpus: 'corpusValue', + }; + const client = new streamingserviceModule.v1alpha1.StreamingServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.corpusPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.corpusPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('corpusPath', () => { + const result = client.corpusPath( + 'projectNumberValue', + 'locationValue', + 'corpusValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.corpusPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectNumberFromCorpusName', () => { + const result = client.matchProjectNumberFromCorpusName(fakePath); + assert.strictEqual(result, 'projectNumberValue'); + assert( + (client.pathTemplates.corpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromCorpusName', () => { + const result = client.matchLocationFromCorpusName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.corpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchCorpusFromCorpusName', () => { + const result = client.matchCorpusFromCorpusName(fakePath); + assert.strictEqual(result, 'corpusValue'); + assert( + (client.pathTemplates.corpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('dataSchema', async () => { + const fakePath = '/rendered/path/dataSchema'; + const expectedParameters = { + project_number: 'projectNumberValue', + location: 'locationValue', + corpus: 'corpusValue', + data_schema: 'dataSchemaValue', + }; + const client = new streamingserviceModule.v1alpha1.StreamingServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.dataSchemaPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.dataSchemaPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('dataSchemaPath', () => { + const result = client.dataSchemaPath( + 'projectNumberValue', + 'locationValue', + 'corpusValue', + 'dataSchemaValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.dataSchemaPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectNumberFromDataSchemaName', () => { + const result = client.matchProjectNumberFromDataSchemaName(fakePath); + assert.strictEqual(result, 'projectNumberValue'); + assert( + (client.pathTemplates.dataSchemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromDataSchemaName', () => { + const result = client.matchLocationFromDataSchemaName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.dataSchemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchCorpusFromDataSchemaName', () => { + const result = client.matchCorpusFromDataSchemaName(fakePath); + assert.strictEqual(result, 'corpusValue'); + assert( + (client.pathTemplates.dataSchemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDataSchemaFromDataSchemaName', () => { + const result = client.matchDataSchemaFromDataSchemaName(fakePath); + assert.strictEqual(result, 'dataSchemaValue'); + assert( + (client.pathTemplates.dataSchemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('draft', async () => { + const fakePath = '/rendered/path/draft'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + application: 'applicationValue', + draft: 'draftValue', + }; + const client = new streamingserviceModule.v1alpha1.StreamingServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.draftPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.draftPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('draftPath', () => { + const result = client.draftPath( + 'projectValue', + 'locationValue', + 'applicationValue', + 'draftValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.draftPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromDraftName', () => { + const result = client.matchProjectFromDraftName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.draftPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromDraftName', () => { + const result = client.matchLocationFromDraftName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.draftPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchApplicationFromDraftName', () => { + const result = client.matchApplicationFromDraftName(fakePath); + assert.strictEqual(result, 'applicationValue'); + assert( + (client.pathTemplates.draftPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDraftFromDraftName', () => { + const result = client.matchDraftFromDraftName(fakePath); + assert.strictEqual(result, 'draftValue'); + assert( + (client.pathTemplates.draftPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('event', async () => { + const fakePath = '/rendered/path/event'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cluster: 'clusterValue', + event: 'eventValue', + }; + const client = new streamingserviceModule.v1alpha1.StreamingServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.eventPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.eventPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('eventPath', () => { + const result = client.eventPath( + 'projectValue', + 'locationValue', + 'clusterValue', + 'eventValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.eventPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEventName', () => { + const result = client.matchProjectFromEventName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.eventPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEventName', () => { + const result = client.matchLocationFromEventName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.eventPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchClusterFromEventName', () => { + const result = client.matchClusterFromEventName(fakePath); + assert.strictEqual(result, 'clusterValue'); + assert( + (client.pathTemplates.eventPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEventFromEventName', () => { + const result = client.matchEventFromEventName(fakePath); + assert.strictEqual(result, 'eventValue'); + assert( + (client.pathTemplates.eventPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('instance', async () => { + const fakePath = '/rendered/path/instance'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + application: 'applicationValue', + instance: 'instanceValue', + }; + const client = new streamingserviceModule.v1alpha1.StreamingServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.instancePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.instancePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath( + 'projectValue', + 'locationValue', + 'applicationValue', + 'instanceValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromInstanceName', () => { + const result = client.matchProjectFromInstanceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromInstanceName', () => { + const result = client.matchLocationFromInstanceName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchApplicationFromInstanceName', () => { + const result = client.matchApplicationFromInstanceName(fakePath); + assert.strictEqual(result, 'applicationValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('processor', async () => { + const fakePath = '/rendered/path/processor'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + processor: 'processorValue', + }; + const client = new streamingserviceModule.v1alpha1.StreamingServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.processorPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.processorPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('processorPath', () => { + const result = client.processorPath( + 'projectValue', + 'locationValue', + 'processorValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.processorPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProcessorName', () => { + const result = client.matchProjectFromProcessorName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.processorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProcessorName', () => { + const result = client.matchLocationFromProcessorName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.processorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchProcessorFromProcessorName', () => { + const result = client.matchProcessorFromProcessorName(fakePath); + assert.strictEqual(result, 'processorValue'); + assert( + (client.pathTemplates.processorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('searchConfig', async () => { + const fakePath = '/rendered/path/searchConfig'; + const expectedParameters = { + project_number: 'projectNumberValue', + location: 'locationValue', + corpus: 'corpusValue', + search_config: 'searchConfigValue', + }; + const client = new streamingserviceModule.v1alpha1.StreamingServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.searchConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.searchConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('searchConfigPath', () => { + const result = client.searchConfigPath( + 'projectNumberValue', + 'locationValue', + 'corpusValue', + 'searchConfigValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.searchConfigPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectNumberFromSearchConfigName', () => { + const result = client.matchProjectNumberFromSearchConfigName(fakePath); + assert.strictEqual(result, 'projectNumberValue'); + assert( + (client.pathTemplates.searchConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromSearchConfigName', () => { + const result = client.matchLocationFromSearchConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.searchConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchCorpusFromSearchConfigName', () => { + const result = client.matchCorpusFromSearchConfigName(fakePath); + assert.strictEqual(result, 'corpusValue'); + assert( + (client.pathTemplates.searchConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSearchConfigFromSearchConfigName', () => { + const result = client.matchSearchConfigFromSearchConfigName(fakePath); + assert.strictEqual(result, 'searchConfigValue'); + assert( + (client.pathTemplates.searchConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('series', async () => { + const fakePath = '/rendered/path/series'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cluster: 'clusterValue', + series: 'seriesValue', + }; + const client = new streamingserviceModule.v1alpha1.StreamingServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.seriesPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.seriesPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('seriesPath', () => { + const result = client.seriesPath( + 'projectValue', + 'locationValue', + 'clusterValue', + 'seriesValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.seriesPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSeriesName', () => { + const result = client.matchProjectFromSeriesName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.seriesPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromSeriesName', () => { + const result = client.matchLocationFromSeriesName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.seriesPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchClusterFromSeriesName', () => { + const result = client.matchClusterFromSeriesName(fakePath); + assert.strictEqual(result, 'clusterValue'); + assert( + (client.pathTemplates.seriesPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSeriesFromSeriesName', () => { + const result = client.matchSeriesFromSeriesName(fakePath); + assert.strictEqual(result, 'seriesValue'); + assert( + (client.pathTemplates.seriesPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('stream', async () => { + const fakePath = '/rendered/path/stream'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cluster: 'clusterValue', + stream: 'streamValue', + }; + const client = new streamingserviceModule.v1alpha1.StreamingServiceClient( + { + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }, + ); + await client.initialize(); + client.pathTemplates.streamPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.streamPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('streamPath', () => { + const result = client.streamPath( + 'projectValue', + 'locationValue', + 'clusterValue', + 'streamValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.streamPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromStreamName', () => { + const result = client.matchProjectFromStreamName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.streamPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromStreamName', () => { + const result = client.matchLocationFromStreamName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.streamPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchClusterFromStreamName', () => { + const result = client.matchClusterFromStreamName(fakePath); + assert.strictEqual(result, 'clusterValue'); + assert( + (client.pathTemplates.streamPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchStreamFromStreamName', () => { + const result = client.matchStreamFromStreamName(fakePath); + assert.strictEqual(result, 'streamValue'); + assert( + (client.pathTemplates.streamPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-visionai/test/gapic_streams_service_v1alpha1.ts b/packages/google-cloud-visionai/test/gapic_streams_service_v1alpha1.ts new file mode 100644 index 000000000000..2cc9099e6112 --- /dev/null +++ b/packages/google-cloud-visionai/test/gapic_streams_service_v1alpha1.ts @@ -0,0 +1,6874 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import { SinonStub } from 'sinon'; +import { describe, it } from 'mocha'; +import * as streamsserviceModule from '../src'; + +import { PassThrough } from 'stream'; + +import { + protobuf, + LROperation, + operationsProtos, + IamProtos, + LocationProtos, +} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json'), +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, { defaults: true }); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject, + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error, +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error, +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error, +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error, +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error, +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({ done: true, value: undefined }); + } + return Promise.resolve({ done: false, value: responses![counter++] }); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1alpha1.StreamsServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'visionai.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = + streamsserviceModule.v1alpha1.StreamsServiceClient.servicePath; + assert.strictEqual(servicePath, 'visionai.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + streamsserviceModule.v1alpha1.StreamsServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'visionai.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'visionai.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'visionai.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new streamsserviceModule.v1alpha1.StreamsServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'visionai.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient( + { universeDomain: 'configured.example.com' }, + ); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'visionai.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new streamsserviceModule.v1alpha1.StreamsServiceClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = streamsserviceModule.v1alpha1.StreamsServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.streamsServiceStub, undefined); + await client.initialize(); + assert(client.streamsServiceStub); + }); + + it('has close method for the initialized client', (done) => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.initialize().catch((err) => { + throw err; + }); + assert(client.streamsServiceStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has close method for the non-initialized client', (done) => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.streamsServiceStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('getCluster', () => { + it('invokes getCluster without error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GetClusterRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GetClusterRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Cluster(), + ); + client.innerApiCalls.getCluster = stubSimpleCall(expectedResponse); + const [response] = await client.getCluster(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCluster without error using callback', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GetClusterRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GetClusterRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Cluster(), + ); + client.innerApiCalls.getCluster = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getCluster( + request, + ( + err?: Error | null, + result?: protos.google.cloud.visionai.v1alpha1.ICluster | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCluster with error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GetClusterRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GetClusterRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getCluster = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getCluster(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCluster with closed client', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GetClusterRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GetClusterRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getCluster(request), expectedError); + }); + }); + + describe('getStream', () => { + it('invokes getStream without error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GetStreamRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GetStreamRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Stream(), + ); + client.innerApiCalls.getStream = stubSimpleCall(expectedResponse); + const [response] = await client.getStream(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getStream as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getStream as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getStream without error using callback', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GetStreamRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GetStreamRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Stream(), + ); + client.innerApiCalls.getStream = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getStream( + request, + ( + err?: Error | null, + result?: protos.google.cloud.visionai.v1alpha1.IStream | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getStream as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getStream as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getStream with error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GetStreamRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GetStreamRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getStream = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getStream(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getStream as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getStream as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getStream with closed client', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GetStreamRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GetStreamRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getStream(request), expectedError); + }); + }); + + describe('generateStreamHlsToken', () => { + it('invokes generateStreamHlsToken without error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenRequest', + ['stream'], + ); + request.stream = defaultValue1; + const expectedHeaderRequestParams = `stream=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenResponse(), + ); + client.innerApiCalls.generateStreamHlsToken = + stubSimpleCall(expectedResponse); + const [response] = await client.generateStreamHlsToken(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.generateStreamHlsToken as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.generateStreamHlsToken as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateStreamHlsToken without error using callback', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenRequest', + ['stream'], + ); + request.stream = defaultValue1; + const expectedHeaderRequestParams = `stream=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenResponse(), + ); + client.innerApiCalls.generateStreamHlsToken = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.generateStreamHlsToken( + request, + ( + err?: Error | null, + result?: protos.google.cloud.visionai.v1alpha1.IGenerateStreamHlsTokenResponse | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.generateStreamHlsToken as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.generateStreamHlsToken as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateStreamHlsToken with error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenRequest', + ['stream'], + ); + request.stream = defaultValue1; + const expectedHeaderRequestParams = `stream=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.generateStreamHlsToken = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.generateStreamHlsToken(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.generateStreamHlsToken as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.generateStreamHlsToken as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateStreamHlsToken with closed client', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GenerateStreamHlsTokenRequest', + ['stream'], + ); + request.stream = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects( + client.generateStreamHlsToken(request), + expectedError, + ); + }); + }); + + describe('getEvent', () => { + it('invokes getEvent without error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GetEventRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GetEventRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Event(), + ); + client.innerApiCalls.getEvent = stubSimpleCall(expectedResponse); + const [response] = await client.getEvent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getEvent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getEvent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEvent without error using callback', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GetEventRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GetEventRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Event(), + ); + client.innerApiCalls.getEvent = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getEvent( + request, + ( + err?: Error | null, + result?: protos.google.cloud.visionai.v1alpha1.IEvent | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getEvent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getEvent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEvent with error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GetEventRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GetEventRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getEvent = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getEvent(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getEvent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getEvent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEvent with closed client', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GetEventRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GetEventRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getEvent(request), expectedError); + }); + }); + + describe('getSeries', () => { + it('invokes getSeries without error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GetSeriesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GetSeriesRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Series(), + ); + client.innerApiCalls.getSeries = stubSimpleCall(expectedResponse); + const [response] = await client.getSeries(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getSeries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSeries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSeries without error using callback', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GetSeriesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GetSeriesRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Series(), + ); + client.innerApiCalls.getSeries = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSeries( + request, + ( + err?: Error | null, + result?: protos.google.cloud.visionai.v1alpha1.ISeries | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getSeries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSeries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSeries with error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GetSeriesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GetSeriesRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getSeries = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getSeries(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getSeries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSeries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSeries with closed client', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GetSeriesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GetSeriesRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getSeries(request), expectedError); + }); + }); + + describe('createCluster', () => { + it('invokes createCluster without error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.CreateClusterRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.CreateClusterRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createCluster = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCluster without error using callback', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.CreateClusterRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.CreateClusterRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createCluster = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createCluster( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.visionai.v1alpha1.ICluster, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.visionai.v1alpha1.ICluster, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCluster with call error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.CreateClusterRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.CreateClusterRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCluster = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.createCluster(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCluster with LRO error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.CreateClusterRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.CreateClusterRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCluster = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.createCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateClusterProgress without error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateClusterProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateClusterProgress with error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkCreateClusterProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateCluster', () => { + it('invokes updateCluster without error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateClusterRequest(), + ); + request.cluster ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateClusterRequest', + ['cluster', 'name'], + ); + request.cluster.name = defaultValue1; + const expectedHeaderRequestParams = `cluster.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.updateCluster = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCluster without error using callback', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateClusterRequest(), + ); + request.cluster ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateClusterRequest', + ['cluster', 'name'], + ); + request.cluster.name = defaultValue1; + const expectedHeaderRequestParams = `cluster.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.updateCluster = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateCluster( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.visionai.v1alpha1.ICluster, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.visionai.v1alpha1.ICluster, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCluster with call error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateClusterRequest(), + ); + request.cluster ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateClusterRequest', + ['cluster', 'name'], + ); + request.cluster.name = defaultValue1; + const expectedHeaderRequestParams = `cluster.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCluster = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateCluster(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCluster with LRO error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateClusterRequest(), + ); + request.cluster ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateClusterRequest', + ['cluster', 'name'], + ); + request.cluster.name = defaultValue1; + const expectedHeaderRequestParams = `cluster.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCluster = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.updateCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateClusterProgress without error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateClusterProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateClusterProgress with error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkUpdateClusterProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteCluster', () => { + it('invokes deleteCluster without error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeleteClusterRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeleteClusterRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.deleteCluster = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCluster without error using callback', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeleteClusterRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeleteClusterRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.deleteCluster = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteCluster( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCluster with call error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeleteClusterRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeleteClusterRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCluster = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteCluster(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCluster with LRO error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeleteClusterRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeleteClusterRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCluster = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.deleteCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteClusterProgress without error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteClusterProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteClusterProgress with error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkDeleteClusterProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createStream', () => { + it('invokes createStream without error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.CreateStreamRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.CreateStreamRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createStream = stubLongRunningCall(expectedResponse); + const [operation] = await client.createStream(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createStream as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createStream as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createStream without error using callback', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.CreateStreamRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.CreateStreamRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createStream = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createStream( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.visionai.v1alpha1.IStream, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.visionai.v1alpha1.IStream, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createStream as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createStream as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createStream with call error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.CreateStreamRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.CreateStreamRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createStream = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.createStream(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createStream as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createStream as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createStream with LRO error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.CreateStreamRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.CreateStreamRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createStream = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.createStream(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createStream as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createStream as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateStreamProgress without error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateStreamProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateStreamProgress with error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.checkCreateStreamProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateStream', () => { + it('invokes updateStream without error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateStreamRequest(), + ); + request.stream ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateStreamRequest', + ['stream', 'name'], + ); + request.stream.name = defaultValue1; + const expectedHeaderRequestParams = `stream.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.updateStream = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateStream(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateStream as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateStream as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateStream without error using callback', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateStreamRequest(), + ); + request.stream ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateStreamRequest', + ['stream', 'name'], + ); + request.stream.name = defaultValue1; + const expectedHeaderRequestParams = `stream.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.updateStream = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateStream( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.visionai.v1alpha1.IStream, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.visionai.v1alpha1.IStream, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateStream as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateStream as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateStream with call error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateStreamRequest(), + ); + request.stream ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateStreamRequest', + ['stream', 'name'], + ); + request.stream.name = defaultValue1; + const expectedHeaderRequestParams = `stream.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateStream = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateStream(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateStream as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateStream as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateStream with LRO error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateStreamRequest(), + ); + request.stream ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateStreamRequest', + ['stream', 'name'], + ); + request.stream.name = defaultValue1; + const expectedHeaderRequestParams = `stream.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateStream = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.updateStream(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateStream as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateStream as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateStreamProgress without error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateStreamProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateStreamProgress with error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.checkUpdateStreamProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteStream', () => { + it('invokes deleteStream without error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeleteStreamRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeleteStreamRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.deleteStream = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteStream(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteStream as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteStream as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteStream without error using callback', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeleteStreamRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeleteStreamRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.deleteStream = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteStream( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteStream as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteStream as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteStream with call error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeleteStreamRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeleteStreamRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteStream = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteStream(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteStream as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteStream as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteStream with LRO error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeleteStreamRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeleteStreamRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteStream = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.deleteStream(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteStream as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteStream as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteStreamProgress without error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteStreamProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteStreamProgress with error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.checkDeleteStreamProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createEvent', () => { + it('invokes createEvent without error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.CreateEventRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.CreateEventRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createEvent = stubLongRunningCall(expectedResponse); + const [operation] = await client.createEvent(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createEvent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEvent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEvent without error using callback', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.CreateEventRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.CreateEventRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createEvent = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createEvent( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.visionai.v1alpha1.IEvent, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.visionai.v1alpha1.IEvent, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createEvent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEvent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEvent with call error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.CreateEventRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.CreateEventRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createEvent = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.createEvent(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createEvent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEvent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEvent with LRO error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.CreateEventRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.CreateEventRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createEvent = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.createEvent(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createEvent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEvent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateEventProgress without error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateEventProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateEventProgress with error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.checkCreateEventProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateEvent', () => { + it('invokes updateEvent without error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateEventRequest(), + ); + request.event ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateEventRequest', + ['event', 'name'], + ); + request.event.name = defaultValue1; + const expectedHeaderRequestParams = `event.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.updateEvent = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateEvent(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateEvent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateEvent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEvent without error using callback', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateEventRequest(), + ); + request.event ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateEventRequest', + ['event', 'name'], + ); + request.event.name = defaultValue1; + const expectedHeaderRequestParams = `event.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.updateEvent = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateEvent( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.visionai.v1alpha1.IEvent, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.visionai.v1alpha1.IEvent, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateEvent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateEvent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEvent with call error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateEventRequest(), + ); + request.event ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateEventRequest', + ['event', 'name'], + ); + request.event.name = defaultValue1; + const expectedHeaderRequestParams = `event.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateEvent = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateEvent(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateEvent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateEvent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEvent with LRO error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateEventRequest(), + ); + request.event ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateEventRequest', + ['event', 'name'], + ); + request.event.name = defaultValue1; + const expectedHeaderRequestParams = `event.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateEvent = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.updateEvent(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateEvent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateEvent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateEventProgress without error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateEventProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateEventProgress with error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.checkUpdateEventProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteEvent', () => { + it('invokes deleteEvent without error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeleteEventRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeleteEventRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.deleteEvent = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteEvent(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteEvent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteEvent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEvent without error using callback', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeleteEventRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeleteEventRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.deleteEvent = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteEvent( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteEvent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteEvent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEvent with call error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeleteEventRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeleteEventRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteEvent = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteEvent(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteEvent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteEvent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEvent with LRO error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeleteEventRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeleteEventRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteEvent = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.deleteEvent(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteEvent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteEvent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteEventProgress without error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteEventProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteEventProgress with error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.checkDeleteEventProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createSeries', () => { + it('invokes createSeries without error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.CreateSeriesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.CreateSeriesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createSeries = stubLongRunningCall(expectedResponse); + const [operation] = await client.createSeries(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createSeries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSeries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSeries without error using callback', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.CreateSeriesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.CreateSeriesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createSeries = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createSeries( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.visionai.v1alpha1.ISeries, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.visionai.v1alpha1.ISeries, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createSeries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSeries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSeries with call error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.CreateSeriesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.CreateSeriesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSeries = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.createSeries(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createSeries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSeries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSeries with LRO error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.CreateSeriesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.CreateSeriesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSeries = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.createSeries(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createSeries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSeries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateSeriesProgress without error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateSeriesProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateSeriesProgress with error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.checkCreateSeriesProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateSeries', () => { + it('invokes updateSeries without error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateSeriesRequest(), + ); + request.series ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateSeriesRequest', + ['series', 'name'], + ); + request.series.name = defaultValue1; + const expectedHeaderRequestParams = `series.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.updateSeries = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateSeries(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSeries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSeries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSeries without error using callback', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateSeriesRequest(), + ); + request.series ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateSeriesRequest', + ['series', 'name'], + ); + request.series.name = defaultValue1; + const expectedHeaderRequestParams = `series.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.updateSeries = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateSeries( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.visionai.v1alpha1.ISeries, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.visionai.v1alpha1.ISeries, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSeries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSeries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSeries with call error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateSeriesRequest(), + ); + request.series ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateSeriesRequest', + ['series', 'name'], + ); + request.series.name = defaultValue1; + const expectedHeaderRequestParams = `series.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSeries = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateSeries(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateSeries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSeries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSeries with LRO error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateSeriesRequest(), + ); + request.series ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateSeriesRequest', + ['series', 'name'], + ); + request.series.name = defaultValue1; + const expectedHeaderRequestParams = `series.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSeries = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.updateSeries(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateSeries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSeries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateSeriesProgress without error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateSeriesProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateSeriesProgress with error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.checkUpdateSeriesProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteSeries', () => { + it('invokes deleteSeries without error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeleteSeriesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeleteSeriesRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.deleteSeries = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteSeries(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteSeries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSeries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSeries without error using callback', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeleteSeriesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeleteSeriesRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.deleteSeries = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteSeries( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteSeries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSeries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSeries with call error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeleteSeriesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeleteSeriesRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSeries = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteSeries(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteSeries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSeries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSeries with LRO error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeleteSeriesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeleteSeriesRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSeries = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.deleteSeries(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteSeries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSeries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteSeriesProgress without error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteSeriesProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteSeriesProgress with error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.checkDeleteSeriesProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('materializeChannel', () => { + it('invokes materializeChannel without error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.MaterializeChannelRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.MaterializeChannelRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.materializeChannel = + stubLongRunningCall(expectedResponse); + const [operation] = await client.materializeChannel(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.materializeChannel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.materializeChannel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes materializeChannel without error using callback', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.MaterializeChannelRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.MaterializeChannelRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.materializeChannel = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.materializeChannel( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.visionai.v1alpha1.IChannel, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.visionai.v1alpha1.IChannel, + protos.google.cloud.visionai.v1alpha1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.materializeChannel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.materializeChannel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes materializeChannel with call error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.MaterializeChannelRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.MaterializeChannelRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.materializeChannel = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.materializeChannel(request), expectedError); + const actualRequest = ( + client.innerApiCalls.materializeChannel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.materializeChannel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes materializeChannel with LRO error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.MaterializeChannelRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.MaterializeChannelRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.materializeChannel = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.materializeChannel(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.materializeChannel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.materializeChannel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkMaterializeChannelProgress without error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkMaterializeChannelProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkMaterializeChannelProgress with error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkMaterializeChannelProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listClusters', () => { + it('invokes listClusters without error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListClustersRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListClustersRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Cluster(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Cluster(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Cluster(), + ), + ]; + client.innerApiCalls.listClusters = stubSimpleCall(expectedResponse); + const [response] = await client.listClusters(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listClusters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listClusters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listClusters without error using callback', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListClustersRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListClustersRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Cluster(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Cluster(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Cluster(), + ), + ]; + client.innerApiCalls.listClusters = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listClusters( + request, + ( + err?: Error | null, + result?: protos.google.cloud.visionai.v1alpha1.ICluster[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listClusters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listClusters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listClusters with error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListClustersRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListClustersRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listClusters = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listClusters(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listClusters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listClusters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listClustersStream without error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListClustersRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListClustersRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Cluster(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Cluster(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Cluster(), + ), + ]; + client.descriptors.page.listClusters.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listClustersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.visionai.v1alpha1.Cluster[] = []; + stream.on( + 'data', + (response: protos.google.cloud.visionai.v1alpha1.Cluster) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listClusters.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listClusters, request), + ); + assert( + (client.descriptors.page.listClusters.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listClustersStream with error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListClustersRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListClustersRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listClusters.createStream = stubPageStreamingCall( + undefined, + expectedError, + ); + const stream = client.listClustersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.visionai.v1alpha1.Cluster[] = []; + stream.on( + 'data', + (response: protos.google.cloud.visionai.v1alpha1.Cluster) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listClusters.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listClusters, request), + ); + assert( + (client.descriptors.page.listClusters.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listClusters without error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListClustersRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListClustersRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Cluster(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Cluster(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Cluster(), + ), + ]; + client.descriptors.page.listClusters.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.visionai.v1alpha1.ICluster[] = []; + const iterable = client.listClustersAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listClusters.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listClusters.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listClusters with error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListClustersRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListClustersRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listClusters.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listClustersAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.visionai.v1alpha1.ICluster[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listClusters.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listClusters.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + + describe('listStreams', () => { + it('invokes listStreams without error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListStreamsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListStreamsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Stream(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Stream(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Stream(), + ), + ]; + client.innerApiCalls.listStreams = stubSimpleCall(expectedResponse); + const [response] = await client.listStreams(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listStreams as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listStreams as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listStreams without error using callback', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListStreamsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListStreamsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Stream(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Stream(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Stream(), + ), + ]; + client.innerApiCalls.listStreams = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listStreams( + request, + ( + err?: Error | null, + result?: protos.google.cloud.visionai.v1alpha1.IStream[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listStreams as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listStreams as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listStreams with error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListStreamsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListStreamsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listStreams = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listStreams(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listStreams as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listStreams as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listStreamsStream without error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListStreamsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListStreamsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Stream(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Stream(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Stream(), + ), + ]; + client.descriptors.page.listStreams.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStreamsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.visionai.v1alpha1.Stream[] = []; + stream.on( + 'data', + (response: protos.google.cloud.visionai.v1alpha1.Stream) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listStreams.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listStreams, request), + ); + assert( + (client.descriptors.page.listStreams.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listStreamsStream with error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListStreamsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListStreamsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listStreams.createStream = stubPageStreamingCall( + undefined, + expectedError, + ); + const stream = client.listStreamsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.visionai.v1alpha1.Stream[] = []; + stream.on( + 'data', + (response: protos.google.cloud.visionai.v1alpha1.Stream) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listStreams.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listStreams, request), + ); + assert( + (client.descriptors.page.listStreams.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listStreams without error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListStreamsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListStreamsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Stream(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Stream(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Stream(), + ), + ]; + client.descriptors.page.listStreams.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.visionai.v1alpha1.IStream[] = []; + const iterable = client.listStreamsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listStreams.asyncIterate as SinonStub).getCall( + 0, + ).args[1], + request, + ); + assert( + (client.descriptors.page.listStreams.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listStreams with error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListStreamsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListStreamsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listStreams.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError, + ); + const iterable = client.listStreamsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.visionai.v1alpha1.IStream[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listStreams.asyncIterate as SinonStub).getCall( + 0, + ).args[1], + request, + ); + assert( + (client.descriptors.page.listStreams.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + + describe('listEvents', () => { + it('invokes listEvents without error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListEventsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListEventsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Event(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Event(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Event(), + ), + ]; + client.innerApiCalls.listEvents = stubSimpleCall(expectedResponse); + const [response] = await client.listEvents(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listEvents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listEvents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEvents without error using callback', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListEventsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListEventsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Event(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Event(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Event(), + ), + ]; + client.innerApiCalls.listEvents = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listEvents( + request, + ( + err?: Error | null, + result?: protos.google.cloud.visionai.v1alpha1.IEvent[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listEvents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listEvents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEvents with error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListEventsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListEventsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listEvents = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listEvents(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listEvents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listEvents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEventsStream without error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListEventsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListEventsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Event(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Event(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Event(), + ), + ]; + client.descriptors.page.listEvents.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listEventsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.visionai.v1alpha1.Event[] = []; + stream.on( + 'data', + (response: protos.google.cloud.visionai.v1alpha1.Event) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listEvents.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listEvents, request), + ); + assert( + (client.descriptors.page.listEvents.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listEventsStream with error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListEventsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListEventsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listEvents.createStream = stubPageStreamingCall( + undefined, + expectedError, + ); + const stream = client.listEventsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.visionai.v1alpha1.Event[] = []; + stream.on( + 'data', + (response: protos.google.cloud.visionai.v1alpha1.Event) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listEvents.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listEvents, request), + ); + assert( + (client.descriptors.page.listEvents.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listEvents without error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListEventsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListEventsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Event(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Event(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Event(), + ), + ]; + client.descriptors.page.listEvents.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.visionai.v1alpha1.IEvent[] = []; + const iterable = client.listEventsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listEvents.asyncIterate as SinonStub).getCall( + 0, + ).args[1], + request, + ); + assert( + (client.descriptors.page.listEvents.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listEvents with error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListEventsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListEventsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listEvents.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError, + ); + const iterable = client.listEventsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.visionai.v1alpha1.IEvent[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listEvents.asyncIterate as SinonStub).getCall( + 0, + ).args[1], + request, + ); + assert( + (client.descriptors.page.listEvents.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + + describe('listSeries', () => { + it('invokes listSeries without error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListSeriesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListSeriesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Series(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Series(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Series(), + ), + ]; + client.innerApiCalls.listSeries = stubSimpleCall(expectedResponse); + const [response] = await client.listSeries(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSeries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSeries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSeries without error using callback', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListSeriesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListSeriesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Series(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Series(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Series(), + ), + ]; + client.innerApiCalls.listSeries = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSeries( + request, + ( + err?: Error | null, + result?: protos.google.cloud.visionai.v1alpha1.ISeries[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSeries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSeries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSeries with error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListSeriesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListSeriesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listSeries = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listSeries(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listSeries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSeries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSeriesStream without error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListSeriesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListSeriesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Series(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Series(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Series(), + ), + ]; + client.descriptors.page.listSeries.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listSeriesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.visionai.v1alpha1.Series[] = []; + stream.on( + 'data', + (response: protos.google.cloud.visionai.v1alpha1.Series) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listSeries.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSeries, request), + ); + assert( + (client.descriptors.page.listSeries.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listSeriesStream with error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListSeriesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListSeriesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSeries.createStream = stubPageStreamingCall( + undefined, + expectedError, + ); + const stream = client.listSeriesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.visionai.v1alpha1.Series[] = []; + stream.on( + 'data', + (response: protos.google.cloud.visionai.v1alpha1.Series) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listSeries.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSeries, request), + ); + assert( + (client.descriptors.page.listSeries.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listSeries without error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListSeriesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListSeriesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Series(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Series(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Series(), + ), + ]; + client.descriptors.page.listSeries.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.visionai.v1alpha1.ISeries[] = []; + const iterable = client.listSeriesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listSeries.asyncIterate as SinonStub).getCall( + 0, + ).args[1], + request, + ); + assert( + (client.descriptors.page.listSeries.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listSeries with error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListSeriesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListSeriesRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSeries.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError, + ); + const iterable = client.listSeriesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.visionai.v1alpha1.ISeries[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listSeries.asyncIterate as SinonStub).getCall( + 0, + ).args[1], + request, + ); + assert( + (client.descriptors.page.listSeries.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy(), + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes getIamPolicy without error using callback', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy(), + ); + client.iamClient.getIamPolicy = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client + .getIamPolicy( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.Policy | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub).getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.getIamPolicy(request, expectedOptions), + expectedError, + ); + assert( + (client.iamClient.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy(), + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes setIamPolicy without error using callback', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy(), + ); + client.iamClient.setIamPolicy = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client + .setIamPolicy( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.Policy | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub).getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.setIamPolicy(request, expectedOptions), + expectedError, + ); + assert( + (client.iamClient.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse(), + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions( + request, + expectedOptions, + ); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes testIamPermissions without error using callback', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse(), + ); + client.iamClient.testIamPermissions = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client + .testIamPermissions( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.TestIamPermissionsResponse | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub).getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.testIamPermissions(request, expectedOptions), + expectedError, + ); + assert( + (client.iamClient.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError, + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest(), + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request), + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest(), + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + client.operationsClient.getOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient + .getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest(), + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(async () => { + await client.getOperation(request); + }, expectedError); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request), + ); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest(), + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.operationsClient.cancelOperation = + stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request), + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest(), + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.operationsClient.cancelOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient + .cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub).getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest(), + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(async () => { + await client.cancelOperation(request); + }, expectedError); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request), + ); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest(), + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.operationsClient.deleteOperation = + stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request), + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest(), + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.operationsClient.deleteOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient + .deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub).getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest(), + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(async () => { + await client.deleteOperation(request); + }, expectedError); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request), + ); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest(), + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse(), + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse(), + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse(), + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.IOperation[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest(), + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.IOperation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + }); + }); + + describe('Path templates', () => { + describe('analysis', async () => { + const fakePath = '/rendered/path/analysis'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cluster: 'clusterValue', + analysis: 'analysisValue', + }; + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.analysisPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.analysisPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('analysisPath', () => { + const result = client.analysisPath( + 'projectValue', + 'locationValue', + 'clusterValue', + 'analysisValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.analysisPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAnalysisName', () => { + const result = client.matchProjectFromAnalysisName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.analysisPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAnalysisName', () => { + const result = client.matchLocationFromAnalysisName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.analysisPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchClusterFromAnalysisName', () => { + const result = client.matchClusterFromAnalysisName(fakePath); + assert.strictEqual(result, 'clusterValue'); + assert( + (client.pathTemplates.analysisPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAnalysisFromAnalysisName', () => { + const result = client.matchAnalysisFromAnalysisName(fakePath); + assert.strictEqual(result, 'analysisValue'); + assert( + (client.pathTemplates.analysisPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('annotation', async () => { + const fakePath = '/rendered/path/annotation'; + const expectedParameters = { + project_number: 'projectNumberValue', + location: 'locationValue', + corpus: 'corpusValue', + asset: 'assetValue', + annotation: 'annotationValue', + }; + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.annotationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.annotationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('annotationPath', () => { + const result = client.annotationPath( + 'projectNumberValue', + 'locationValue', + 'corpusValue', + 'assetValue', + 'annotationValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.annotationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectNumberFromAnnotationName', () => { + const result = client.matchProjectNumberFromAnnotationName(fakePath); + assert.strictEqual(result, 'projectNumberValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAnnotationName', () => { + const result = client.matchLocationFromAnnotationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchCorpusFromAnnotationName', () => { + const result = client.matchCorpusFromAnnotationName(fakePath); + assert.strictEqual(result, 'corpusValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAssetFromAnnotationName', () => { + const result = client.matchAssetFromAnnotationName(fakePath); + assert.strictEqual(result, 'assetValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAnnotationFromAnnotationName', () => { + const result = client.matchAnnotationFromAnnotationName(fakePath); + assert.strictEqual(result, 'annotationValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('application', async () => { + const fakePath = '/rendered/path/application'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + application: 'applicationValue', + }; + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.applicationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.applicationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('applicationPath', () => { + const result = client.applicationPath( + 'projectValue', + 'locationValue', + 'applicationValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.applicationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromApplicationName', () => { + const result = client.matchProjectFromApplicationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.applicationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromApplicationName', () => { + const result = client.matchLocationFromApplicationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.applicationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchApplicationFromApplicationName', () => { + const result = client.matchApplicationFromApplicationName(fakePath); + assert.strictEqual(result, 'applicationValue'); + assert( + (client.pathTemplates.applicationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('asset', async () => { + const fakePath = '/rendered/path/asset'; + const expectedParameters = { + project_number: 'projectNumberValue', + location: 'locationValue', + corpus: 'corpusValue', + asset: 'assetValue', + }; + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.assetPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.assetPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('assetPath', () => { + const result = client.assetPath( + 'projectNumberValue', + 'locationValue', + 'corpusValue', + 'assetValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.assetPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectNumberFromAssetName', () => { + const result = client.matchProjectNumberFromAssetName(fakePath); + assert.strictEqual(result, 'projectNumberValue'); + assert( + (client.pathTemplates.assetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAssetName', () => { + const result = client.matchLocationFromAssetName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.assetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchCorpusFromAssetName', () => { + const result = client.matchCorpusFromAssetName(fakePath); + assert.strictEqual(result, 'corpusValue'); + assert( + (client.pathTemplates.assetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAssetFromAssetName', () => { + const result = client.matchAssetFromAssetName(fakePath); + assert.strictEqual(result, 'assetValue'); + assert( + (client.pathTemplates.assetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('channel', async () => { + const fakePath = '/rendered/path/channel'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cluster: 'clusterValue', + channel: 'channelValue', + }; + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.channelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.channelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('channelPath', () => { + const result = client.channelPath( + 'projectValue', + 'locationValue', + 'clusterValue', + 'channelValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.channelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromChannelName', () => { + const result = client.matchProjectFromChannelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.channelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromChannelName', () => { + const result = client.matchLocationFromChannelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.channelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchClusterFromChannelName', () => { + const result = client.matchClusterFromChannelName(fakePath); + assert.strictEqual(result, 'clusterValue'); + assert( + (client.pathTemplates.channelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchChannelFromChannelName', () => { + const result = client.matchChannelFromChannelName(fakePath); + assert.strictEqual(result, 'channelValue'); + assert( + (client.pathTemplates.channelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('cluster', async () => { + const fakePath = '/rendered/path/cluster'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cluster: 'clusterValue', + }; + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.clusterPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.clusterPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('clusterPath', () => { + const result = client.clusterPath( + 'projectValue', + 'locationValue', + 'clusterValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.clusterPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromClusterName', () => { + const result = client.matchProjectFromClusterName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.clusterPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromClusterName', () => { + const result = client.matchLocationFromClusterName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.clusterPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchClusterFromClusterName', () => { + const result = client.matchClusterFromClusterName(fakePath); + assert.strictEqual(result, 'clusterValue'); + assert( + (client.pathTemplates.clusterPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('corpus', async () => { + const fakePath = '/rendered/path/corpus'; + const expectedParameters = { + project_number: 'projectNumberValue', + location: 'locationValue', + corpus: 'corpusValue', + }; + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.corpusPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.corpusPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('corpusPath', () => { + const result = client.corpusPath( + 'projectNumberValue', + 'locationValue', + 'corpusValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.corpusPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectNumberFromCorpusName', () => { + const result = client.matchProjectNumberFromCorpusName(fakePath); + assert.strictEqual(result, 'projectNumberValue'); + assert( + (client.pathTemplates.corpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromCorpusName', () => { + const result = client.matchLocationFromCorpusName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.corpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchCorpusFromCorpusName', () => { + const result = client.matchCorpusFromCorpusName(fakePath); + assert.strictEqual(result, 'corpusValue'); + assert( + (client.pathTemplates.corpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('dataSchema', async () => { + const fakePath = '/rendered/path/dataSchema'; + const expectedParameters = { + project_number: 'projectNumberValue', + location: 'locationValue', + corpus: 'corpusValue', + data_schema: 'dataSchemaValue', + }; + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.dataSchemaPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.dataSchemaPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('dataSchemaPath', () => { + const result = client.dataSchemaPath( + 'projectNumberValue', + 'locationValue', + 'corpusValue', + 'dataSchemaValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.dataSchemaPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectNumberFromDataSchemaName', () => { + const result = client.matchProjectNumberFromDataSchemaName(fakePath); + assert.strictEqual(result, 'projectNumberValue'); + assert( + (client.pathTemplates.dataSchemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromDataSchemaName', () => { + const result = client.matchLocationFromDataSchemaName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.dataSchemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchCorpusFromDataSchemaName', () => { + const result = client.matchCorpusFromDataSchemaName(fakePath); + assert.strictEqual(result, 'corpusValue'); + assert( + (client.pathTemplates.dataSchemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDataSchemaFromDataSchemaName', () => { + const result = client.matchDataSchemaFromDataSchemaName(fakePath); + assert.strictEqual(result, 'dataSchemaValue'); + assert( + (client.pathTemplates.dataSchemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('draft', async () => { + const fakePath = '/rendered/path/draft'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + application: 'applicationValue', + draft: 'draftValue', + }; + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.draftPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.draftPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('draftPath', () => { + const result = client.draftPath( + 'projectValue', + 'locationValue', + 'applicationValue', + 'draftValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.draftPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromDraftName', () => { + const result = client.matchProjectFromDraftName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.draftPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromDraftName', () => { + const result = client.matchLocationFromDraftName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.draftPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchApplicationFromDraftName', () => { + const result = client.matchApplicationFromDraftName(fakePath); + assert.strictEqual(result, 'applicationValue'); + assert( + (client.pathTemplates.draftPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDraftFromDraftName', () => { + const result = client.matchDraftFromDraftName(fakePath); + assert.strictEqual(result, 'draftValue'); + assert( + (client.pathTemplates.draftPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('event', async () => { + const fakePath = '/rendered/path/event'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cluster: 'clusterValue', + event: 'eventValue', + }; + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.eventPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.eventPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('eventPath', () => { + const result = client.eventPath( + 'projectValue', + 'locationValue', + 'clusterValue', + 'eventValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.eventPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEventName', () => { + const result = client.matchProjectFromEventName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.eventPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEventName', () => { + const result = client.matchLocationFromEventName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.eventPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchClusterFromEventName', () => { + const result = client.matchClusterFromEventName(fakePath); + assert.strictEqual(result, 'clusterValue'); + assert( + (client.pathTemplates.eventPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEventFromEventName', () => { + const result = client.matchEventFromEventName(fakePath); + assert.strictEqual(result, 'eventValue'); + assert( + (client.pathTemplates.eventPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('instance', async () => { + const fakePath = '/rendered/path/instance'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + application: 'applicationValue', + instance: 'instanceValue', + }; + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.instancePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.instancePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath( + 'projectValue', + 'locationValue', + 'applicationValue', + 'instanceValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromInstanceName', () => { + const result = client.matchProjectFromInstanceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromInstanceName', () => { + const result = client.matchLocationFromInstanceName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchApplicationFromInstanceName', () => { + const result = client.matchApplicationFromInstanceName(fakePath); + assert.strictEqual(result, 'applicationValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('location', async () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.locationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.locationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath('projectValue', 'locationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('processor', async () => { + const fakePath = '/rendered/path/processor'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + processor: 'processorValue', + }; + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.processorPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.processorPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('processorPath', () => { + const result = client.processorPath( + 'projectValue', + 'locationValue', + 'processorValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.processorPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProcessorName', () => { + const result = client.matchProjectFromProcessorName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.processorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProcessorName', () => { + const result = client.matchLocationFromProcessorName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.processorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchProcessorFromProcessorName', () => { + const result = client.matchProcessorFromProcessorName(fakePath); + assert.strictEqual(result, 'processorValue'); + assert( + (client.pathTemplates.processorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('project', async () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('searchConfig', async () => { + const fakePath = '/rendered/path/searchConfig'; + const expectedParameters = { + project_number: 'projectNumberValue', + location: 'locationValue', + corpus: 'corpusValue', + search_config: 'searchConfigValue', + }; + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.searchConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.searchConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('searchConfigPath', () => { + const result = client.searchConfigPath( + 'projectNumberValue', + 'locationValue', + 'corpusValue', + 'searchConfigValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.searchConfigPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectNumberFromSearchConfigName', () => { + const result = client.matchProjectNumberFromSearchConfigName(fakePath); + assert.strictEqual(result, 'projectNumberValue'); + assert( + (client.pathTemplates.searchConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromSearchConfigName', () => { + const result = client.matchLocationFromSearchConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.searchConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchCorpusFromSearchConfigName', () => { + const result = client.matchCorpusFromSearchConfigName(fakePath); + assert.strictEqual(result, 'corpusValue'); + assert( + (client.pathTemplates.searchConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSearchConfigFromSearchConfigName', () => { + const result = client.matchSearchConfigFromSearchConfigName(fakePath); + assert.strictEqual(result, 'searchConfigValue'); + assert( + (client.pathTemplates.searchConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('series', async () => { + const fakePath = '/rendered/path/series'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cluster: 'clusterValue', + series: 'seriesValue', + }; + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.seriesPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.seriesPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('seriesPath', () => { + const result = client.seriesPath( + 'projectValue', + 'locationValue', + 'clusterValue', + 'seriesValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.seriesPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSeriesName', () => { + const result = client.matchProjectFromSeriesName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.seriesPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromSeriesName', () => { + const result = client.matchLocationFromSeriesName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.seriesPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchClusterFromSeriesName', () => { + const result = client.matchClusterFromSeriesName(fakePath); + assert.strictEqual(result, 'clusterValue'); + assert( + (client.pathTemplates.seriesPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSeriesFromSeriesName', () => { + const result = client.matchSeriesFromSeriesName(fakePath); + assert.strictEqual(result, 'seriesValue'); + assert( + (client.pathTemplates.seriesPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('stream', async () => { + const fakePath = '/rendered/path/stream'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cluster: 'clusterValue', + stream: 'streamValue', + }; + const client = new streamsserviceModule.v1alpha1.StreamsServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.streamPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.streamPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('streamPath', () => { + const result = client.streamPath( + 'projectValue', + 'locationValue', + 'clusterValue', + 'streamValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.streamPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromStreamName', () => { + const result = client.matchProjectFromStreamName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.streamPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromStreamName', () => { + const result = client.matchLocationFromStreamName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.streamPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchClusterFromStreamName', () => { + const result = client.matchClusterFromStreamName(fakePath); + assert.strictEqual(result, 'clusterValue'); + assert( + (client.pathTemplates.streamPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchStreamFromStreamName', () => { + const result = client.matchStreamFromStreamName(fakePath); + assert.strictEqual(result, 'streamValue'); + assert( + (client.pathTemplates.streamPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-visionai/test/gapic_warehouse_v1alpha1.ts b/packages/google-cloud-visionai/test/gapic_warehouse_v1alpha1.ts new file mode 100644 index 000000000000..04d9e0a50e75 --- /dev/null +++ b/packages/google-cloud-visionai/test/gapic_warehouse_v1alpha1.ts @@ -0,0 +1,7432 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import { SinonStub } from 'sinon'; +import { describe, it } from 'mocha'; +import * as warehouseModule from '../src'; + +import { PassThrough } from 'stream'; + +import { + protobuf, + LROperation, + operationsProtos, + IamProtos, + LocationProtos, +} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json'), +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, { defaults: true }); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject, + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error, +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubBidiStreamingCall( + response?: ResponseType, + error?: Error, +) { + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + return sinon.stub().returns(mockStream); +} + +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error, +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error, +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error, +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error, +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({ done: true, value: undefined }); + } + return Promise.resolve({ done: false, value: responses![counter++] }); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1alpha1.WarehouseClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new warehouseModule.v1alpha1.WarehouseClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'visionai.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new warehouseModule.v1alpha1.WarehouseClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = + warehouseModule.v1alpha1.WarehouseClient.servicePath; + assert.strictEqual(servicePath, 'visionai.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + warehouseModule.v1alpha1.WarehouseClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'visionai.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'visionai.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'visionai.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new warehouseModule.v1alpha1.WarehouseClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'visionai.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new warehouseModule.v1alpha1.WarehouseClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'visionai.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new warehouseModule.v1alpha1.WarehouseClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = warehouseModule.v1alpha1.WarehouseClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new warehouseModule.v1alpha1.WarehouseClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.warehouseStub, undefined); + await client.initialize(); + assert(client.warehouseStub); + }); + + it('has close method for the initialized client', (done) => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.initialize().catch((err) => { + throw err; + }); + assert(client.warehouseStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has close method for the non-initialized client', (done) => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.warehouseStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('createAsset', () => { + it('invokes createAsset without error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.CreateAssetRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.CreateAssetRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Asset(), + ); + client.innerApiCalls.createAsset = stubSimpleCall(expectedResponse); + const [response] = await client.createAsset(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createAsset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAsset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAsset without error using callback', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.CreateAssetRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.CreateAssetRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Asset(), + ); + client.innerApiCalls.createAsset = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createAsset( + request, + ( + err?: Error | null, + result?: protos.google.cloud.visionai.v1alpha1.IAsset | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createAsset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAsset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAsset with error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.CreateAssetRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.CreateAssetRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createAsset = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.createAsset(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createAsset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAsset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAsset with closed client', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.CreateAssetRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.CreateAssetRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.createAsset(request), expectedError); + }); + }); + + describe('updateAsset', () => { + it('invokes updateAsset without error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateAssetRequest(), + ); + request.asset ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateAssetRequest', + ['asset', 'name'], + ); + request.asset.name = defaultValue1; + const expectedHeaderRequestParams = `asset.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Asset(), + ); + client.innerApiCalls.updateAsset = stubSimpleCall(expectedResponse); + const [response] = await client.updateAsset(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateAsset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAsset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAsset without error using callback', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateAssetRequest(), + ); + request.asset ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateAssetRequest', + ['asset', 'name'], + ); + request.asset.name = defaultValue1; + const expectedHeaderRequestParams = `asset.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Asset(), + ); + client.innerApiCalls.updateAsset = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateAsset( + request, + ( + err?: Error | null, + result?: protos.google.cloud.visionai.v1alpha1.IAsset | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateAsset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAsset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAsset with error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateAssetRequest(), + ); + request.asset ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateAssetRequest', + ['asset', 'name'], + ); + request.asset.name = defaultValue1; + const expectedHeaderRequestParams = `asset.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateAsset = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateAsset(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateAsset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAsset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAsset with closed client', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateAssetRequest(), + ); + request.asset ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateAssetRequest', + ['asset', 'name'], + ); + request.asset.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.updateAsset(request), expectedError); + }); + }); + + describe('getAsset', () => { + it('invokes getAsset without error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GetAssetRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GetAssetRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Asset(), + ); + client.innerApiCalls.getAsset = stubSimpleCall(expectedResponse); + const [response] = await client.getAsset(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getAsset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAsset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAsset without error using callback', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GetAssetRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GetAssetRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Asset(), + ); + client.innerApiCalls.getAsset = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getAsset( + request, + ( + err?: Error | null, + result?: protos.google.cloud.visionai.v1alpha1.IAsset | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getAsset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAsset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAsset with error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GetAssetRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GetAssetRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getAsset = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getAsset(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getAsset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAsset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAsset with closed client', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GetAssetRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GetAssetRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getAsset(request), expectedError); + }); + }); + + describe('getCorpus', () => { + it('invokes getCorpus without error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GetCorpusRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GetCorpusRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Corpus(), + ); + client.innerApiCalls.getCorpus = stubSimpleCall(expectedResponse); + const [response] = await client.getCorpus(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getCorpus as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCorpus as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCorpus without error using callback', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GetCorpusRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GetCorpusRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Corpus(), + ); + client.innerApiCalls.getCorpus = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getCorpus( + request, + ( + err?: Error | null, + result?: protos.google.cloud.visionai.v1alpha1.ICorpus | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getCorpus as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCorpus as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCorpus with error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GetCorpusRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GetCorpusRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getCorpus = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getCorpus(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getCorpus as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCorpus as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCorpus with closed client', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GetCorpusRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GetCorpusRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getCorpus(request), expectedError); + }); + }); + + describe('updateCorpus', () => { + it('invokes updateCorpus without error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateCorpusRequest(), + ); + request.corpus ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateCorpusRequest', + ['corpus', 'name'], + ); + request.corpus.name = defaultValue1; + const expectedHeaderRequestParams = `corpus.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Corpus(), + ); + client.innerApiCalls.updateCorpus = stubSimpleCall(expectedResponse); + const [response] = await client.updateCorpus(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateCorpus as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCorpus as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCorpus without error using callback', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateCorpusRequest(), + ); + request.corpus ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateCorpusRequest', + ['corpus', 'name'], + ); + request.corpus.name = defaultValue1; + const expectedHeaderRequestParams = `corpus.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Corpus(), + ); + client.innerApiCalls.updateCorpus = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateCorpus( + request, + ( + err?: Error | null, + result?: protos.google.cloud.visionai.v1alpha1.ICorpus | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateCorpus as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCorpus as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCorpus with error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateCorpusRequest(), + ); + request.corpus ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateCorpusRequest', + ['corpus', 'name'], + ); + request.corpus.name = defaultValue1; + const expectedHeaderRequestParams = `corpus.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCorpus = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateCorpus(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateCorpus as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCorpus as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCorpus with closed client', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateCorpusRequest(), + ); + request.corpus ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateCorpusRequest', + ['corpus', 'name'], + ); + request.corpus.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.updateCorpus(request), expectedError); + }); + }); + + describe('deleteCorpus', () => { + it('invokes deleteCorpus without error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeleteCorpusRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeleteCorpusRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteCorpus = stubSimpleCall(expectedResponse); + const [response] = await client.deleteCorpus(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteCorpus as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCorpus as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCorpus without error using callback', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeleteCorpusRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeleteCorpusRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteCorpus = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteCorpus( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteCorpus as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCorpus as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCorpus with error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeleteCorpusRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeleteCorpusRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCorpus = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteCorpus(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteCorpus as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCorpus as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCorpus with closed client', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeleteCorpusRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeleteCorpusRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.deleteCorpus(request), expectedError); + }); + }); + + describe('createDataSchema', () => { + it('invokes createDataSchema without error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.CreateDataSchemaRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.CreateDataSchemaRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DataSchema(), + ); + client.innerApiCalls.createDataSchema = stubSimpleCall(expectedResponse); + const [response] = await client.createDataSchema(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createDataSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDataSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDataSchema without error using callback', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.CreateDataSchemaRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.CreateDataSchemaRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DataSchema(), + ); + client.innerApiCalls.createDataSchema = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createDataSchema( + request, + ( + err?: Error | null, + result?: protos.google.cloud.visionai.v1alpha1.IDataSchema | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createDataSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDataSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDataSchema with error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.CreateDataSchemaRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.CreateDataSchemaRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createDataSchema = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.createDataSchema(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createDataSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDataSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDataSchema with closed client', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.CreateDataSchemaRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.CreateDataSchemaRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.createDataSchema(request), expectedError); + }); + }); + + describe('updateDataSchema', () => { + it('invokes updateDataSchema without error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateDataSchemaRequest(), + ); + request.dataSchema ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateDataSchemaRequest', + ['dataSchema', 'name'], + ); + request.dataSchema.name = defaultValue1; + const expectedHeaderRequestParams = `data_schema.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DataSchema(), + ); + client.innerApiCalls.updateDataSchema = stubSimpleCall(expectedResponse); + const [response] = await client.updateDataSchema(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateDataSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDataSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDataSchema without error using callback', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateDataSchemaRequest(), + ); + request.dataSchema ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateDataSchemaRequest', + ['dataSchema', 'name'], + ); + request.dataSchema.name = defaultValue1; + const expectedHeaderRequestParams = `data_schema.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DataSchema(), + ); + client.innerApiCalls.updateDataSchema = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateDataSchema( + request, + ( + err?: Error | null, + result?: protos.google.cloud.visionai.v1alpha1.IDataSchema | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateDataSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDataSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDataSchema with error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateDataSchemaRequest(), + ); + request.dataSchema ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateDataSchemaRequest', + ['dataSchema', 'name'], + ); + request.dataSchema.name = defaultValue1; + const expectedHeaderRequestParams = `data_schema.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDataSchema = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateDataSchema(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateDataSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDataSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDataSchema with closed client', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateDataSchemaRequest(), + ); + request.dataSchema ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateDataSchemaRequest', + ['dataSchema', 'name'], + ); + request.dataSchema.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.updateDataSchema(request), expectedError); + }); + }); + + describe('getDataSchema', () => { + it('invokes getDataSchema without error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GetDataSchemaRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GetDataSchemaRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DataSchema(), + ); + client.innerApiCalls.getDataSchema = stubSimpleCall(expectedResponse); + const [response] = await client.getDataSchema(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getDataSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDataSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDataSchema without error using callback', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GetDataSchemaRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GetDataSchemaRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DataSchema(), + ); + client.innerApiCalls.getDataSchema = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDataSchema( + request, + ( + err?: Error | null, + result?: protos.google.cloud.visionai.v1alpha1.IDataSchema | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getDataSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDataSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDataSchema with error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GetDataSchemaRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GetDataSchemaRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getDataSchema = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getDataSchema(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getDataSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDataSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDataSchema with closed client', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GetDataSchemaRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GetDataSchemaRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getDataSchema(request), expectedError); + }); + }); + + describe('deleteDataSchema', () => { + it('invokes deleteDataSchema without error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeleteDataSchemaRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeleteDataSchemaRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteDataSchema = stubSimpleCall(expectedResponse); + const [response] = await client.deleteDataSchema(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteDataSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDataSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDataSchema without error using callback', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeleteDataSchemaRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeleteDataSchemaRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteDataSchema = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteDataSchema( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteDataSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDataSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDataSchema with error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeleteDataSchemaRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeleteDataSchemaRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDataSchema = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteDataSchema(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteDataSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDataSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDataSchema with closed client', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeleteDataSchemaRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeleteDataSchemaRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.deleteDataSchema(request), expectedError); + }); + }); + + describe('createAnnotation', () => { + it('invokes createAnnotation without error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.CreateAnnotationRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.CreateAnnotationRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Annotation(), + ); + client.innerApiCalls.createAnnotation = stubSimpleCall(expectedResponse); + const [response] = await client.createAnnotation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createAnnotation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAnnotation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAnnotation without error using callback', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.CreateAnnotationRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.CreateAnnotationRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Annotation(), + ); + client.innerApiCalls.createAnnotation = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createAnnotation( + request, + ( + err?: Error | null, + result?: protos.google.cloud.visionai.v1alpha1.IAnnotation | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createAnnotation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAnnotation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAnnotation with error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.CreateAnnotationRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.CreateAnnotationRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createAnnotation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.createAnnotation(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createAnnotation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAnnotation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAnnotation with closed client', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.CreateAnnotationRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.CreateAnnotationRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.createAnnotation(request), expectedError); + }); + }); + + describe('getAnnotation', () => { + it('invokes getAnnotation without error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GetAnnotationRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GetAnnotationRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Annotation(), + ); + client.innerApiCalls.getAnnotation = stubSimpleCall(expectedResponse); + const [response] = await client.getAnnotation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getAnnotation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAnnotation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAnnotation without error using callback', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GetAnnotationRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GetAnnotationRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Annotation(), + ); + client.innerApiCalls.getAnnotation = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getAnnotation( + request, + ( + err?: Error | null, + result?: protos.google.cloud.visionai.v1alpha1.IAnnotation | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getAnnotation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAnnotation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAnnotation with error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GetAnnotationRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GetAnnotationRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getAnnotation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getAnnotation(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getAnnotation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAnnotation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAnnotation with closed client', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GetAnnotationRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GetAnnotationRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getAnnotation(request), expectedError); + }); + }); + + describe('updateAnnotation', () => { + it('invokes updateAnnotation without error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateAnnotationRequest(), + ); + request.annotation ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateAnnotationRequest', + ['annotation', 'name'], + ); + request.annotation.name = defaultValue1; + const expectedHeaderRequestParams = `annotation.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Annotation(), + ); + client.innerApiCalls.updateAnnotation = stubSimpleCall(expectedResponse); + const [response] = await client.updateAnnotation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateAnnotation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAnnotation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAnnotation without error using callback', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateAnnotationRequest(), + ); + request.annotation ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateAnnotationRequest', + ['annotation', 'name'], + ); + request.annotation.name = defaultValue1; + const expectedHeaderRequestParams = `annotation.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Annotation(), + ); + client.innerApiCalls.updateAnnotation = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateAnnotation( + request, + ( + err?: Error | null, + result?: protos.google.cloud.visionai.v1alpha1.IAnnotation | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateAnnotation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAnnotation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAnnotation with error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateAnnotationRequest(), + ); + request.annotation ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateAnnotationRequest', + ['annotation', 'name'], + ); + request.annotation.name = defaultValue1; + const expectedHeaderRequestParams = `annotation.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateAnnotation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateAnnotation(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateAnnotation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAnnotation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAnnotation with closed client', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateAnnotationRequest(), + ); + request.annotation ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateAnnotationRequest', + ['annotation', 'name'], + ); + request.annotation.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.updateAnnotation(request), expectedError); + }); + }); + + describe('deleteAnnotation', () => { + it('invokes deleteAnnotation without error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeleteAnnotationRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeleteAnnotationRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteAnnotation = stubSimpleCall(expectedResponse); + const [response] = await client.deleteAnnotation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteAnnotation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAnnotation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAnnotation without error using callback', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeleteAnnotationRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeleteAnnotationRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteAnnotation = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteAnnotation( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteAnnotation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAnnotation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAnnotation with error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeleteAnnotationRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeleteAnnotationRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteAnnotation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteAnnotation(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteAnnotation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAnnotation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAnnotation with closed client', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeleteAnnotationRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeleteAnnotationRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.deleteAnnotation(request), expectedError); + }); + }); + + describe('clipAsset', () => { + it('invokes clipAsset without error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ClipAssetRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ClipAssetRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ClipAssetResponse(), + ); + client.innerApiCalls.clipAsset = stubSimpleCall(expectedResponse); + const [response] = await client.clipAsset(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.clipAsset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.clipAsset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes clipAsset without error using callback', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ClipAssetRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ClipAssetRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ClipAssetResponse(), + ); + client.innerApiCalls.clipAsset = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.clipAsset( + request, + ( + err?: Error | null, + result?: protos.google.cloud.visionai.v1alpha1.IClipAssetResponse | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.clipAsset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.clipAsset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes clipAsset with error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ClipAssetRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ClipAssetRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.clipAsset = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.clipAsset(request), expectedError); + const actualRequest = ( + client.innerApiCalls.clipAsset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.clipAsset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes clipAsset with closed client', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ClipAssetRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ClipAssetRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.clipAsset(request), expectedError); + }); + }); + + describe('generateHlsUri', () => { + it('invokes generateHlsUri without error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GenerateHlsUriRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GenerateHlsUriRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GenerateHlsUriResponse(), + ); + client.innerApiCalls.generateHlsUri = stubSimpleCall(expectedResponse); + const [response] = await client.generateHlsUri(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.generateHlsUri as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.generateHlsUri as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateHlsUri without error using callback', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GenerateHlsUriRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GenerateHlsUriRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GenerateHlsUriResponse(), + ); + client.innerApiCalls.generateHlsUri = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.generateHlsUri( + request, + ( + err?: Error | null, + result?: protos.google.cloud.visionai.v1alpha1.IGenerateHlsUriResponse | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.generateHlsUri as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.generateHlsUri as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateHlsUri with error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GenerateHlsUriRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GenerateHlsUriRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.generateHlsUri = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.generateHlsUri(request), expectedError); + const actualRequest = ( + client.innerApiCalls.generateHlsUri as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.generateHlsUri as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateHlsUri with closed client', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GenerateHlsUriRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GenerateHlsUriRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.generateHlsUri(request), expectedError); + }); + }); + + describe('createSearchConfig', () => { + it('invokes createSearchConfig without error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.CreateSearchConfigRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.CreateSearchConfigRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.SearchConfig(), + ); + client.innerApiCalls.createSearchConfig = + stubSimpleCall(expectedResponse); + const [response] = await client.createSearchConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createSearchConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSearchConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSearchConfig without error using callback', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.CreateSearchConfigRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.CreateSearchConfigRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.SearchConfig(), + ); + client.innerApiCalls.createSearchConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createSearchConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.visionai.v1alpha1.ISearchConfig | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createSearchConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSearchConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSearchConfig with error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.CreateSearchConfigRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.CreateSearchConfigRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSearchConfig = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.createSearchConfig(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createSearchConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSearchConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSearchConfig with closed client', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.CreateSearchConfigRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.CreateSearchConfigRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.createSearchConfig(request), expectedError); + }); + }); + + describe('updateSearchConfig', () => { + it('invokes updateSearchConfig without error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateSearchConfigRequest(), + ); + request.searchConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateSearchConfigRequest', + ['searchConfig', 'name'], + ); + request.searchConfig.name = defaultValue1; + const expectedHeaderRequestParams = `search_config.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.SearchConfig(), + ); + client.innerApiCalls.updateSearchConfig = + stubSimpleCall(expectedResponse); + const [response] = await client.updateSearchConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSearchConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSearchConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSearchConfig without error using callback', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateSearchConfigRequest(), + ); + request.searchConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateSearchConfigRequest', + ['searchConfig', 'name'], + ); + request.searchConfig.name = defaultValue1; + const expectedHeaderRequestParams = `search_config.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.SearchConfig(), + ); + client.innerApiCalls.updateSearchConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateSearchConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.visionai.v1alpha1.ISearchConfig | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSearchConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSearchConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSearchConfig with error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateSearchConfigRequest(), + ); + request.searchConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateSearchConfigRequest', + ['searchConfig', 'name'], + ); + request.searchConfig.name = defaultValue1; + const expectedHeaderRequestParams = `search_config.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSearchConfig = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateSearchConfig(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateSearchConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSearchConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSearchConfig with closed client', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.UpdateSearchConfigRequest(), + ); + request.searchConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.UpdateSearchConfigRequest', + ['searchConfig', 'name'], + ); + request.searchConfig.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.updateSearchConfig(request), expectedError); + }); + }); + + describe('getSearchConfig', () => { + it('invokes getSearchConfig without error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GetSearchConfigRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GetSearchConfigRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.SearchConfig(), + ); + client.innerApiCalls.getSearchConfig = stubSimpleCall(expectedResponse); + const [response] = await client.getSearchConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getSearchConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSearchConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSearchConfig without error using callback', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GetSearchConfigRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GetSearchConfigRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.SearchConfig(), + ); + client.innerApiCalls.getSearchConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSearchConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.visionai.v1alpha1.ISearchConfig | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getSearchConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSearchConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSearchConfig with error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GetSearchConfigRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GetSearchConfigRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getSearchConfig = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getSearchConfig(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getSearchConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSearchConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSearchConfig with closed client', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.GetSearchConfigRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.GetSearchConfigRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getSearchConfig(request), expectedError); + }); + }); + + describe('deleteSearchConfig', () => { + it('invokes deleteSearchConfig without error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeleteSearchConfigRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeleteSearchConfigRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteSearchConfig = + stubSimpleCall(expectedResponse); + const [response] = await client.deleteSearchConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteSearchConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSearchConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSearchConfig without error using callback', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeleteSearchConfigRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeleteSearchConfigRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteSearchConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteSearchConfig( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteSearchConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSearchConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSearchConfig with error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeleteSearchConfigRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeleteSearchConfigRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSearchConfig = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteSearchConfig(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteSearchConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSearchConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSearchConfig with closed client', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeleteSearchConfigRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeleteSearchConfigRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.deleteSearchConfig(request), expectedError); + }); + }); + + describe('deleteAsset', () => { + it('invokes deleteAsset without error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeleteAssetRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeleteAssetRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.deleteAsset = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteAsset(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteAsset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAsset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAsset without error using callback', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeleteAssetRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeleteAssetRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.deleteAsset = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteAsset( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IDeleteAssetMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.visionai.v1alpha1.IDeleteAssetMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteAsset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAsset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAsset with call error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeleteAssetRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeleteAssetRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteAsset = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteAsset(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteAsset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAsset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAsset with LRO error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DeleteAssetRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.DeleteAssetRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteAsset = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.deleteAsset(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteAsset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAsset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteAssetProgress without error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteAssetProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteAssetProgress with error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.checkDeleteAssetProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createCorpus', () => { + it('invokes createCorpus without error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.CreateCorpusRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.CreateCorpusRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createCorpus = stubLongRunningCall(expectedResponse); + const [operation] = await client.createCorpus(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createCorpus as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCorpus as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCorpus without error using callback', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.CreateCorpusRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.CreateCorpusRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createCorpus = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createCorpus( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.visionai.v1alpha1.ICorpus, + protos.google.cloud.visionai.v1alpha1.ICreateCorpusMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.visionai.v1alpha1.ICorpus, + protos.google.cloud.visionai.v1alpha1.ICreateCorpusMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createCorpus as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCorpus as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCorpus with call error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.CreateCorpusRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.CreateCorpusRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCorpus = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.createCorpus(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createCorpus as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCorpus as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCorpus with LRO error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.CreateCorpusRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.CreateCorpusRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCorpus = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.createCorpus(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createCorpus as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCorpus as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateCorpusProgress without error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + expectedResponse.name = 'test'; + expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; + expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateCorpusProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateCorpusProgress with error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.checkCreateCorpusProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('ingestAsset', () => { + it('invokes ingestAsset without error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.IngestAssetRequest(), + ); + + const expectedResponse = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.IngestAssetResponse(), + ); + client.innerApiCalls.ingestAsset = + stubBidiStreamingCall(expectedResponse); + const stream = client.ingestAsset(); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + ( + response: protos.google.cloud.visionai.v1alpha1.IngestAssetResponse, + ) => { + resolve(response); + }, + ); + stream.on('error', (err: Error) => { + reject(err); + }); + stream.write(request); + stream.end(); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.ingestAsset as SinonStub) + .getCall(0) + .calledWith(null), + ); + assert.deepStrictEqual( + ((stream as unknown as PassThrough)._transform as SinonStub).getCall(0) + .args[0], + request, + ); + }); + + it('invokes ingestAsset with error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.IngestAssetRequest(), + ); + const expectedError = new Error('expected'); + client.innerApiCalls.ingestAsset = stubBidiStreamingCall( + undefined, + expectedError, + ); + const stream = client.ingestAsset(); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + ( + response: protos.google.cloud.visionai.v1alpha1.IngestAssetResponse, + ) => { + resolve(response); + }, + ); + stream.on('error', (err: Error) => { + reject(err); + }); + stream.write(request); + stream.end(); + }); + await assert.rejects(promise, expectedError); + assert( + (client.innerApiCalls.ingestAsset as SinonStub) + .getCall(0) + .calledWith(null), + ); + assert.deepStrictEqual( + ((stream as unknown as PassThrough)._transform as SinonStub).getCall(0) + .args[0], + request, + ); + }); + }); + + describe('listAssets', () => { + it('invokes listAssets without error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListAssetsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListAssetsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Asset(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Asset(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Asset(), + ), + ]; + client.innerApiCalls.listAssets = stubSimpleCall(expectedResponse); + const [response] = await client.listAssets(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAssets without error using callback', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListAssetsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListAssetsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Asset(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Asset(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Asset(), + ), + ]; + client.innerApiCalls.listAssets = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAssets( + request, + ( + err?: Error | null, + result?: protos.google.cloud.visionai.v1alpha1.IAsset[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAssets with error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListAssetsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListAssetsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listAssets = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listAssets(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAssetsStream without error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListAssetsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListAssetsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Asset(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Asset(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Asset(), + ), + ]; + client.descriptors.page.listAssets.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listAssetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.visionai.v1alpha1.Asset[] = []; + stream.on( + 'data', + (response: protos.google.cloud.visionai.v1alpha1.Asset) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listAssets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listAssets, request), + ); + assert( + (client.descriptors.page.listAssets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listAssetsStream with error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListAssetsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListAssetsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAssets.createStream = stubPageStreamingCall( + undefined, + expectedError, + ); + const stream = client.listAssetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.visionai.v1alpha1.Asset[] = []; + stream.on( + 'data', + (response: protos.google.cloud.visionai.v1alpha1.Asset) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listAssets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listAssets, request), + ); + assert( + (client.descriptors.page.listAssets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listAssets without error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListAssetsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListAssetsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Asset(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Asset(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Asset(), + ), + ]; + client.descriptors.page.listAssets.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.visionai.v1alpha1.IAsset[] = []; + const iterable = client.listAssetsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( + 0, + ).args[1], + request, + ); + assert( + (client.descriptors.page.listAssets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listAssets with error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListAssetsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListAssetsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAssets.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError, + ); + const iterable = client.listAssetsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.visionai.v1alpha1.IAsset[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( + 0, + ).args[1], + request, + ); + assert( + (client.descriptors.page.listAssets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + + describe('listCorpora', () => { + it('invokes listCorpora without error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListCorporaRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListCorporaRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Corpus(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Corpus(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Corpus(), + ), + ]; + client.innerApiCalls.listCorpora = stubSimpleCall(expectedResponse); + const [response] = await client.listCorpora(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listCorpora as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCorpora as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCorpora without error using callback', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListCorporaRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListCorporaRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Corpus(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Corpus(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Corpus(), + ), + ]; + client.innerApiCalls.listCorpora = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listCorpora( + request, + ( + err?: Error | null, + result?: protos.google.cloud.visionai.v1alpha1.ICorpus[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listCorpora as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCorpora as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCorpora with error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListCorporaRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListCorporaRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listCorpora = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listCorpora(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listCorpora as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCorpora as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCorporaStream without error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListCorporaRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListCorporaRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Corpus(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Corpus(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Corpus(), + ), + ]; + client.descriptors.page.listCorpora.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listCorporaStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.visionai.v1alpha1.Corpus[] = []; + stream.on( + 'data', + (response: protos.google.cloud.visionai.v1alpha1.Corpus) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listCorpora.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listCorpora, request), + ); + assert( + (client.descriptors.page.listCorpora.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listCorporaStream with error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListCorporaRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListCorporaRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listCorpora.createStream = stubPageStreamingCall( + undefined, + expectedError, + ); + const stream = client.listCorporaStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.visionai.v1alpha1.Corpus[] = []; + stream.on( + 'data', + (response: protos.google.cloud.visionai.v1alpha1.Corpus) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listCorpora.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listCorpora, request), + ); + assert( + (client.descriptors.page.listCorpora.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listCorpora without error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListCorporaRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListCorporaRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Corpus(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Corpus(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Corpus(), + ), + ]; + client.descriptors.page.listCorpora.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.visionai.v1alpha1.ICorpus[] = []; + const iterable = client.listCorporaAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listCorpora.asyncIterate as SinonStub).getCall( + 0, + ).args[1], + request, + ); + assert( + (client.descriptors.page.listCorpora.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listCorpora with error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListCorporaRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListCorporaRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listCorpora.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError, + ); + const iterable = client.listCorporaAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.visionai.v1alpha1.ICorpus[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listCorpora.asyncIterate as SinonStub).getCall( + 0, + ).args[1], + request, + ); + assert( + (client.descriptors.page.listCorpora.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + + describe('listDataSchemas', () => { + it('invokes listDataSchemas without error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListDataSchemasRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListDataSchemasRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DataSchema(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DataSchema(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DataSchema(), + ), + ]; + client.innerApiCalls.listDataSchemas = stubSimpleCall(expectedResponse); + const [response] = await client.listDataSchemas(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listDataSchemas as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDataSchemas as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDataSchemas without error using callback', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListDataSchemasRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListDataSchemasRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DataSchema(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DataSchema(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DataSchema(), + ), + ]; + client.innerApiCalls.listDataSchemas = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDataSchemas( + request, + ( + err?: Error | null, + result?: protos.google.cloud.visionai.v1alpha1.IDataSchema[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listDataSchemas as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDataSchemas as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDataSchemas with error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListDataSchemasRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListDataSchemasRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDataSchemas = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listDataSchemas(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listDataSchemas as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDataSchemas as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDataSchemasStream without error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListDataSchemasRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListDataSchemasRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DataSchema(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DataSchema(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DataSchema(), + ), + ]; + client.descriptors.page.listDataSchemas.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listDataSchemasStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.visionai.v1alpha1.DataSchema[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.visionai.v1alpha1.DataSchema) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listDataSchemas.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listDataSchemas, request), + ); + assert( + (client.descriptors.page.listDataSchemas.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listDataSchemasStream with error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListDataSchemasRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListDataSchemasRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDataSchemas.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listDataSchemasStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.visionai.v1alpha1.DataSchema[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.visionai.v1alpha1.DataSchema) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listDataSchemas.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listDataSchemas, request), + ); + assert( + (client.descriptors.page.listDataSchemas.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listDataSchemas without error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListDataSchemasRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListDataSchemasRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DataSchema(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DataSchema(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.DataSchema(), + ), + ]; + client.descriptors.page.listDataSchemas.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.visionai.v1alpha1.IDataSchema[] = []; + const iterable = client.listDataSchemasAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listDataSchemas.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listDataSchemas.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listDataSchemas with error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListDataSchemasRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListDataSchemasRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDataSchemas.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDataSchemasAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.visionai.v1alpha1.IDataSchema[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listDataSchemas.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listDataSchemas.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + + describe('listAnnotations', () => { + it('invokes listAnnotations without error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListAnnotationsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListAnnotationsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Annotation(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Annotation(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Annotation(), + ), + ]; + client.innerApiCalls.listAnnotations = stubSimpleCall(expectedResponse); + const [response] = await client.listAnnotations(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listAnnotations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAnnotations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAnnotations without error using callback', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListAnnotationsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListAnnotationsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Annotation(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Annotation(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Annotation(), + ), + ]; + client.innerApiCalls.listAnnotations = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAnnotations( + request, + ( + err?: Error | null, + result?: protos.google.cloud.visionai.v1alpha1.IAnnotation[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listAnnotations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAnnotations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAnnotations with error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListAnnotationsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListAnnotationsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listAnnotations = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listAnnotations(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listAnnotations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAnnotations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAnnotationsStream without error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListAnnotationsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListAnnotationsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Annotation(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Annotation(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Annotation(), + ), + ]; + client.descriptors.page.listAnnotations.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listAnnotationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.visionai.v1alpha1.Annotation[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.visionai.v1alpha1.Annotation) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listAnnotations.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listAnnotations, request), + ); + assert( + (client.descriptors.page.listAnnotations.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listAnnotationsStream with error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListAnnotationsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListAnnotationsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAnnotations.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listAnnotationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.visionai.v1alpha1.Annotation[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.visionai.v1alpha1.Annotation) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listAnnotations.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listAnnotations, request), + ); + assert( + (client.descriptors.page.listAnnotations.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listAnnotations without error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListAnnotationsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListAnnotationsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Annotation(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Annotation(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.Annotation(), + ), + ]; + client.descriptors.page.listAnnotations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.visionai.v1alpha1.IAnnotation[] = []; + const iterable = client.listAnnotationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listAnnotations.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listAnnotations.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listAnnotations with error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListAnnotationsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListAnnotationsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAnnotations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listAnnotationsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.visionai.v1alpha1.IAnnotation[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listAnnotations.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listAnnotations.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + + describe('listSearchConfigs', () => { + it('invokes listSearchConfigs without error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListSearchConfigsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListSearchConfigsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.SearchConfig(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.SearchConfig(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.SearchConfig(), + ), + ]; + client.innerApiCalls.listSearchConfigs = stubSimpleCall(expectedResponse); + const [response] = await client.listSearchConfigs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSearchConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSearchConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSearchConfigs without error using callback', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListSearchConfigsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListSearchConfigsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.SearchConfig(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.SearchConfig(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.SearchConfig(), + ), + ]; + client.innerApiCalls.listSearchConfigs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSearchConfigs( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.visionai.v1alpha1.ISearchConfig[] + | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSearchConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSearchConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSearchConfigs with error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListSearchConfigsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListSearchConfigsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listSearchConfigs = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listSearchConfigs(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listSearchConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSearchConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSearchConfigsStream without error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListSearchConfigsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListSearchConfigsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.SearchConfig(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.SearchConfig(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.SearchConfig(), + ), + ]; + client.descriptors.page.listSearchConfigs.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listSearchConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.visionai.v1alpha1.SearchConfig[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.visionai.v1alpha1.SearchConfig) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listSearchConfigs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSearchConfigs, request), + ); + assert( + (client.descriptors.page.listSearchConfigs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listSearchConfigsStream with error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListSearchConfigsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListSearchConfigsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSearchConfigs.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listSearchConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.visionai.v1alpha1.SearchConfig[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.visionai.v1alpha1.SearchConfig) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listSearchConfigs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSearchConfigs, request), + ); + assert( + (client.descriptors.page.listSearchConfigs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listSearchConfigs without error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListSearchConfigsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListSearchConfigsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.SearchConfig(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.SearchConfig(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.SearchConfig(), + ), + ]; + client.descriptors.page.listSearchConfigs.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.visionai.v1alpha1.ISearchConfig[] = + []; + const iterable = client.listSearchConfigsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listSearchConfigs.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listSearchConfigs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listSearchConfigs with error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.ListSearchConfigsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.ListSearchConfigsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSearchConfigs.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listSearchConfigsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.visionai.v1alpha1.ISearchConfig[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listSearchConfigs.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listSearchConfigs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + + describe('searchAssets', () => { + it('invokes searchAssets without error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.SearchAssetsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.SearchAssetsRequest', + ['corpus'], + ); + request.corpus = defaultValue1; + const expectedHeaderRequestParams = `corpus=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.SearchResultItem(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.SearchResultItem(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.SearchResultItem(), + ), + ]; + client.innerApiCalls.searchAssets = stubSimpleCall(expectedResponse); + const [response] = await client.searchAssets(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.searchAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchAssets without error using callback', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.SearchAssetsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.SearchAssetsRequest', + ['corpus'], + ); + request.corpus = defaultValue1; + const expectedHeaderRequestParams = `corpus=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.SearchResultItem(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.SearchResultItem(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.SearchResultItem(), + ), + ]; + client.innerApiCalls.searchAssets = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.searchAssets( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.visionai.v1alpha1.ISearchResultItem[] + | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.searchAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchAssets with error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.SearchAssetsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.SearchAssetsRequest', + ['corpus'], + ); + request.corpus = defaultValue1; + const expectedHeaderRequestParams = `corpus=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.searchAssets = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.searchAssets(request), expectedError); + const actualRequest = ( + client.innerApiCalls.searchAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchAssetsStream without error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.SearchAssetsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.SearchAssetsRequest', + ['corpus'], + ); + request.corpus = defaultValue1; + const expectedHeaderRequestParams = `corpus=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.SearchResultItem(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.SearchResultItem(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.SearchResultItem(), + ), + ]; + client.descriptors.page.searchAssets.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.searchAssetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.visionai.v1alpha1.SearchResultItem[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.visionai.v1alpha1.SearchResultItem, + ) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.searchAssets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.searchAssets, request), + ); + assert( + (client.descriptors.page.searchAssets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes searchAssetsStream with error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.SearchAssetsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.SearchAssetsRequest', + ['corpus'], + ); + request.corpus = defaultValue1; + const expectedHeaderRequestParams = `corpus=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.searchAssets.createStream = stubPageStreamingCall( + undefined, + expectedError, + ); + const stream = client.searchAssetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.visionai.v1alpha1.SearchResultItem[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.visionai.v1alpha1.SearchResultItem, + ) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.searchAssets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.searchAssets, request), + ); + assert( + (client.descriptors.page.searchAssets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with searchAssets without error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.SearchAssetsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.SearchAssetsRequest', + ['corpus'], + ); + request.corpus = defaultValue1; + const expectedHeaderRequestParams = `corpus=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.SearchResultItem(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.SearchResultItem(), + ), + generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.SearchResultItem(), + ), + ]; + client.descriptors.page.searchAssets.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.visionai.v1alpha1.ISearchResultItem[] = + []; + const iterable = client.searchAssetsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.searchAssets.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.searchAssets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with searchAssets with error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.visionai.v1alpha1.SearchAssetsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.visionai.v1alpha1.SearchAssetsRequest', + ['corpus'], + ); + request.corpus = defaultValue1; + const expectedHeaderRequestParams = `corpus=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.searchAssets.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.searchAssetsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.visionai.v1alpha1.ISearchResultItem[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.searchAssets.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.searchAssets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy(), + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes getIamPolicy without error using callback', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy(), + ); + client.iamClient.getIamPolicy = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client + .getIamPolicy( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.Policy | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub).getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.getIamPolicy(request, expectedOptions), + expectedError, + ); + assert( + (client.iamClient.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy(), + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes setIamPolicy without error using callback', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy(), + ); + client.iamClient.setIamPolicy = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client + .setIamPolicy( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.Policy | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub).getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.setIamPolicy(request, expectedOptions), + expectedError, + ); + assert( + (client.iamClient.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse(), + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions( + request, + expectedOptions, + ); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes testIamPermissions without error using callback', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse(), + ); + client.iamClient.testIamPermissions = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client + .testIamPermissions( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.TestIamPermissionsResponse | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub).getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest(), + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.testIamPermissions(request, expectedOptions), + expectedError, + ); + assert( + (client.iamClient.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError, + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined), + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location(), + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest(), + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest(), + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request), + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest(), + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + client.operationsClient.getOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient + .getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest(), + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(async () => { + await client.getOperation(request); + }, expectedError); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request), + ); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest(), + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.operationsClient.cancelOperation = + stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request), + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest(), + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.operationsClient.cancelOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient + .cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub).getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest(), + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(async () => { + await client.cancelOperation(request); + }, expectedError); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request), + ); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest(), + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.operationsClient.deleteOperation = + stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request), + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest(), + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.operationsClient.deleteOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient + .deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub).getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest(), + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(async () => { + await client.deleteOperation(request); + }, expectedError); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request), + ); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest(), + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse(), + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse(), + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse(), + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.IOperation[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest(), + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.IOperation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + }); + }); + + describe('Path templates', () => { + describe('analysis', async () => { + const fakePath = '/rendered/path/analysis'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cluster: 'clusterValue', + analysis: 'analysisValue', + }; + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.analysisPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.analysisPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('analysisPath', () => { + const result = client.analysisPath( + 'projectValue', + 'locationValue', + 'clusterValue', + 'analysisValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.analysisPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromAnalysisName', () => { + const result = client.matchProjectFromAnalysisName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.analysisPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAnalysisName', () => { + const result = client.matchLocationFromAnalysisName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.analysisPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchClusterFromAnalysisName', () => { + const result = client.matchClusterFromAnalysisName(fakePath); + assert.strictEqual(result, 'clusterValue'); + assert( + (client.pathTemplates.analysisPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAnalysisFromAnalysisName', () => { + const result = client.matchAnalysisFromAnalysisName(fakePath); + assert.strictEqual(result, 'analysisValue'); + assert( + (client.pathTemplates.analysisPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('annotation', async () => { + const fakePath = '/rendered/path/annotation'; + const expectedParameters = { + project_number: 'projectNumberValue', + location: 'locationValue', + corpus: 'corpusValue', + asset: 'assetValue', + annotation: 'annotationValue', + }; + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.annotationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.annotationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('annotationPath', () => { + const result = client.annotationPath( + 'projectNumberValue', + 'locationValue', + 'corpusValue', + 'assetValue', + 'annotationValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.annotationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectNumberFromAnnotationName', () => { + const result = client.matchProjectNumberFromAnnotationName(fakePath); + assert.strictEqual(result, 'projectNumberValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAnnotationName', () => { + const result = client.matchLocationFromAnnotationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchCorpusFromAnnotationName', () => { + const result = client.matchCorpusFromAnnotationName(fakePath); + assert.strictEqual(result, 'corpusValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAssetFromAnnotationName', () => { + const result = client.matchAssetFromAnnotationName(fakePath); + assert.strictEqual(result, 'assetValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAnnotationFromAnnotationName', () => { + const result = client.matchAnnotationFromAnnotationName(fakePath); + assert.strictEqual(result, 'annotationValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('application', async () => { + const fakePath = '/rendered/path/application'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + application: 'applicationValue', + }; + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.applicationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.applicationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('applicationPath', () => { + const result = client.applicationPath( + 'projectValue', + 'locationValue', + 'applicationValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.applicationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromApplicationName', () => { + const result = client.matchProjectFromApplicationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.applicationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromApplicationName', () => { + const result = client.matchLocationFromApplicationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.applicationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchApplicationFromApplicationName', () => { + const result = client.matchApplicationFromApplicationName(fakePath); + assert.strictEqual(result, 'applicationValue'); + assert( + (client.pathTemplates.applicationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('asset', async () => { + const fakePath = '/rendered/path/asset'; + const expectedParameters = { + project_number: 'projectNumberValue', + location: 'locationValue', + corpus: 'corpusValue', + asset: 'assetValue', + }; + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.assetPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.assetPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('assetPath', () => { + const result = client.assetPath( + 'projectNumberValue', + 'locationValue', + 'corpusValue', + 'assetValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.assetPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectNumberFromAssetName', () => { + const result = client.matchProjectNumberFromAssetName(fakePath); + assert.strictEqual(result, 'projectNumberValue'); + assert( + (client.pathTemplates.assetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromAssetName', () => { + const result = client.matchLocationFromAssetName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.assetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchCorpusFromAssetName', () => { + const result = client.matchCorpusFromAssetName(fakePath); + assert.strictEqual(result, 'corpusValue'); + assert( + (client.pathTemplates.assetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchAssetFromAssetName', () => { + const result = client.matchAssetFromAssetName(fakePath); + assert.strictEqual(result, 'assetValue'); + assert( + (client.pathTemplates.assetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('channel', async () => { + const fakePath = '/rendered/path/channel'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cluster: 'clusterValue', + channel: 'channelValue', + }; + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.channelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.channelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('channelPath', () => { + const result = client.channelPath( + 'projectValue', + 'locationValue', + 'clusterValue', + 'channelValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.channelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromChannelName', () => { + const result = client.matchProjectFromChannelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.channelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromChannelName', () => { + const result = client.matchLocationFromChannelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.channelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchClusterFromChannelName', () => { + const result = client.matchClusterFromChannelName(fakePath); + assert.strictEqual(result, 'clusterValue'); + assert( + (client.pathTemplates.channelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchChannelFromChannelName', () => { + const result = client.matchChannelFromChannelName(fakePath); + assert.strictEqual(result, 'channelValue'); + assert( + (client.pathTemplates.channelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('cluster', async () => { + const fakePath = '/rendered/path/cluster'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cluster: 'clusterValue', + }; + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.clusterPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.clusterPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('clusterPath', () => { + const result = client.clusterPath( + 'projectValue', + 'locationValue', + 'clusterValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.clusterPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromClusterName', () => { + const result = client.matchProjectFromClusterName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.clusterPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromClusterName', () => { + const result = client.matchLocationFromClusterName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.clusterPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchClusterFromClusterName', () => { + const result = client.matchClusterFromClusterName(fakePath); + assert.strictEqual(result, 'clusterValue'); + assert( + (client.pathTemplates.clusterPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('corpus', async () => { + const fakePath = '/rendered/path/corpus'; + const expectedParameters = { + project_number: 'projectNumberValue', + location: 'locationValue', + corpus: 'corpusValue', + }; + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.corpusPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.corpusPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('corpusPath', () => { + const result = client.corpusPath( + 'projectNumberValue', + 'locationValue', + 'corpusValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.corpusPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectNumberFromCorpusName', () => { + const result = client.matchProjectNumberFromCorpusName(fakePath); + assert.strictEqual(result, 'projectNumberValue'); + assert( + (client.pathTemplates.corpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromCorpusName', () => { + const result = client.matchLocationFromCorpusName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.corpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchCorpusFromCorpusName', () => { + const result = client.matchCorpusFromCorpusName(fakePath); + assert.strictEqual(result, 'corpusValue'); + assert( + (client.pathTemplates.corpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('dataSchema', async () => { + const fakePath = '/rendered/path/dataSchema'; + const expectedParameters = { + project_number: 'projectNumberValue', + location: 'locationValue', + corpus: 'corpusValue', + data_schema: 'dataSchemaValue', + }; + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.dataSchemaPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.dataSchemaPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('dataSchemaPath', () => { + const result = client.dataSchemaPath( + 'projectNumberValue', + 'locationValue', + 'corpusValue', + 'dataSchemaValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.dataSchemaPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectNumberFromDataSchemaName', () => { + const result = client.matchProjectNumberFromDataSchemaName(fakePath); + assert.strictEqual(result, 'projectNumberValue'); + assert( + (client.pathTemplates.dataSchemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromDataSchemaName', () => { + const result = client.matchLocationFromDataSchemaName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.dataSchemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchCorpusFromDataSchemaName', () => { + const result = client.matchCorpusFromDataSchemaName(fakePath); + assert.strictEqual(result, 'corpusValue'); + assert( + (client.pathTemplates.dataSchemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDataSchemaFromDataSchemaName', () => { + const result = client.matchDataSchemaFromDataSchemaName(fakePath); + assert.strictEqual(result, 'dataSchemaValue'); + assert( + (client.pathTemplates.dataSchemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('draft', async () => { + const fakePath = '/rendered/path/draft'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + application: 'applicationValue', + draft: 'draftValue', + }; + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.draftPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.draftPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('draftPath', () => { + const result = client.draftPath( + 'projectValue', + 'locationValue', + 'applicationValue', + 'draftValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.draftPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromDraftName', () => { + const result = client.matchProjectFromDraftName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.draftPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromDraftName', () => { + const result = client.matchLocationFromDraftName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.draftPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchApplicationFromDraftName', () => { + const result = client.matchApplicationFromDraftName(fakePath); + assert.strictEqual(result, 'applicationValue'); + assert( + (client.pathTemplates.draftPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchDraftFromDraftName', () => { + const result = client.matchDraftFromDraftName(fakePath); + assert.strictEqual(result, 'draftValue'); + assert( + (client.pathTemplates.draftPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('event', async () => { + const fakePath = '/rendered/path/event'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cluster: 'clusterValue', + event: 'eventValue', + }; + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.eventPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.eventPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('eventPath', () => { + const result = client.eventPath( + 'projectValue', + 'locationValue', + 'clusterValue', + 'eventValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.eventPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromEventName', () => { + const result = client.matchProjectFromEventName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.eventPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromEventName', () => { + const result = client.matchLocationFromEventName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.eventPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchClusterFromEventName', () => { + const result = client.matchClusterFromEventName(fakePath); + assert.strictEqual(result, 'clusterValue'); + assert( + (client.pathTemplates.eventPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchEventFromEventName', () => { + const result = client.matchEventFromEventName(fakePath); + assert.strictEqual(result, 'eventValue'); + assert( + (client.pathTemplates.eventPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('instance', async () => { + const fakePath = '/rendered/path/instance'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + application: 'applicationValue', + instance: 'instanceValue', + }; + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.instancePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.instancePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath( + 'projectValue', + 'locationValue', + 'applicationValue', + 'instanceValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromInstanceName', () => { + const result = client.matchProjectFromInstanceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromInstanceName', () => { + const result = client.matchLocationFromInstanceName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchApplicationFromInstanceName', () => { + const result = client.matchApplicationFromInstanceName(fakePath); + assert.strictEqual(result, 'applicationValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('processor', async () => { + const fakePath = '/rendered/path/processor'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + processor: 'processorValue', + }; + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.processorPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.processorPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('processorPath', () => { + const result = client.processorPath( + 'projectValue', + 'locationValue', + 'processorValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.processorPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProcessorName', () => { + const result = client.matchProjectFromProcessorName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.processorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProcessorName', () => { + const result = client.matchLocationFromProcessorName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.processorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchProcessorFromProcessorName', () => { + const result = client.matchProcessorFromProcessorName(fakePath); + assert.strictEqual(result, 'processorValue'); + assert( + (client.pathTemplates.processorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('searchConfig', async () => { + const fakePath = '/rendered/path/searchConfig'; + const expectedParameters = { + project_number: 'projectNumberValue', + location: 'locationValue', + corpus: 'corpusValue', + search_config: 'searchConfigValue', + }; + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.searchConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.searchConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('searchConfigPath', () => { + const result = client.searchConfigPath( + 'projectNumberValue', + 'locationValue', + 'corpusValue', + 'searchConfigValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.searchConfigPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectNumberFromSearchConfigName', () => { + const result = client.matchProjectNumberFromSearchConfigName(fakePath); + assert.strictEqual(result, 'projectNumberValue'); + assert( + (client.pathTemplates.searchConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromSearchConfigName', () => { + const result = client.matchLocationFromSearchConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.searchConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchCorpusFromSearchConfigName', () => { + const result = client.matchCorpusFromSearchConfigName(fakePath); + assert.strictEqual(result, 'corpusValue'); + assert( + (client.pathTemplates.searchConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSearchConfigFromSearchConfigName', () => { + const result = client.matchSearchConfigFromSearchConfigName(fakePath); + assert.strictEqual(result, 'searchConfigValue'); + assert( + (client.pathTemplates.searchConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('series', async () => { + const fakePath = '/rendered/path/series'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cluster: 'clusterValue', + series: 'seriesValue', + }; + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.seriesPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.seriesPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('seriesPath', () => { + const result = client.seriesPath( + 'projectValue', + 'locationValue', + 'clusterValue', + 'seriesValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.seriesPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromSeriesName', () => { + const result = client.matchProjectFromSeriesName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.seriesPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromSeriesName', () => { + const result = client.matchLocationFromSeriesName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.seriesPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchClusterFromSeriesName', () => { + const result = client.matchClusterFromSeriesName(fakePath); + assert.strictEqual(result, 'clusterValue'); + assert( + (client.pathTemplates.seriesPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSeriesFromSeriesName', () => { + const result = client.matchSeriesFromSeriesName(fakePath); + assert.strictEqual(result, 'seriesValue'); + assert( + (client.pathTemplates.seriesPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('stream', async () => { + const fakePath = '/rendered/path/stream'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cluster: 'clusterValue', + stream: 'streamValue', + }; + const client = new warehouseModule.v1alpha1.WarehouseClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.streamPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.streamPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('streamPath', () => { + const result = client.streamPath( + 'projectValue', + 'locationValue', + 'clusterValue', + 'streamValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.streamPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromStreamName', () => { + const result = client.matchProjectFromStreamName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.streamPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromStreamName', () => { + const result = client.matchLocationFromStreamName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.streamPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchClusterFromStreamName', () => { + const result = client.matchClusterFromStreamName(fakePath); + assert.strictEqual(result, 'clusterValue'); + assert( + (client.pathTemplates.streamPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchStreamFromStreamName', () => { + const result = client.matchStreamFromStreamName(fakePath); + assert.strictEqual(result, 'streamValue'); + assert( + (client.pathTemplates.streamPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +});